1
1
module . exports = {
2
2
env : {
3
3
browser : true ,
4
+ node : true ,
4
5
} ,
5
6
extends : [
6
- 'airbnb-base' ,
7
7
'eslint:recommended' ,
8
- 'plugin:vue/recommended' ,
8
+ 'plugin:vue/essential' ,
9
+ 'plugin:@typescript-eslint/recommended' ,
10
+ '@vue/typescript/recommended' ,
11
+ 'prettier' ,
12
+ './.eslintrc-auto-import.json' ,
9
13
] ,
10
- parser : 'vue-eslint-parser' ,
11
- parserOptions : {
12
- ecmaFeatures : {
13
- jsx : true ,
14
+ ignorePatterns : [
15
+ '.eslintrc.js' ,
16
+ 'stylelint.config.js' ,
17
+ 'vite.build.config.mts' ,
18
+ 'vite.config.mts' ,
19
+ 'vitest.config.mts' ,
20
+ '*.bk.vue' ,
21
+ ] ,
22
+ overrides : [
23
+ {
24
+ files : [
25
+ '**/*.spec.{j,t}s?(x)' ,
26
+ ] ,
27
+ env : {
28
+ jest : true ,
29
+ } ,
14
30
} ,
15
- ecmaVersion : 12 ,
16
- parser : '@babel/eslint-parser' ,
17
- requireConfigFile : false ,
18
- sourceType : 'module' ,
31
+ ] ,
32
+ globals : {
33
+ Entry : true ,
34
+ } ,
35
+ parserOptions : {
36
+ parser : '@typescript-eslint/parser' ,
19
37
} ,
20
38
plugins : [
39
+ '@typescript-eslint' ,
21
40
'import' ,
41
+ 'prettier' ,
22
42
'vue' ,
23
- '@babel' ,
24
43
] ,
44
+ root : true ,
25
45
settings : {
26
46
'import/resolver' : {
27
- 'babel-module' : { } ,
28
47
} ,
29
48
} ,
30
49
rules : {
31
- 'arrow-spacing' : [ 'error' , { after : true , before : true } ] ,
50
+ '@typescript-eslint/ban-ts-comment' : 0 ,
51
+ '@typescript-eslint/ban-types' : [
52
+ 'error' ,
53
+ {
54
+ 'extendDefaults' : true ,
55
+ 'types' : {
56
+ '{}' : false ,
57
+ }
58
+ } ,
59
+ ] ,
60
+ '@typescript-eslint/no-empty-function' : 0 ,
61
+ '@typescript-eslint/no-explicit-any' : 0 ,
32
62
'brace-style' : [ 'error' , 'stroustrup' ] ,
33
- 'comma-dangle' : [ 'error' , 'always-multiline' ] ,
34
63
'default-case' : [
35
64
'error' , {
36
65
commentPattern : '^skip\\sdefault' ,
37
66
} ,
38
67
] ,
39
68
'func-names' : [ 'error' , 'never' ] ,
40
69
'function-paren-newline' : 0 ,
41
- 'implicit-arrow-linebreak' : [ 'warn' , 'beside' ] ,
42
- 'import/no-extraneous-dependencies' : [
43
- 'error' ,
44
- {
45
- devDependencies : [
46
- '**/vite.*.js' ,
47
- ] ,
48
- } ,
49
- ] ,
50
70
'import/no-self-import' : 0 ,
51
- 'import/prefer-default-export' : 0 ,
71
+ 'import/no-extraneous-dependencies' : 0 ,
72
+ 'implicit-arrow-linebreak' : [ 'warn' , 'beside' ] ,
52
73
indent : [ 2 , 'tab' , { SwitchCase : 1 } ] ,
74
+ 'no-tabs' : [ 0 , { allowIndentationTabs : true } ] ,
53
75
'linebreak-style' : 0 ,
54
76
'max-len' : 0 ,
55
-
56
- 'no-console' : [ 'warn' , { allow : [ 'warn' , 'error' ] } ] ,
57
- 'no-debugger' : 0 ,
58
77
'no-else-return' : [ 'error' , { allowElseIf : true } ] ,
59
- 'no-multiple-empty-lines' : [ 'error' , { max : 2 , maxEOF : 0 } ] ,
78
+ 'no-console' : [ 'warn' , { allow : [ 'warn' , 'error' , 'info' , 'trace' ] } ] ,
79
+ 'no-const-assign' : 'error' ,
80
+ 'no-debugger' : 0 ,
60
81
'no-new' : 0 ,
82
+ 'no-undef' : 0 ,
83
+ 'no-unused-vars' : 1 ,
84
+ 'no-use-before-define' : 0 ,
85
+ 'no-useless-escape' : 0 ,
61
86
'no-param-reassign' : [
62
87
'error' , {
63
- ignorePropertyModificationsFor : [ 'Vue' , 'field' , 'model' , 'el' , 'item' , 'state' ] ,
64
88
props : true ,
89
+ ignorePropertyModificationsFor : [ 'field' , 'model' , 'el' , 'item' , 'state' , 'Vue' , 'vue' ] ,
65
90
} ,
66
91
] ,
67
- 'no-plusplus' : [
68
- 'error' , { allowForLoopAfterthoughts : true } ,
69
- ] ,
70
- 'no-tabs' : [ 0 , { allowIndentationTabs : true } ] ,
71
92
'no-underscore-dangle' : [
72
93
'error' , {
73
- allow : [ '_data' , '__dirname' , '__filename' ] ,
94
+ allow : [ '_data' ] ,
74
95
allowAfterThis : true ,
75
96
} ,
76
97
] ,
77
- 'no-unused-vars' : 1 ,
78
- 'no-useless-escape' : 0 ,
98
+ 'no-plusplus' : [
99
+ 'error' , { allowForLoopAfterthoughts : true } ,
100
+ ] ,
79
101
'object-curly-newline' : [ 'error' , {
80
102
ObjectPattern : { multiline : false } ,
81
103
} ] ,
@@ -89,23 +111,14 @@ module.exports = {
89
111
enforceForRenamedProperties : false ,
90
112
} ,
91
113
] ,
92
- quotes : [ 'error' , 'single' , { avoidEscape : true } ] ,
93
- semi : [ 'error' , 'always' ] ,
94
- 'sort-imports' : [ 'error' , {
95
- allowSeparatedGroups : false ,
96
- ignoreCase : true ,
97
- ignoreDeclarationSort : true ,
98
- ignoreMemberSort : false ,
99
- memberSyntaxSortOrder : [ 'none' , 'single' , 'all' , 'multiple' ] ,
100
- } ] ,
101
114
'space-before-function-paren' : [ 'error' , {
102
115
anonymous : 'never' ,
103
- asyncArrow : 'never' ,
104
116
named : 'never' ,
117
+ asyncArrow : 'always' ,
105
118
} ] ,
106
119
'vue/attributes-order' : [ 'error' , {
107
- alphabetical : true ,
108
- order : [
120
+ ' alphabetical' : true ,
121
+ ' order' : [
109
122
'DEFINITION' ,
110
123
'LIST_RENDERING' ,
111
124
'CONDITIONALS' ,
@@ -119,69 +132,22 @@ module.exports = {
119
132
'CONTENT' ,
120
133
] ,
121
134
} ] ,
122
- 'vue/component-tags-order' : [ 'error' , {
123
- order : [ 'template' , 'script' , 'style' ] ,
124
- } ] ,
125
135
'vue/html-closing-bracket-newline' : 0 ,
126
- 'vue/html-comment-content-spacing' : [ 'error' ,
127
- 'always' ,
128
- ] ,
129
136
'vue/html-indent' : 0 ,
130
137
'vue/html-self-closing' : 0 ,
131
138
'vue/max-attributes-per-line' : 0 ,
132
- 'vue/multi-word-component-names ' : 0 ,
139
+ 'vue/no-multiple-template-root ' : 0 ,
133
140
'vue/no-template-shadow' : 0 ,
141
+ 'vue/no-v-for-template-key' : 0 ,
134
142
'vue/no-v-html' : 0 ,
135
- 'vue/no-v-text-v-html-on-component' : 0 ,
136
- 'vue/order-in-components' : [ 'error' , {
137
- order : [
138
- 'el' ,
139
- 'name' ,
140
- 'key' ,
141
- 'parent' ,
142
- 'functional' ,
143
- [ 'delimiters' , 'comments' ] ,
144
- [ 'components' , 'directives' , 'filters' ] ,
145
- 'extends' ,
146
- 'mixins' ,
147
- [ 'provide' , 'inject' ] ,
148
- 'ROUTER_GUARDS' ,
149
- 'layout' ,
150
- 'middleware' ,
151
- 'validate' ,
152
- 'scrollToTop' ,
153
- 'transition' ,
154
- 'loading' ,
155
- 'inheritAttrs' ,
156
- 'model' ,
157
- [ 'props' , 'propsData' ] ,
158
- 'emits' ,
159
- 'setup' ,
160
- 'asyncData' ,
161
- 'data' ,
162
- 'fetch' ,
163
- 'head' ,
164
- 'computed' ,
165
- 'watch' ,
166
- 'watchQuery' ,
167
- 'beforeCreate' ,
168
- 'created' ,
169
- 'beforeMount' ,
170
- 'mounted' ,
171
- 'beforeUpdate' ,
172
- 'updated' ,
173
- 'activated' ,
174
- 'deactivated' ,
175
- 'beforeDestroy' ,
176
- 'destroyed' ,
177
- 'errorCaptured' , // for Vue.js 2.5.0+
178
- 'methods' ,
179
- [ 'template' , 'render' ] ,
180
- 'renderError' ,
181
- ] ,
182
- } ] ,
183
- 'vue/padding-line-between-blocks' : 1 ,
184
- 'vue/require-name-property' : 1 ,
185
143
'vue/singleline-html-element-content-newline' : 0 ,
144
+ 'vue/sort-keys' : [ 'error' , 'asc' , {
145
+ caseSensitive : true ,
146
+ ignoreChildrenOf : [ 'model' , 'defineProps' ] ,
147
+ ignoreGrandchildrenOf : [ 'computed' , 'directives' , 'inject' , 'props' , 'watch' , 'defineProps' ] ,
148
+ minKeys : 2 ,
149
+ natural : true ,
150
+ } ] ,
151
+ 'vue/valid-template-root' : 0 ,
186
152
} ,
187
153
} ;
0 commit comments