1
1
// eslint.config.js
2
2
import eslint from '@eslint/js' ;
3
- import importPlugin from 'eslint-plugin-import ' ;
3
+ import wdnsConfig from '@wdns/ eslint-config-wdns ' ;
4
4
import pluginVue from 'eslint-plugin-vue' ;
5
- import prettier from 'eslint-plugin-prettier' ;
6
5
import tseslint from 'typescript-eslint' ;
7
- import typescript from '@typescript-eslint/eslint-plugin' ;
8
- import AutoImportJson from "./.eslintrc-auto-import.json" with { type : "json" } ;
9
- import globals from 'globals' ;
6
+ import AutoImportJson from './.eslintrc-auto-import.json' with { type : 'json' } ;
7
+ import vueTsEslintConfig from '@vue/eslint-config-typescript' ;
10
8
11
9
12
10
export default tseslint . config (
13
11
eslint . configs . recommended ,
14
12
...tseslint . configs . recommended ,
15
13
...pluginVue . configs [ 'flat/essential' ] ,
14
+ ...vueTsEslintConfig ( ) ,
15
+ ...wdnsConfig ,
16
16
{
17
17
ignores : [
18
- '.eslintrc.js' ,
19
- 'stylelint.config.js' ,
20
18
'vite.build.config.mts' ,
21
19
'vite.config.mts' ,
22
- '*.bk.vue' ,
23
- '*.spec.ts' ,
24
20
'src/playground/configs/templates/PlaygroundPage.vue' ,
25
- 'src/**/*.spec.ts' ,
26
- 'src/**/*.test.ts' ,
27
21
] ,
28
22
} ,
29
23
{
30
24
name : 'app/files-to-lint' ,
31
25
files : [ '**/*.{ts,mts,tsx,vue}' ] ,
32
- } ,
33
- {
34
- files : [ '**/*.{js,ts,vue}' ] ,
35
26
languageOptions : {
36
27
...AutoImportJson ,
37
28
ecmaVersion : 'latest' ,
38
- globals : {
39
- ...globals . node ,
40
- ...globals . browser ,
41
- } ,
42
29
sourceType : 'module' ,
43
30
parserOptions : {
44
31
parser : tseslint . parser ,
@@ -48,264 +35,7 @@ export default tseslint.config(
48
35
} ,
49
36
} ,
50
37
plugins : {
51
- pluginVue,
52
38
'typescript-eslint' : tseslint . plugin ,
53
- prettier,
54
- import : importPlugin ,
55
- } ,
56
- rules : {
57
- // ESLint core and TypeScript rules //
58
- ...eslint . configs . recommended . rules ,
59
- ...typescript . configs . recommended . rules ,
60
- ...typescript . configs [ 'recommended-type-checked' ] . rules ,
61
-
62
- // Custom rules //
63
- '@typescript-eslint/ban-ts-comment' : 0 ,
64
- '@typescript-eslint/no-empty-function' : 0 ,
65
- '@typescript-eslint/no-empty-object-type' : 0 ,
66
- '@typescript-eslint/no-explicit-any' : 0 ,
67
- '@typescript-eslint/no-unsafe-assignment' : 0 ,
68
- '@typescript-eslint/no-unsafe-member-access' : 0 ,
69
- 'arrow-spacing' : [ 'error' , { after : true , before : true } ] ,
70
- 'brace-style' : [ 'error' , 'stroustrup' ] ,
71
- 'comma-dangle' : [ 'error' , 'always-multiline' ] ,
72
- 'default-case' : [
73
- 'error' , {
74
- commentPattern : '^skip\\sdefault' ,
75
- } ,
76
- ] ,
77
- 'func-names' : [ 'error' , 'never' ] ,
78
- 'function-paren-newline' : 0 ,
79
- 'implicit-arrow-linebreak' : [ 'warn' , 'beside' ] ,
80
- "import/order" : [
81
- "error" ,
82
- {
83
- "groups" : [
84
- "builtin" ,
85
- "external" ,
86
- "type" ,
87
- "internal" ,
88
- "parent" ,
89
- "sibling" ,
90
- "index" ,
91
- ] ,
92
- "pathGroups" : [
93
- {
94
- "pattern" : "@" ,
95
- "group" : "internal"
96
- } ,
97
- {
98
- "pattern" : "@Libraries/**" ,
99
- "group" : "internal"
100
- } ,
101
- {
102
- "pattern" : "@Layouts/**" ,
103
- "group" : "internal"
104
- } ,
105
- {
106
- "pattern" : "@Components/Layouts/**" ,
107
- "group" : "internal" ,
108
- "position" : "before"
109
- } ,
110
- {
111
- "pattern" : "@Components/Elements/**" ,
112
- "group" : "internal" ,
113
- "position" : "before"
114
- } ,
115
- {
116
- "pattern" : "@Components/Pages/**" ,
117
- "group" : "internal" ,
118
- "position" : "before"
119
- } ,
120
- {
121
- "pattern" : "@Components/EasterEggs/**" ,
122
- "group" : "internal" ,
123
- "position" : "before"
124
- } ,
125
- {
126
- "pattern" : "@Composables/**" ,
127
- "group" : "internal" ,
128
- "position" : "before"
129
- } ,
130
- {
131
- "pattern" : "@Plugins/*" ,
132
- "group" : "internal" ,
133
- "position" : "before"
134
- } ,
135
- {
136
- "pattern" : "@Stores/**" ,
137
- "group" : "internal" ,
138
- "position" : "before"
139
- } ,
140
- {
141
- "pattern" : "@Types/**" ,
142
- "group" : "type"
143
- } ,
144
- ] ,
145
- "pathGroupsExcludedImportTypes" :
146
- [ "internal" ] ,
147
- "alphabetize" : {
148
- "order" : "asc" ,
149
- "caseInsensitive" : true
150
- }
151
- }
152
- ] ,
153
- 'import/no-extraneous-dependencies' : [ 'error' , { 'devDependencies' : true } ] ,
154
- 'import/no-self-import' : 0 ,
155
- 'import/prefer-default-export' : 0 ,
156
- indent : [ 2 , 'tab' , { SwitchCase : 1 } ] ,
157
- 'linebreak-style' : 0 ,
158
- 'max-len' : 0 ,
159
-
160
- 'no-console' : [ 'warn' , { allow : [ 'warn' , 'error' , 'info' ] } ] ,
161
- 'no-debugger' : 0 ,
162
- 'no-else-return' : [ 'error' , { allowElseIf : true } ] ,
163
- 'no-multiple-empty-lines' : [ 'error' , { 'max' : 2 , 'maxEOF' : 0 } ] ,
164
- 'no-new' : 0 ,
165
- 'no-param-reassign' : [
166
- 'error' , {
167
- ignorePropertyModificationsFor : [ 'field' , 'model' , 'el' , 'item' , 'state' ] ,
168
- props : true ,
169
- } ,
170
- ] ,
171
- 'no-plusplus' : [
172
- 'error' , { allowForLoopAfterthoughts : true } ,
173
- ] ,
174
- 'no-tabs' : [ 0 , { allowIndentationTabs : true } ] ,
175
- 'no-undef' : 'off' ,
176
- 'no-underscore-dangle' : [
177
- 'error' , {
178
- allow : [ '_data' , '__dirname' , '__filename' , '__name' ] ,
179
- allowAfterThis : true ,
180
- } ,
181
- ] ,
182
- 'no-unused-vars' : 1 ,
183
- 'no-useless-escape' : 0 ,
184
- 'object-curly-newline' : [ 'error' , {
185
- ObjectPattern : { multiline : false } ,
186
- } ] ,
187
- 'operator-linebreak' : [ 'error' , 'after' ] ,
188
- 'prefer-destructuring' : [
189
- 'error' , {
190
- array : false ,
191
- object : false ,
192
- } ,
193
- {
194
- enforceForRenamedProperties : false ,
195
- } ,
196
- ] ,
197
- 'quotes' : [ 'error' , 'single' , { avoidEscape : true } ] ,
198
- 'semi' : [ 'error' , 'always' ] ,
199
- 'sort-imports' : [ 'error' , {
200
- 'allowSeparatedGroups' : true ,
201
- 'ignoreCase' : false ,
202
- 'ignoreDeclarationSort' : true ,
203
- 'ignoreMemberSort' : false ,
204
- 'memberSyntaxSortOrder' : [
205
- 'none' ,
206
- 'single' ,
207
- 'all' ,
208
- 'multiple' ,
209
- ] ,
210
- } ] ,
211
- 'space-before-function-paren' : [ 'error' , {
212
- anonymous : 'never' ,
213
- asyncArrow : 'always' ,
214
- named : 'never' ,
215
- } ] ,
216
- 'vue/attributes-order' : [ 'error' , {
217
- 'alphabetical' : true ,
218
- 'order' : [
219
- 'DEFINITION' ,
220
- 'LIST_RENDERING' ,
221
- 'CONDITIONALS' ,
222
- 'RENDER_MODIFIERS' ,
223
- 'GLOBAL' ,
224
- [ 'UNIQUE' , 'SLOT' ] ,
225
- 'TWO_WAY_BINDING' ,
226
- 'OTHER_DIRECTIVES' ,
227
- 'OTHER_ATTR' ,
228
- 'EVENTS' ,
229
- 'CONTENT' ,
230
- ] ,
231
- } ] ,
232
- 'vue/component-tags-order' : [ 'error' , {
233
- 'order' : [ 'template' , 'script' , 'style' ] ,
234
- } ] ,
235
- 'vue/html-closing-bracket-newline' : 0 ,
236
- 'vue/html-comment-content-spacing' : [ 'error' ,
237
- 'always' ,
238
- ] ,
239
- 'vue/html-indent' : 0 ,
240
- 'vue/html-self-closing' : 0 ,
241
- 'vue/max-attributes-per-line' : 0 ,
242
- 'vue/multi-word-component-names' : 0 ,
243
- 'vue/no-multiple-template-root' : 0 ,
244
- 'vue/no-template-shadow' : 0 ,
245
- 'vue/no-v-for-template-key-on-child' : 0 ,
246
- 'vue/no-v-html' : 0 ,
247
- 'vue/no-v-text-v-html-on-component' : 0 ,
248
- 'vue/order-in-components' : [ 'error' , {
249
- 'order' : [
250
- 'el' ,
251
- 'name' ,
252
- 'key' ,
253
- 'parent' ,
254
- 'functional' ,
255
- [ 'delimiters' , 'comments' ] ,
256
- [ 'components' , 'directives' , 'filters' ] ,
257
- 'extends' ,
258
- 'mixins' ,
259
- [ 'provide' , 'inject' ] ,
260
- 'ROUTER_GUARDS' ,
261
- 'layout' ,
262
- 'middleware' ,
263
- 'validate' ,
264
- 'scrollToTop' ,
265
- 'transition' ,
266
- 'loading' ,
267
- 'inheritAttrs' ,
268
- 'model' ,
269
- [ 'props' , 'propsData' ] ,
270
- 'emits' ,
271
- 'setup' ,
272
- 'asyncData' ,
273
- 'data' ,
274
- 'fetch' ,
275
- 'head' ,
276
- 'computed' ,
277
- 'watch' ,
278
- 'watchQuery' ,
279
- 'beforeCreate' ,
280
- 'created' ,
281
- 'beforeMount' ,
282
- 'mounted' ,
283
- 'beforeUpdate' ,
284
- 'updated' ,
285
- 'activated' ,
286
- 'deactivated' ,
287
- 'beforeUnmount' , // for Vue.js 3.x
288
- 'unmounted' , // for Vue.js 3.x
289
- 'beforeDestroy' ,
290
- 'destroyed' ,
291
- 'renderTracked' , // for Vue.js 3.x
292
- 'renderTriggered' , // for Vue.js 3.x
293
- 'errorCaptured' , // for Vue.js 2.5.0+
294
- 'methods' ,
295
- [ 'template' , 'render' ] ,
296
- 'renderError' ,
297
- ] ,
298
- } ] ,
299
- 'vue/padding-line-between-blocks' : 1 ,
300
- 'vue/require-name-property' : 1 ,
301
- 'vue/singleline-html-element-content-newline' : 0 ,
302
- 'vue/sort-keys' : [ 'warn' , 'asc' , {
303
- caseSensitive : true ,
304
- ignoreChildrenOf : [ 'model' , 'defineProps' ] ,
305
- ignoreGrandchildrenOf : [ 'computed' , 'directives' , 'inject' , 'props' , 'watch' , 'defineProps' ] ,
306
- minKeys : 2 ,
307
- natural : true ,
308
- } ] ,
309
39
} ,
310
40
settings : {
311
41
'import/resolver' : {
@@ -315,5 +45,5 @@ export default tseslint.config(
315
45
} ,
316
46
} ,
317
47
} ,
318
- }
48
+ } ,
319
49
) ;
0 commit comments