-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy patheslint.config.js
95 lines (94 loc) · 2.24 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import js from '@eslint/js'
import tseslint from 'typescript-eslint'
import globals from 'globals'
import vuePlugin from 'eslint-plugin-vue'
import prettierPlugin from 'eslint-plugin-prettier'
import checkFilePlugin from 'eslint-plugin-check-file'
import prettierConfig from 'eslint-config-prettier/flat'
export default tseslint.config(
{
ignores: ['node_modules/**', 'dist/**', '**/*.json'],
},
js.configs.recommended,
tseslint.configs.strict,
tseslint.configs.stylistic,
...vuePlugin.configs['flat/recommended'],
{
files: ['src/**/*.{ts,vue}'],
plugins: {
'@typescript-eslint': tseslint.plugin,
},
languageOptions: {
globals: {
...globals.browser,
},
parserOptions: {
parser: tseslint.parser,
project: './tsconfig.json',
extraFileExtensions: ['.vue'],
ecmaVersion: 'latest',
sourceType: 'module',
},
},
rules: {
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'enum',
format: ['PascalCase'],
},
{
selector: 'enumMember',
format: ['PascalCase'],
},
{
selector: 'typeParameter',
format: ['PascalCase'],
prefix: ['T'],
},
{
selector: 'interface',
format: ['PascalCase'],
prefix: ['I'],
},
],
},
},
{
files: ['**/*.scss'],
processor: 'check-file/eslint-processor-check-file',
},
{
files: ['src/**/*.*'],
plugins: {
prettier: prettierPlugin,
'check-file': checkFilePlugin,
},
rules: {
'prettier/prettier': 'error',
'check-file/no-index': [
'error',
{
ignoreMiddleExtensions: true,
},
],
'check-file/folder-naming-convention': [
'error',
{
'src/*/': 'CAMEL_CASE',
},
],
'check-file/filename-naming-convention': [
'error',
{
'src/components/*.vue': 'PASCAL_CASE',
'src/composables/*.ts': 'CAMEL_CASE',
'src/data/*.json': 'SNAKE_CASE',
'src/helpers/*.ts': 'CAMEL_CASE',
'src/services/*.ts': 'PASCAL_CASE',
},
],
},
},
prettierConfig
)