@tb-dev/eslint-config 3.5.0 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +704 -704
- package/dist/index.js +704 -704
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -22,24 +22,24 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
24
|
const eslintConfigPrettier = require("eslint-config-prettier");
|
|
25
|
-
const globals = require("globals");
|
|
26
25
|
const process = require("node:process");
|
|
26
|
+
const globals = require("globals");
|
|
27
27
|
var Glob = /* @__PURE__ */ ((Glob2) => {
|
|
28
|
-
Glob2["
|
|
29
|
-
Glob2["
|
|
30
|
-
Glob2["
|
|
31
|
-
Glob2["
|
|
32
|
-
Glob2["
|
|
28
|
+
Glob2["All"] = "**/*.?([cm])[jt]s?(x)";
|
|
29
|
+
Glob2["Javascript"] = "**/*.?([cm])js?(x)";
|
|
30
|
+
Glob2["Typescript"] = "**/*.?([cm])ts?(x)";
|
|
31
|
+
Glob2["Vitest"] = "**/*.{test,spec}.[jt]s";
|
|
32
|
+
Glob2["Vue"] = "**/*.vue";
|
|
33
33
|
return Glob2;
|
|
34
34
|
})(Glob || {});
|
|
35
35
|
var GlobIgnore = /* @__PURE__ */ ((GlobIgnore2) => {
|
|
36
|
-
GlobIgnore2["
|
|
37
|
-
GlobIgnore2["
|
|
38
|
-
GlobIgnore2["
|
|
39
|
-
GlobIgnore2["
|
|
40
|
-
GlobIgnore2["
|
|
41
|
-
GlobIgnore2["
|
|
42
|
-
GlobIgnore2["
|
|
36
|
+
GlobIgnore2["Cache"] = "**/cache";
|
|
37
|
+
GlobIgnore2["Dist"] = "**/dist";
|
|
38
|
+
GlobIgnore2["Log"] = "**/log?(s)";
|
|
39
|
+
GlobIgnore2["NodeModules"] = "**/node_modules";
|
|
40
|
+
GlobIgnore2["Out"] = "**/out";
|
|
41
|
+
GlobIgnore2["Target"] = "**/target";
|
|
42
|
+
GlobIgnore2["Temp"] = "**/?(.)temp";
|
|
43
43
|
return GlobIgnore2;
|
|
44
44
|
})(GlobIgnore || {});
|
|
45
45
|
async function interopDefault(promise) {
|
|
@@ -49,503 +49,347 @@ async function interopDefault(promise) {
|
|
|
49
49
|
function getIgnores() {
|
|
50
50
|
return Object.values(GlobIgnore);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
const { overrides } = options;
|
|
54
|
-
const files = [Glob.ALL];
|
|
55
|
-
if (options.vue)
|
|
56
|
-
files.push(Glob.VUE);
|
|
57
|
-
return {
|
|
58
|
-
files,
|
|
59
|
-
languageOptions: {
|
|
60
|
-
ecmaVersion: "latest",
|
|
61
|
-
sourceType: "module",
|
|
62
|
-
globals: {
|
|
63
|
-
...globals.browser,
|
|
64
|
-
...globals.es2021,
|
|
65
|
-
...globals.node,
|
|
66
|
-
document: "readonly",
|
|
67
|
-
window: "readonly"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
rules: {
|
|
71
|
-
"accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
|
|
72
|
-
"array-callback-return": [
|
|
73
|
-
"error",
|
|
74
|
-
{
|
|
75
|
-
checkForEach: true,
|
|
76
|
-
allowVoid: true
|
|
77
|
-
}
|
|
78
|
-
],
|
|
79
|
-
"block-scoped-var": "error",
|
|
80
|
-
"consistent-this": ["error", "self"],
|
|
81
|
-
"default-case-last": "error",
|
|
82
|
-
eqeqeq: ["error", "always"],
|
|
83
|
-
"for-direction": "error",
|
|
84
|
-
"func-style": ["error", "declaration", { allowArrowFunctions: true }],
|
|
85
|
-
"grouped-accessor-pairs": ["error", "getBeforeSet"],
|
|
86
|
-
"guard-for-in": "error",
|
|
87
|
-
"init-declarations": "off",
|
|
88
|
-
"logical-assignment-operators": ["error", "always", { enforceForIfStatements: true }],
|
|
89
|
-
"max-params": "off",
|
|
90
|
-
"new-cap": ["error", { newIsCap: true, capIsNew: false, properties: true }],
|
|
91
|
-
"no-alert": "error",
|
|
92
|
-
"no-async-promise-executor": "error",
|
|
93
|
-
"no-caller": "error",
|
|
94
|
-
"no-case-declarations": "error",
|
|
95
|
-
"no-class-assign": "error",
|
|
96
|
-
"no-compare-neg-zero": "error",
|
|
97
|
-
"no-cond-assign": ["error", "always"],
|
|
98
|
-
"no-constant-binary-expression": "error",
|
|
99
|
-
"no-constant-condition": "error",
|
|
100
|
-
"no-constructor-return": "error",
|
|
101
|
-
"no-control-regex": "error",
|
|
102
|
-
"no-debugger": "error",
|
|
103
|
-
"no-delete-var": "error",
|
|
104
|
-
"no-dupe-else-if": "error",
|
|
105
|
-
"no-duplicate-case": "error",
|
|
106
|
-
"no-duplicate-imports": ["error", { includeExports: false }],
|
|
107
|
-
"no-else-return": "error",
|
|
108
|
-
"no-empty": ["error", { allowEmptyCatch: true }],
|
|
109
|
-
"no-empty-character-class": "error",
|
|
110
|
-
"no-empty-pattern": "error",
|
|
111
|
-
"no-empty-static-block": "error",
|
|
112
|
-
"no-eval": "error",
|
|
113
|
-
"no-ex-assign": "error",
|
|
114
|
-
"no-extend-native": "error",
|
|
115
|
-
"no-extra-bind": "error",
|
|
116
|
-
"no-extra-boolean-cast": "error",
|
|
117
|
-
"no-fallthrough": ["error", { allowEmptyCase: true }],
|
|
118
|
-
"no-global-assign": "error",
|
|
119
|
-
"no-implicit-coercion": ["error", { disallowTemplateShorthand: true }],
|
|
120
|
-
"no-import-assign": "error",
|
|
121
|
-
"no-inner-declarations": ["error", "both"],
|
|
122
|
-
"no-invalid-regexp": "error",
|
|
123
|
-
"no-irregular-whitespace": "error",
|
|
124
|
-
"no-iterator": "error",
|
|
125
|
-
"no-labels": ["error", { allowLoop: false, allowSwitch: false }],
|
|
126
|
-
"no-lone-blocks": "error",
|
|
127
|
-
"no-lonely-if": "error",
|
|
128
|
-
"no-misleading-character-class": "error",
|
|
129
|
-
"no-multi-assign": "error",
|
|
130
|
-
"no-multi-str": "error",
|
|
131
|
-
"no-new": "error",
|
|
132
|
-
"no-new-func": "error",
|
|
133
|
-
"no-new-native-nonconstructor": "error",
|
|
134
|
-
"no-new-wrappers": "error",
|
|
135
|
-
"no-nonoctal-decimal-escape": "error",
|
|
136
|
-
"no-object-constructor": "error",
|
|
137
|
-
"no-octal": "error",
|
|
138
|
-
"no-octal-escape": "error",
|
|
139
|
-
"no-promise-executor-return": ["error", { allowVoid: true }],
|
|
140
|
-
"no-proto": "error",
|
|
141
|
-
"no-prototype-builtins": "error",
|
|
142
|
-
"no-regex-spaces": "error",
|
|
143
|
-
"no-script-url": "error",
|
|
144
|
-
"no-self-assign": "error",
|
|
145
|
-
"no-self-compare": "error",
|
|
146
|
-
"no-sequences": "error",
|
|
147
|
-
"no-shadow-restricted-names": "error",
|
|
148
|
-
"no-sparse-arrays": "error",
|
|
149
|
-
"no-template-curly-in-string": "error",
|
|
150
|
-
"no-undef-init": "error",
|
|
151
|
-
"no-undefined": "error",
|
|
152
|
-
"no-unexpected-multiline": "error",
|
|
153
|
-
"no-unmodified-loop-condition": "error",
|
|
154
|
-
"no-unneeded-ternary": ["error", { defaultAssignment: false }],
|
|
155
|
-
"no-unreachable-loop": "error",
|
|
156
|
-
"no-unsafe-finally": "error",
|
|
157
|
-
"no-unsafe-optional-chaining": ["error", { disallowArithmeticOperators: true }],
|
|
158
|
-
"no-unused-vars": "off",
|
|
159
|
-
"no-useless-backreference": "error",
|
|
160
|
-
"no-useless-call": "error",
|
|
161
|
-
"no-useless-catch": "error",
|
|
162
|
-
"no-useless-computed-key": "error",
|
|
163
|
-
"no-useless-concat": "error",
|
|
164
|
-
"no-useless-rename": "error",
|
|
165
|
-
"no-useless-return": "error",
|
|
166
|
-
"no-var": "error",
|
|
167
|
-
"no-with": "error",
|
|
168
|
-
"object-shorthand": ["error", "always"],
|
|
169
|
-
"operator-assignment": ["error", "always"],
|
|
170
|
-
"prefer-arrow-callback": "error",
|
|
171
|
-
"prefer-const": [
|
|
172
|
-
"error",
|
|
173
|
-
{
|
|
174
|
-
destructuring: "all",
|
|
175
|
-
ignoreReadBeforeAssign: true
|
|
176
|
-
}
|
|
177
|
-
],
|
|
178
|
-
"prefer-destructuring": "off",
|
|
179
|
-
"prefer-exponentiation-operator": "error",
|
|
180
|
-
"prefer-object-has-own": "error",
|
|
181
|
-
"prefer-object-spread": "error",
|
|
182
|
-
"prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
|
|
183
|
-
"prefer-rest-params": "error",
|
|
184
|
-
"prefer-spread": "error",
|
|
185
|
-
"prefer-template": "error",
|
|
186
|
-
"require-atomic-updates": ["error", { allowProperties: true }],
|
|
187
|
-
"sort-imports": [
|
|
188
|
-
"error",
|
|
189
|
-
{
|
|
190
|
-
allowSeparatedGroups: false,
|
|
191
|
-
ignoreCase: false,
|
|
192
|
-
ignoreDeclarationSort: true,
|
|
193
|
-
ignoreMemberSort: false,
|
|
194
|
-
memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
|
|
195
|
-
}
|
|
196
|
-
],
|
|
197
|
-
"symbol-description": "off",
|
|
198
|
-
"use-isnan": "error",
|
|
199
|
-
"valid-typeof": "error",
|
|
200
|
-
yoda: ["error", "never"],
|
|
201
|
-
...overrides == null ? void 0 : overrides.javascript
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
async function perfectionist(options) {
|
|
206
|
-
const { overrides, perfectionist: enabled = true } = options;
|
|
52
|
+
async function vue(options) {
|
|
53
|
+
const { overrides, vue: enabled } = options;
|
|
207
54
|
if (!enabled)
|
|
208
|
-
return
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
rules: {
|
|
215
|
-
"perfectionist/sort-enums": [
|
|
216
|
-
"error",
|
|
217
|
-
{
|
|
218
|
-
type: "natural",
|
|
219
|
-
order: "asc"
|
|
220
|
-
}
|
|
221
|
-
],
|
|
222
|
-
"perfectionist/sort-exports": [
|
|
223
|
-
"error",
|
|
224
|
-
{
|
|
225
|
-
type: "line-length",
|
|
226
|
-
order: "asc"
|
|
227
|
-
}
|
|
228
|
-
],
|
|
229
|
-
"perfectionist/sort-imports": [
|
|
230
|
-
"error",
|
|
231
|
-
{
|
|
232
|
-
type: "line-length",
|
|
233
|
-
order: "asc",
|
|
234
|
-
"ignore-case": true,
|
|
235
|
-
"newlines-between": "never",
|
|
236
|
-
groups: [["side-effect-style", "side-effect"], "unknown"]
|
|
237
|
-
}
|
|
238
|
-
],
|
|
239
|
-
"perfectionist/sort-interfaces": [
|
|
240
|
-
"error",
|
|
241
|
-
{
|
|
242
|
-
type: "natural",
|
|
243
|
-
order: "asc",
|
|
244
|
-
"partition-by-new-line": true
|
|
245
|
-
}
|
|
246
|
-
],
|
|
247
|
-
"perfectionist/sort-intersection-types": [
|
|
248
|
-
"error",
|
|
249
|
-
{
|
|
250
|
-
type: "natural",
|
|
251
|
-
order: "asc"
|
|
252
|
-
}
|
|
253
|
-
],
|
|
254
|
-
"perfectionist/sort-maps": [
|
|
255
|
-
"error",
|
|
256
|
-
{
|
|
257
|
-
type: "natural",
|
|
258
|
-
order: "asc"
|
|
259
|
-
}
|
|
260
|
-
],
|
|
261
|
-
"perfectionist/sort-named-exports": [
|
|
262
|
-
"error",
|
|
263
|
-
{
|
|
264
|
-
type: "natural",
|
|
265
|
-
order: "asc"
|
|
266
|
-
}
|
|
267
|
-
],
|
|
268
|
-
"sort-imports": "off",
|
|
269
|
-
"perfectionist/sort-named-imports": [
|
|
270
|
-
"error",
|
|
271
|
-
{
|
|
272
|
-
type: "natural",
|
|
273
|
-
order: "asc"
|
|
274
|
-
}
|
|
275
|
-
],
|
|
276
|
-
"@typescript-eslint/adjacent-overload-signatures": "off",
|
|
277
|
-
"perfectionist/sort-object-types": [
|
|
278
|
-
"error",
|
|
279
|
-
{
|
|
280
|
-
type: "natural",
|
|
281
|
-
order: "asc",
|
|
282
|
-
"partition-by-new-line": true
|
|
283
|
-
}
|
|
284
|
-
],
|
|
285
|
-
...overrides == null ? void 0 : overrides.perfectionist
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
async function typescript(options) {
|
|
290
|
-
const { project, overrides } = options;
|
|
291
|
-
const [tsParser, tsPlugin] = await Promise.all([
|
|
292
|
-
interopDefault(import("@typescript-eslint/parser")),
|
|
293
|
-
interopDefault(import("@typescript-eslint/eslint-plugin"))
|
|
55
|
+
return [];
|
|
56
|
+
const [vuePlugin, vueParser, tsParser] = await Promise.all([
|
|
57
|
+
// @ts-expect-error no types
|
|
58
|
+
interopDefault(import("eslint-plugin-vue")),
|
|
59
|
+
interopDefault(import("vue-eslint-parser")),
|
|
60
|
+
interopDefault(import("@typescript-eslint/parser"))
|
|
294
61
|
]);
|
|
295
|
-
const files = [Glob.TYPESCRIPT];
|
|
296
|
-
if (options.vue)
|
|
297
|
-
files.push(Glob.VUE);
|
|
298
62
|
const rules = {
|
|
299
|
-
|
|
300
|
-
"
|
|
301
|
-
"
|
|
302
|
-
"
|
|
303
|
-
"@typescript-eslint/ban-ts-comment": [
|
|
63
|
+
...vuePlugin.configs.base.rules,
|
|
64
|
+
"vue/attribute-hyphenation": ["error", "always"],
|
|
65
|
+
"vue/attributes-order": "error",
|
|
66
|
+
"vue/block-lang": [
|
|
304
67
|
"error",
|
|
305
68
|
{
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
69
|
+
script: {
|
|
70
|
+
lang: "ts"
|
|
71
|
+
},
|
|
72
|
+
style: {
|
|
73
|
+
lang: "scss",
|
|
74
|
+
allowNoLang: true
|
|
75
|
+
}
|
|
311
76
|
}
|
|
312
77
|
],
|
|
313
|
-
"
|
|
314
|
-
"@typescript-eslint/class-literal-property-style": ["error", "fields"],
|
|
315
|
-
"class-methods-use-this": "off",
|
|
316
|
-
"@typescript-eslint/class-methods-use-this": [
|
|
78
|
+
"vue/block-order": [
|
|
317
79
|
"error",
|
|
318
80
|
{
|
|
319
|
-
|
|
320
|
-
ignoreClassesThatImplementAnInterface: "public-fields"
|
|
81
|
+
order: [["script", "template"], "style:not([scoped])", "style[scoped]"]
|
|
321
82
|
}
|
|
322
83
|
],
|
|
323
|
-
"
|
|
324
|
-
"@typescript-eslint/consistent-indexed-object-style": ["error", "record"],
|
|
325
|
-
"consistent-return": "off",
|
|
326
|
-
"@typescript-eslint/consistent-return": "error",
|
|
327
|
-
"@typescript-eslint/consistent-type-assertions": [
|
|
84
|
+
"vue/block-tag-newline": [
|
|
328
85
|
"error",
|
|
329
|
-
{
|
|
86
|
+
{
|
|
87
|
+
singleline: "always",
|
|
88
|
+
multiline: "always",
|
|
89
|
+
maxEmptyLines: 0
|
|
90
|
+
}
|
|
330
91
|
],
|
|
331
|
-
"
|
|
332
|
-
"
|
|
333
|
-
"
|
|
334
|
-
|
|
335
|
-
|
|
92
|
+
"vue/component-api-style": ["error", ["script-setup"]],
|
|
93
|
+
"vue/component-definition-name-casing": ["error", "PascalCase"],
|
|
94
|
+
"vue/component-name-in-template-casing": [
|
|
95
|
+
"error",
|
|
96
|
+
"kebab-case",
|
|
97
|
+
{ registeredComponentsOnly: false }
|
|
98
|
+
],
|
|
99
|
+
"vue/custom-event-name-casing": ["error", "kebab-case"],
|
|
100
|
+
"vue/define-emits-declaration": ["error", "type-based"],
|
|
101
|
+
"vue/define-macros-order": [
|
|
336
102
|
"error",
|
|
337
103
|
{
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
accessors: "no-public",
|
|
341
|
-
constructors: "no-public",
|
|
342
|
-
methods: "explicit",
|
|
343
|
-
properties: "explicit",
|
|
344
|
-
parameterProperties: "explicit"
|
|
345
|
-
}
|
|
104
|
+
order: ["defineOptions", "defineProps", "defineModel", "defineEmits", "defineSlots"],
|
|
105
|
+
defineExposeLast: true
|
|
346
106
|
}
|
|
347
107
|
],
|
|
348
|
-
"
|
|
349
|
-
"
|
|
350
|
-
|
|
351
|
-
"
|
|
108
|
+
"vue/define-props-declaration": ["error", "type-based"],
|
|
109
|
+
"vue/enforce-style-attribute": ["error", { allow: ["scoped"] }],
|
|
110
|
+
"vue/first-attribute-linebreak": "off",
|
|
111
|
+
"vue/html-button-has-type": [
|
|
352
112
|
"error",
|
|
353
113
|
{
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}
|
|
114
|
+
button: true,
|
|
115
|
+
submit: true,
|
|
116
|
+
reset: true
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"vue/html-closing-bracket-newline": [
|
|
120
|
+
"error",
|
|
358
121
|
{
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
122
|
+
singleline: "never",
|
|
123
|
+
multiline: "always",
|
|
124
|
+
selfClosingTag: {
|
|
125
|
+
singleline: "never",
|
|
126
|
+
multiline: "always"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"vue/html-closing-bracket-spacing": [
|
|
131
|
+
"error",
|
|
363
132
|
{
|
|
364
|
-
|
|
365
|
-
|
|
133
|
+
startTag: "never",
|
|
134
|
+
endTag: "never",
|
|
135
|
+
selfClosingTag: "always"
|
|
366
136
|
}
|
|
367
137
|
],
|
|
368
|
-
"
|
|
369
|
-
"@typescript-eslint/no-base-to-string": "error",
|
|
370
|
-
"@typescript-eslint/no-confusing-non-null-assertion": "error",
|
|
371
|
-
"@typescript-eslint/no-confusing-void-expression": [
|
|
138
|
+
"vue/html-self-closing": [
|
|
372
139
|
"error",
|
|
373
140
|
{
|
|
374
|
-
|
|
375
|
-
|
|
141
|
+
html: {
|
|
142
|
+
void: "never",
|
|
143
|
+
normal: "always",
|
|
144
|
+
component: "always"
|
|
145
|
+
},
|
|
146
|
+
svg: "always",
|
|
147
|
+
math: "always"
|
|
376
148
|
}
|
|
377
149
|
],
|
|
378
|
-
"
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
"
|
|
386
|
-
"
|
|
387
|
-
"
|
|
388
|
-
"
|
|
389
|
-
"no-
|
|
390
|
-
"
|
|
391
|
-
"
|
|
392
|
-
"
|
|
393
|
-
"
|
|
150
|
+
"vue/match-component-file-name": [
|
|
151
|
+
"off",
|
|
152
|
+
{
|
|
153
|
+
extensions: ["tsx", "vue"],
|
|
154
|
+
shouldMatchCase: false
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"vue/match-component-import-name": "error",
|
|
158
|
+
"vue/multi-word-component-names": "off",
|
|
159
|
+
"vue/mustache-interpolation-spacing": ["error", "always"],
|
|
160
|
+
"vue/no-arrow-functions-in-watch": "off",
|
|
161
|
+
"vue/no-async-in-computed-properties": "error",
|
|
162
|
+
"vue/no-boolean-default": ["error", "no-default"],
|
|
163
|
+
"vue/no-computed-properties-in-data": "error",
|
|
164
|
+
"vue/no-dupe-keys": "error",
|
|
165
|
+
"vue/no-dupe-v-else-if": "error",
|
|
166
|
+
"vue/no-duplicate-attributes": [
|
|
394
167
|
"error",
|
|
395
168
|
{
|
|
396
|
-
|
|
397
|
-
|
|
169
|
+
allowCoexistClass: true,
|
|
170
|
+
allowCoexistStyle: true
|
|
398
171
|
}
|
|
399
172
|
],
|
|
400
|
-
"no-
|
|
401
|
-
"
|
|
402
|
-
"no-
|
|
403
|
-
"
|
|
404
|
-
"
|
|
405
|
-
"
|
|
406
|
-
"
|
|
173
|
+
"vue/no-export-in-script-setup": "error",
|
|
174
|
+
"vue/no-expose-after-await": "error",
|
|
175
|
+
"vue/no-lifecycle-after-await": "error",
|
|
176
|
+
"vue/no-lone-template": "error",
|
|
177
|
+
"vue/no-multi-spaces": "error",
|
|
178
|
+
"vue/no-multiple-objects-in-class": "error",
|
|
179
|
+
"vue/no-mutating-props": "error",
|
|
180
|
+
"vue/no-parsing-error": "error",
|
|
181
|
+
"vue/no-ref-as-operand": "error",
|
|
182
|
+
"vue/no-ref-object-reactivity-loss": "error",
|
|
183
|
+
"vue/no-reserved-component-names": "error",
|
|
184
|
+
"vue/no-reserved-keys": "error",
|
|
185
|
+
"vue/no-reserved-props": "error",
|
|
186
|
+
"vue/no-required-prop-with-default": [
|
|
407
187
|
"error",
|
|
408
188
|
{
|
|
409
|
-
|
|
410
|
-
checksSpreads: true,
|
|
411
|
-
checksVoidReturn: {
|
|
412
|
-
arguments: true,
|
|
413
|
-
attributes: true,
|
|
414
|
-
properties: true,
|
|
415
|
-
returns: true,
|
|
416
|
-
variables: true
|
|
417
|
-
}
|
|
189
|
+
autofix: true
|
|
418
190
|
}
|
|
419
191
|
],
|
|
420
|
-
"
|
|
421
|
-
"
|
|
422
|
-
"
|
|
423
|
-
"
|
|
424
|
-
"
|
|
425
|
-
"
|
|
426
|
-
"@typescript-eslint/no-require-imports": "error",
|
|
427
|
-
"no-shadow": "off",
|
|
428
|
-
"@typescript-eslint/no-shadow": "error",
|
|
429
|
-
"@typescript-eslint/no-this-alias": "error",
|
|
430
|
-
"@typescript-eslint/no-unnecessary-boolean-literal-compare": [
|
|
192
|
+
"vue/no-root-v-if": "error",
|
|
193
|
+
"vue/no-setup-props-reactivity-loss": "error",
|
|
194
|
+
"vue/no-shared-component-data": "error",
|
|
195
|
+
"vue/no-side-effects-in-computed-properties": "error",
|
|
196
|
+
"vue/no-spaces-around-equal-signs-in-attribute": "error",
|
|
197
|
+
"vue/no-static-inline-styles": [
|
|
431
198
|
"error",
|
|
432
199
|
{
|
|
433
|
-
|
|
434
|
-
allowComparingNullableBooleansToFalse: true
|
|
200
|
+
allowBinding: false
|
|
435
201
|
}
|
|
436
202
|
],
|
|
437
|
-
"
|
|
438
|
-
"
|
|
439
|
-
"
|
|
440
|
-
"
|
|
441
|
-
"
|
|
442
|
-
"
|
|
443
|
-
"
|
|
444
|
-
"
|
|
445
|
-
"
|
|
446
|
-
"@typescript-eslint/no-unsafe-enum-comparison": "off",
|
|
447
|
-
"@typescript-eslint/no-unsafe-member-access": "error",
|
|
448
|
-
"@typescript-eslint/no-unsafe-return": "off",
|
|
449
|
-
"@typescript-eslint/no-unsafe-unary-minus": "error",
|
|
450
|
-
"no-unused-expressions": "off",
|
|
451
|
-
"@typescript-eslint/no-unused-expressions": [
|
|
203
|
+
"vue/no-template-key": "error",
|
|
204
|
+
"vue/no-template-shadow": "error",
|
|
205
|
+
"vue/no-template-target-blank": "error",
|
|
206
|
+
"vue/no-textarea-mustache": "error",
|
|
207
|
+
"vue/no-unused-components": "error",
|
|
208
|
+
"vue/no-unused-emit-declarations": "error",
|
|
209
|
+
"vue/no-unused-properties": "error",
|
|
210
|
+
"vue/no-unused-refs": "error",
|
|
211
|
+
"vue/no-unused-vars": [
|
|
452
212
|
"error",
|
|
453
213
|
{
|
|
454
|
-
|
|
214
|
+
ignorePattern: "^_"
|
|
455
215
|
}
|
|
456
216
|
],
|
|
457
|
-
"no-use-
|
|
458
|
-
"
|
|
217
|
+
"vue/no-use-computed-property-like-method": "error",
|
|
218
|
+
"vue/no-use-v-else-with-v-for": "error",
|
|
219
|
+
"vue/no-use-v-if-with-v-for": "error",
|
|
220
|
+
"vue/no-useless-mustaches": [
|
|
459
221
|
"error",
|
|
460
222
|
{
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
typedefs: false
|
|
223
|
+
ignoreIncludesComment: false,
|
|
224
|
+
ignoreStringEscape: false
|
|
464
225
|
}
|
|
465
226
|
],
|
|
466
|
-
"no-useless-
|
|
467
|
-
"
|
|
468
|
-
"
|
|
469
|
-
"
|
|
470
|
-
"
|
|
471
|
-
"no-
|
|
472
|
-
"
|
|
227
|
+
"vue/no-useless-template-attributes": "error",
|
|
228
|
+
"vue/no-useless-v-bind": "error",
|
|
229
|
+
"vue/no-v-for-template-key-on-child": "error",
|
|
230
|
+
"vue/no-v-text-v-html-on-component": "error",
|
|
231
|
+
"vue/no-v-html": "off",
|
|
232
|
+
"vue/no-watch-after-await": "error",
|
|
233
|
+
"vue/order-in-components": "error",
|
|
234
|
+
"vue/padding-line-between-blocks": ["error", "always"],
|
|
235
|
+
"vue/prefer-define-options": "error",
|
|
236
|
+
"vue/prefer-import-from-vue": "error",
|
|
237
|
+
"vue/prefer-separate-static-class": "error",
|
|
238
|
+
"vue/prefer-true-attribute-shorthand": "error",
|
|
239
|
+
"vue/prop-name-casing": ["error", "camelCase"],
|
|
240
|
+
"vue/require-component-is": "error",
|
|
241
|
+
"vue/require-default-prop": "off",
|
|
242
|
+
"vue/require-explicit-emits": [
|
|
473
243
|
"error",
|
|
474
244
|
{
|
|
475
|
-
|
|
476
|
-
allowThrowingUnknown: false
|
|
245
|
+
allowProps: false
|
|
477
246
|
}
|
|
478
247
|
],
|
|
479
|
-
"
|
|
480
|
-
"
|
|
481
|
-
"@typescript-eslint/prefer-find": "error",
|
|
482
|
-
"@typescript-eslint/prefer-for-of": "error",
|
|
483
|
-
"@typescript-eslint/prefer-function-type": "error",
|
|
484
|
-
"@typescript-eslint/prefer-includes": "error",
|
|
485
|
-
"@typescript-eslint/prefer-literal-enum-member": "error",
|
|
486
|
-
"@typescript-eslint/prefer-nullish-coalescing": [
|
|
248
|
+
"vue/require-explicit-slots": "error",
|
|
249
|
+
"vue/require-macro-variable-name": [
|
|
487
250
|
"error",
|
|
488
251
|
{
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
boolean: false,
|
|
495
|
-
number: false,
|
|
496
|
-
string: false
|
|
497
|
-
}
|
|
252
|
+
defineProps: "props",
|
|
253
|
+
defineEmits: "emit",
|
|
254
|
+
defineSlots: "slots",
|
|
255
|
+
useSlots: "slots",
|
|
256
|
+
useAttrs: "attrs"
|
|
498
257
|
}
|
|
499
258
|
],
|
|
500
|
-
"
|
|
501
|
-
"
|
|
502
|
-
"
|
|
503
|
-
"
|
|
504
|
-
"
|
|
505
|
-
"
|
|
506
|
-
"
|
|
507
|
-
"
|
|
508
|
-
"
|
|
509
|
-
"
|
|
510
|
-
"
|
|
511
|
-
"
|
|
512
|
-
"require-await": "off",
|
|
513
|
-
"@typescript-eslint/require-await": "error",
|
|
514
|
-
"@typescript-eslint/restrict-plus-operands": "error",
|
|
515
|
-
"@typescript-eslint/restrict-template-expressions": "error",
|
|
516
|
-
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
517
|
-
"@typescript-eslint/switch-exhaustiveness-check": [
|
|
259
|
+
"vue/require-prop-types": "error",
|
|
260
|
+
"vue/require-render-return": "error",
|
|
261
|
+
"vue/require-slots-as-functions": "error",
|
|
262
|
+
"vue/require-toggle-inside-transition": "error",
|
|
263
|
+
"vue/require-typed-ref": "error",
|
|
264
|
+
"vue/require-v-for-key": "error",
|
|
265
|
+
"vue/require-valid-default-prop": "error",
|
|
266
|
+
"vue/return-in-computed-property": "error",
|
|
267
|
+
"vue/return-in-emits-validator": "error",
|
|
268
|
+
"vue/this-in-template": ["error", "never"],
|
|
269
|
+
"vue/use-v-on-exact": "error",
|
|
270
|
+
"vue/v-bind-style": [
|
|
518
271
|
"error",
|
|
272
|
+
"shorthand",
|
|
519
273
|
{
|
|
520
|
-
|
|
274
|
+
sameNameShorthand: "always"
|
|
521
275
|
}
|
|
522
276
|
],
|
|
523
|
-
"
|
|
524
|
-
"
|
|
277
|
+
"vue/v-for-delimiter-style": ["error", "of"],
|
|
278
|
+
"vue/v-on-handler-style": "off",
|
|
279
|
+
"vue/v-on-style": ["error", "shorthand"],
|
|
280
|
+
"vue/v-slot-style": [
|
|
525
281
|
"error",
|
|
526
282
|
{
|
|
527
|
-
|
|
283
|
+
atComponent: "shorthand",
|
|
284
|
+
default: "shorthand",
|
|
285
|
+
named: "shorthand"
|
|
528
286
|
}
|
|
529
287
|
],
|
|
530
|
-
"
|
|
531
|
-
|
|
288
|
+
"vue/v-on-event-hyphenation": ["error", "always"],
|
|
289
|
+
"vue/valid-attribute-name": "error",
|
|
290
|
+
"vue/valid-define-emits": "error",
|
|
291
|
+
"vue/valid-define-options": "error",
|
|
292
|
+
"vue/valid-define-props": "error",
|
|
293
|
+
"vue/valid-next-tick": "error",
|
|
294
|
+
"vue/valid-template-root": "error",
|
|
295
|
+
"vue/valid-v-bind": "error",
|
|
296
|
+
"vue/valid-v-cloak": "error",
|
|
297
|
+
"vue/valid-v-else-if": "error",
|
|
298
|
+
"vue/valid-v-else": "error",
|
|
299
|
+
"vue/valid-v-for": "error",
|
|
300
|
+
"vue/valid-v-html": "error",
|
|
301
|
+
"vue/valid-v-if": "error",
|
|
302
|
+
"vue/valid-v-memo": "error",
|
|
303
|
+
"vue/valid-v-model": "error",
|
|
304
|
+
"vue/valid-v-on": "error",
|
|
305
|
+
"vue/valid-v-once": "error",
|
|
306
|
+
"vue/valid-v-pre": "error",
|
|
307
|
+
"vue/valid-v-show": "error",
|
|
308
|
+
"vue/valid-v-slot": "error",
|
|
309
|
+
"vue/valid-v-text": "error",
|
|
310
|
+
...overrides == null ? void 0 : overrides.vue
|
|
532
311
|
};
|
|
533
|
-
return
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
312
|
+
return [
|
|
313
|
+
{
|
|
314
|
+
plugins: {
|
|
315
|
+
vue: vuePlugin
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
files: [Glob.Vue],
|
|
320
|
+
languageOptions: {
|
|
321
|
+
parser: vueParser,
|
|
322
|
+
parserOptions: {
|
|
323
|
+
parser: tsParser,
|
|
324
|
+
project: options.project,
|
|
325
|
+
tsconfigRootDir: process.cwd(),
|
|
326
|
+
extraFileExtensions: [".vue"],
|
|
327
|
+
sourceType: "module",
|
|
328
|
+
ecmaVersion: "latest"
|
|
329
|
+
}
|
|
543
330
|
}
|
|
544
331
|
},
|
|
332
|
+
{
|
|
333
|
+
// @ts-expect-error no types
|
|
334
|
+
processor: vuePlugin.processors[".vue"],
|
|
335
|
+
rules
|
|
336
|
+
}
|
|
337
|
+
];
|
|
338
|
+
}
|
|
339
|
+
async function vitest(options) {
|
|
340
|
+
const { overrides, vitest: enabled } = options;
|
|
341
|
+
if (!enabled)
|
|
342
|
+
return {};
|
|
343
|
+
const plugin = await interopDefault(import("eslint-plugin-vitest"));
|
|
344
|
+
return {
|
|
545
345
|
plugins: {
|
|
546
|
-
|
|
346
|
+
vitest: plugin
|
|
547
347
|
},
|
|
548
|
-
|
|
348
|
+
files: [Glob.Vitest],
|
|
349
|
+
rules: {
|
|
350
|
+
"vitest/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
351
|
+
"vitest/expect-expect": [
|
|
352
|
+
"error",
|
|
353
|
+
{
|
|
354
|
+
assertFunctionNames: ["expect"]
|
|
355
|
+
}
|
|
356
|
+
],
|
|
357
|
+
"vitest/max-expects": ["error", { max: 5 }],
|
|
358
|
+
"vitest/max-nested-describe": ["error", { max: 1 }],
|
|
359
|
+
"vitest/no-alias-methods": "error",
|
|
360
|
+
"vitest/no-commented-out-tests": "error",
|
|
361
|
+
"vitest/no-conditional-expect": "error",
|
|
362
|
+
"vitest/no-conditional-in-test": "error",
|
|
363
|
+
"vitest/no-conditional-tests": "error",
|
|
364
|
+
"vitest/no-done-callback": "error",
|
|
365
|
+
"vitest/no-duplicate-hooks": "error",
|
|
366
|
+
"vitest/no-identical-title": "error",
|
|
367
|
+
"vitest/no-import-node-test": "error",
|
|
368
|
+
"vitest/no-standalone-expect": "error",
|
|
369
|
+
"vitest/no-test-return-statement": "error",
|
|
370
|
+
"vitest/prefer-comparison-matcher": "error",
|
|
371
|
+
"vitest/prefer-each": "error",
|
|
372
|
+
"vitest/prefer-equality-matcher": "error",
|
|
373
|
+
"vitest/prefer-expect-resolves": "error",
|
|
374
|
+
"vitest/prefer-hooks-in-order": "error",
|
|
375
|
+
"vitest/prefer-hooks-on-top": "error",
|
|
376
|
+
"vitest/prefer-lowercase-title": "error",
|
|
377
|
+
"vitest/prefer-mock-promise-shorthand": "error",
|
|
378
|
+
"vitest/prefer-spy-on": "error",
|
|
379
|
+
"vitest/prefer-to-be-object": "error",
|
|
380
|
+
"vitest/prefer-to-contain": "error",
|
|
381
|
+
"vitest/prefer-to-have-length": "error",
|
|
382
|
+
"vitest/prefer-todo": "error",
|
|
383
|
+
"vitest/require-top-level-describe": [
|
|
384
|
+
"error",
|
|
385
|
+
{
|
|
386
|
+
maxNumberOfTopLevelDescribes: 10
|
|
387
|
+
}
|
|
388
|
+
],
|
|
389
|
+
"vitest/valid-describe-callback": "error",
|
|
390
|
+
"vitest/valid-expect": "error",
|
|
391
|
+
...overrides == null ? void 0 : overrides.vitest
|
|
392
|
+
}
|
|
549
393
|
};
|
|
550
394
|
}
|
|
551
395
|
async function unicorn(options) {
|
|
@@ -572,7 +416,7 @@ async function unicorn(options) {
|
|
|
572
416
|
],
|
|
573
417
|
"unicorn/custom-error-definition": "error",
|
|
574
418
|
"unicorn/error-message": "error",
|
|
575
|
-
"unicorn/no-array-for-each": "
|
|
419
|
+
"unicorn/no-array-for-each": "off",
|
|
576
420
|
"unicorn/no-array-method-this-argument": "error",
|
|
577
421
|
"unicorn/no-array-push-push": "error",
|
|
578
422
|
"unicorn/no-await-expression-member": "error",
|
|
@@ -605,348 +449,504 @@ async function unicorn(options) {
|
|
|
605
449
|
}
|
|
606
450
|
};
|
|
607
451
|
}
|
|
608
|
-
|
|
609
|
-
const { overrides
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
452
|
+
function javascript(options) {
|
|
453
|
+
const { overrides } = options;
|
|
454
|
+
const files = [Glob.All];
|
|
455
|
+
if (options.vue)
|
|
456
|
+
files.push(Glob.Vue);
|
|
613
457
|
return {
|
|
614
|
-
|
|
615
|
-
|
|
458
|
+
files,
|
|
459
|
+
languageOptions: {
|
|
460
|
+
ecmaVersion: "latest",
|
|
461
|
+
sourceType: "module",
|
|
462
|
+
globals: {
|
|
463
|
+
...globals.browser,
|
|
464
|
+
...globals.es2021,
|
|
465
|
+
...globals.node,
|
|
466
|
+
document: "readonly",
|
|
467
|
+
window: "readonly"
|
|
468
|
+
}
|
|
616
469
|
},
|
|
617
|
-
files: [Glob.VITEST],
|
|
618
470
|
rules: {
|
|
619
|
-
"
|
|
620
|
-
"
|
|
471
|
+
"accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
|
|
472
|
+
"array-callback-return": [
|
|
621
473
|
"error",
|
|
622
474
|
{
|
|
623
|
-
|
|
475
|
+
checkForEach: false,
|
|
476
|
+
allowVoid: true
|
|
624
477
|
}
|
|
625
478
|
],
|
|
626
|
-
"
|
|
627
|
-
"
|
|
628
|
-
"
|
|
629
|
-
|
|
630
|
-
"
|
|
631
|
-
"
|
|
632
|
-
"
|
|
633
|
-
"
|
|
634
|
-
"
|
|
635
|
-
"
|
|
636
|
-
"
|
|
637
|
-
"
|
|
638
|
-
"
|
|
639
|
-
"
|
|
640
|
-
"
|
|
641
|
-
"
|
|
642
|
-
"
|
|
643
|
-
"
|
|
644
|
-
"
|
|
645
|
-
"
|
|
646
|
-
"
|
|
647
|
-
"
|
|
648
|
-
"
|
|
649
|
-
"
|
|
650
|
-
"
|
|
651
|
-
"
|
|
652
|
-
"
|
|
479
|
+
"block-scoped-var": "error",
|
|
480
|
+
"consistent-this": ["error", "self"],
|
|
481
|
+
"default-case-last": "error",
|
|
482
|
+
eqeqeq: ["error", "always"],
|
|
483
|
+
"for-direction": "error",
|
|
484
|
+
"func-style": ["error", "declaration", { allowArrowFunctions: true }],
|
|
485
|
+
"grouped-accessor-pairs": ["error", "getBeforeSet"],
|
|
486
|
+
"guard-for-in": "error",
|
|
487
|
+
"init-declarations": "off",
|
|
488
|
+
"logical-assignment-operators": ["error", "always", { enforceForIfStatements: true }],
|
|
489
|
+
"max-params": "off",
|
|
490
|
+
"new-cap": ["error", { newIsCap: true, capIsNew: false, properties: true }],
|
|
491
|
+
"no-alert": "error",
|
|
492
|
+
"no-async-promise-executor": "error",
|
|
493
|
+
"no-caller": "error",
|
|
494
|
+
"no-case-declarations": "error",
|
|
495
|
+
"no-class-assign": "error",
|
|
496
|
+
"no-compare-neg-zero": "error",
|
|
497
|
+
"no-cond-assign": ["error", "always"],
|
|
498
|
+
"no-constant-binary-expression": "error",
|
|
499
|
+
"no-constant-condition": "error",
|
|
500
|
+
"no-constructor-return": "error",
|
|
501
|
+
"no-control-regex": "error",
|
|
502
|
+
"no-debugger": "error",
|
|
503
|
+
"no-delete-var": "error",
|
|
504
|
+
"no-dupe-else-if": "error",
|
|
505
|
+
"no-duplicate-case": "error",
|
|
506
|
+
"no-duplicate-imports": ["error", { includeExports: false }],
|
|
507
|
+
"no-else-return": "error",
|
|
508
|
+
"no-empty": ["error", { allowEmptyCatch: true }],
|
|
509
|
+
"no-empty-character-class": "error",
|
|
510
|
+
"no-empty-pattern": "error",
|
|
511
|
+
"no-empty-static-block": "error",
|
|
512
|
+
"no-eval": "error",
|
|
513
|
+
"no-ex-assign": "error",
|
|
514
|
+
"no-extend-native": "error",
|
|
515
|
+
"no-extra-bind": "error",
|
|
516
|
+
"no-extra-boolean-cast": "error",
|
|
517
|
+
"no-fallthrough": ["error", { allowEmptyCase: true }],
|
|
518
|
+
"no-global-assign": "error",
|
|
519
|
+
"no-implicit-coercion": ["error", { disallowTemplateShorthand: true }],
|
|
520
|
+
"no-import-assign": "error",
|
|
521
|
+
"no-inner-declarations": ["error", "both"],
|
|
522
|
+
"no-invalid-regexp": "error",
|
|
523
|
+
"no-irregular-whitespace": "error",
|
|
524
|
+
"no-iterator": "error",
|
|
525
|
+
"no-labels": ["error", { allowLoop: false, allowSwitch: false }],
|
|
526
|
+
"no-lone-blocks": "error",
|
|
527
|
+
"no-lonely-if": "error",
|
|
528
|
+
"no-misleading-character-class": "error",
|
|
529
|
+
"no-multi-assign": "error",
|
|
530
|
+
"no-multi-str": "error",
|
|
531
|
+
"no-new": "error",
|
|
532
|
+
"no-new-func": "error",
|
|
533
|
+
"no-new-native-nonconstructor": "error",
|
|
534
|
+
"no-new-wrappers": "error",
|
|
535
|
+
"no-nonoctal-decimal-escape": "error",
|
|
536
|
+
"no-object-constructor": "error",
|
|
537
|
+
"no-octal": "error",
|
|
538
|
+
"no-octal-escape": "error",
|
|
539
|
+
"no-promise-executor-return": ["error", { allowVoid: true }],
|
|
540
|
+
"no-proto": "error",
|
|
541
|
+
"no-prototype-builtins": "error",
|
|
542
|
+
"no-regex-spaces": "error",
|
|
543
|
+
"no-script-url": "error",
|
|
544
|
+
"no-self-assign": "error",
|
|
545
|
+
"no-self-compare": "error",
|
|
546
|
+
"no-sequences": "error",
|
|
547
|
+
"no-shadow-restricted-names": "error",
|
|
548
|
+
"no-sparse-arrays": "error",
|
|
549
|
+
"no-template-curly-in-string": "error",
|
|
550
|
+
"no-undef-init": "error",
|
|
551
|
+
"no-undefined": "error",
|
|
552
|
+
"no-unexpected-multiline": "error",
|
|
553
|
+
"no-unmodified-loop-condition": "error",
|
|
554
|
+
"no-unneeded-ternary": ["error", { defaultAssignment: false }],
|
|
555
|
+
"no-unreachable-loop": "error",
|
|
556
|
+
"no-unsafe-finally": "error",
|
|
557
|
+
"no-unsafe-optional-chaining": ["error", { disallowArithmeticOperators: true }],
|
|
558
|
+
"no-unused-vars": "off",
|
|
559
|
+
"no-useless-backreference": "error",
|
|
560
|
+
"no-useless-call": "error",
|
|
561
|
+
"no-useless-catch": "error",
|
|
562
|
+
"no-useless-computed-key": "error",
|
|
563
|
+
"no-useless-concat": "error",
|
|
564
|
+
"no-useless-rename": "error",
|
|
565
|
+
"no-useless-return": "error",
|
|
566
|
+
"no-var": "error",
|
|
567
|
+
"no-with": "error",
|
|
568
|
+
"object-shorthand": ["error", "always"],
|
|
569
|
+
"operator-assignment": ["error", "always"],
|
|
570
|
+
"prefer-arrow-callback": "error",
|
|
571
|
+
"prefer-const": [
|
|
572
|
+
"error",
|
|
573
|
+
{
|
|
574
|
+
destructuring: "all",
|
|
575
|
+
ignoreReadBeforeAssign: true
|
|
576
|
+
}
|
|
577
|
+
],
|
|
578
|
+
"prefer-destructuring": "off",
|
|
579
|
+
"prefer-exponentiation-operator": "error",
|
|
580
|
+
"prefer-object-has-own": "error",
|
|
581
|
+
"prefer-object-spread": "error",
|
|
582
|
+
"prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
|
|
583
|
+
"prefer-rest-params": "error",
|
|
584
|
+
"prefer-spread": "error",
|
|
585
|
+
"prefer-template": "error",
|
|
586
|
+
"require-atomic-updates": ["error", { allowProperties: true }],
|
|
587
|
+
"sort-imports": [
|
|
653
588
|
"error",
|
|
654
589
|
{
|
|
655
|
-
|
|
590
|
+
allowSeparatedGroups: false,
|
|
591
|
+
ignoreCase: false,
|
|
592
|
+
ignoreDeclarationSort: true,
|
|
593
|
+
ignoreMemberSort: false,
|
|
594
|
+
memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
|
|
656
595
|
}
|
|
657
596
|
],
|
|
658
|
-
"
|
|
659
|
-
"
|
|
660
|
-
|
|
597
|
+
"symbol-description": "off",
|
|
598
|
+
"use-isnan": "error",
|
|
599
|
+
"valid-typeof": "error",
|
|
600
|
+
yoda: ["error", "never"],
|
|
601
|
+
...overrides == null ? void 0 : overrides.javascript
|
|
661
602
|
}
|
|
662
603
|
};
|
|
663
604
|
}
|
|
664
|
-
async function
|
|
665
|
-
const {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
// @ts-expect-error no types
|
|
670
|
-
interopDefault(import("eslint-plugin-vue")),
|
|
671
|
-
interopDefault(import("vue-eslint-parser")),
|
|
672
|
-
interopDefault(import("@typescript-eslint/parser"))
|
|
605
|
+
async function typescript(options) {
|
|
606
|
+
const { project, overrides } = options;
|
|
607
|
+
const [tsParser, tsPlugin] = await Promise.all([
|
|
608
|
+
interopDefault(import("@typescript-eslint/parser")),
|
|
609
|
+
interopDefault(import("@typescript-eslint/eslint-plugin"))
|
|
673
610
|
]);
|
|
611
|
+
const files = [Glob.Typescript];
|
|
612
|
+
if (options.vue)
|
|
613
|
+
files.push(Glob.Vue);
|
|
674
614
|
const rules = {
|
|
675
|
-
|
|
676
|
-
"
|
|
677
|
-
"
|
|
678
|
-
"
|
|
679
|
-
|
|
680
|
-
{
|
|
681
|
-
script: {
|
|
682
|
-
lang: "ts"
|
|
683
|
-
},
|
|
684
|
-
style: {
|
|
685
|
-
lang: "scss",
|
|
686
|
-
allowNoLang: true
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
],
|
|
690
|
-
"vue/block-order": [
|
|
615
|
+
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
616
|
+
"no-array-constructor": "off",
|
|
617
|
+
"@typescript-eslint/no-array-constructor": "error",
|
|
618
|
+
"@typescript-eslint/array-type": ["error", { default: "array" }],
|
|
619
|
+
"@typescript-eslint/ban-ts-comment": [
|
|
691
620
|
"error",
|
|
692
621
|
{
|
|
693
|
-
|
|
622
|
+
"ts-expect-error": "allow-with-description",
|
|
623
|
+
"ts-ignore": true,
|
|
624
|
+
"ts-nocheck": true,
|
|
625
|
+
"ts-check": false,
|
|
626
|
+
minimumDescriptionLength: 3
|
|
694
627
|
}
|
|
695
628
|
],
|
|
696
|
-
"
|
|
629
|
+
"@typescript-eslint/ban-types": "error",
|
|
630
|
+
"@typescript-eslint/class-literal-property-style": ["error", "fields"],
|
|
631
|
+
"class-methods-use-this": "off",
|
|
632
|
+
"@typescript-eslint/class-methods-use-this": [
|
|
697
633
|
"error",
|
|
698
634
|
{
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
maxEmptyLines: 0
|
|
635
|
+
ignoreOverrideMethods: true,
|
|
636
|
+
ignoreClassesThatImplementAnInterface: "public-fields"
|
|
702
637
|
}
|
|
703
638
|
],
|
|
704
|
-
"
|
|
705
|
-
"
|
|
706
|
-
"
|
|
639
|
+
"@typescript-eslint/consistent-generic-constructors": ["error", "constructor"],
|
|
640
|
+
"@typescript-eslint/consistent-indexed-object-style": ["error", "record"],
|
|
641
|
+
"consistent-return": "off",
|
|
642
|
+
"@typescript-eslint/consistent-return": "error",
|
|
643
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
707
644
|
"error",
|
|
708
|
-
"
|
|
709
|
-
{ registeredComponentsOnly: false }
|
|
645
|
+
{ assertionStyle: "as", objectLiteralTypeAssertions: "allow-as-parameter" }
|
|
710
646
|
],
|
|
711
|
-
"
|
|
712
|
-
"
|
|
713
|
-
"
|
|
647
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
|
|
648
|
+
"dot-notation": "off",
|
|
649
|
+
"@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
|
|
650
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
651
|
+
"@typescript-eslint/explicit-member-accessibility": [
|
|
714
652
|
"error",
|
|
715
653
|
{
|
|
716
|
-
|
|
717
|
-
|
|
654
|
+
accessibility: "explicit",
|
|
655
|
+
overrides: {
|
|
656
|
+
accessors: "no-public",
|
|
657
|
+
constructors: "no-public",
|
|
658
|
+
methods: "explicit",
|
|
659
|
+
properties: "explicit",
|
|
660
|
+
parameterProperties: "explicit"
|
|
661
|
+
}
|
|
718
662
|
}
|
|
719
663
|
],
|
|
720
|
-
"
|
|
721
|
-
"
|
|
722
|
-
|
|
723
|
-
"
|
|
664
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
665
|
+
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
666
|
+
camelcase: "off",
|
|
667
|
+
"@typescript-eslint/naming-convention": [
|
|
724
668
|
"error",
|
|
725
669
|
{
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
}
|
|
730
|
-
],
|
|
731
|
-
"vue/html-closing-bracket-newline": [
|
|
732
|
-
"error",
|
|
670
|
+
selector: ["classProperty", "variable"],
|
|
671
|
+
format: ["strictCamelCase", "UPPER_CASE"],
|
|
672
|
+
leadingUnderscore: "allow"
|
|
673
|
+
},
|
|
733
674
|
{
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
multiline: "always"
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
],
|
|
742
|
-
"vue/html-closing-bracket-spacing": [
|
|
743
|
-
"error",
|
|
675
|
+
selector: ["classicAccessor", "classMethod", "function", "parameter", "parameterProperty"],
|
|
676
|
+
format: ["strictCamelCase"],
|
|
677
|
+
leadingUnderscore: "allow"
|
|
678
|
+
},
|
|
744
679
|
{
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
selfClosingTag: "always"
|
|
680
|
+
selector: ["class", "enum", "enumMember", "interface", "typeAlias", "typeParameter"],
|
|
681
|
+
format: ["StrictPascalCase"]
|
|
748
682
|
}
|
|
749
683
|
],
|
|
750
|
-
"
|
|
684
|
+
"@typescript-eslint/no-array-delete": "error",
|
|
685
|
+
"@typescript-eslint/no-base-to-string": "error",
|
|
686
|
+
"@typescript-eslint/no-confusing-non-null-assertion": "error",
|
|
687
|
+
"@typescript-eslint/no-confusing-void-expression": [
|
|
751
688
|
"error",
|
|
752
689
|
{
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
normal: "always",
|
|
756
|
-
component: "always"
|
|
757
|
-
},
|
|
758
|
-
svg: "always",
|
|
759
|
-
math: "always"
|
|
760
|
-
}
|
|
761
|
-
],
|
|
762
|
-
"vue/match-component-file-name": [
|
|
763
|
-
"off",
|
|
764
|
-
{
|
|
765
|
-
extensions: ["tsx", "vue"],
|
|
766
|
-
shouldMatchCase: false
|
|
690
|
+
ignoreArrowShorthand: true,
|
|
691
|
+
ignoreVoidOperator: true
|
|
767
692
|
}
|
|
768
693
|
],
|
|
769
|
-
"
|
|
770
|
-
"
|
|
771
|
-
"
|
|
772
|
-
"
|
|
773
|
-
"
|
|
774
|
-
"
|
|
775
|
-
"
|
|
776
|
-
"
|
|
777
|
-
"
|
|
778
|
-
"
|
|
694
|
+
"@typescript-eslint/no-duplicate-enum-values": "error",
|
|
695
|
+
"@typescript-eslint/no-duplicate-type-constituents": "error",
|
|
696
|
+
"@typescript-eslint/no-dynamic-delete": "error",
|
|
697
|
+
"no-empty-function": "off",
|
|
698
|
+
"@typescript-eslint/no-empty-function": "error",
|
|
699
|
+
"@typescript-eslint/no-empty-interface": "error",
|
|
700
|
+
"@typescript-eslint/no-explicit-any": ["error", { fixToUnknown: true }],
|
|
701
|
+
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
702
|
+
"@typescript-eslint/no-extraneous-class": "error",
|
|
703
|
+
"@typescript-eslint/no-floating-promises": ["error", { ignoreIIFE: true, ignoreVoid: true }],
|
|
704
|
+
"@typescript-eslint/no-for-in-array": "error",
|
|
705
|
+
"no-implied-eval": "off",
|
|
706
|
+
"@typescript-eslint/no-implied-eval": "error",
|
|
707
|
+
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
708
|
+
"@typescript-eslint/no-inferrable-types": "error",
|
|
709
|
+
"@typescript-eslint/no-invalid-void-type": [
|
|
779
710
|
"error",
|
|
780
711
|
{
|
|
781
|
-
|
|
782
|
-
|
|
712
|
+
allowInGenericTypeArguments: true,
|
|
713
|
+
allowAsThisParameter: true
|
|
783
714
|
}
|
|
784
715
|
],
|
|
785
|
-
"
|
|
786
|
-
"
|
|
787
|
-
"
|
|
788
|
-
"
|
|
789
|
-
"
|
|
790
|
-
"
|
|
791
|
-
"
|
|
792
|
-
"vue/no-parsing-error": "error",
|
|
793
|
-
"vue/no-ref-as-operand": "error",
|
|
794
|
-
"vue/no-ref-object-reactivity-loss": "error",
|
|
795
|
-
"vue/no-reserved-component-names": "error",
|
|
796
|
-
"vue/no-reserved-keys": "error",
|
|
797
|
-
"vue/no-reserved-props": "error",
|
|
798
|
-
"vue/no-required-prop-with-default": [
|
|
716
|
+
"no-loop-func": "off",
|
|
717
|
+
"@typescript-eslint/no-loop-func": "error",
|
|
718
|
+
"no-loss-of-precision": "off",
|
|
719
|
+
"@typescript-eslint/no-loss-of-precision": "error",
|
|
720
|
+
"@typescript-eslint/no-meaningless-void-operator": "error",
|
|
721
|
+
"@typescript-eslint/no-misused-new": "error",
|
|
722
|
+
"@typescript-eslint/no-misused-promises": [
|
|
799
723
|
"error",
|
|
800
724
|
{
|
|
801
|
-
|
|
725
|
+
checksConditionals: true,
|
|
726
|
+
checksSpreads: true,
|
|
727
|
+
checksVoidReturn: {
|
|
728
|
+
arguments: true,
|
|
729
|
+
attributes: true,
|
|
730
|
+
properties: true,
|
|
731
|
+
returns: true,
|
|
732
|
+
variables: true
|
|
733
|
+
}
|
|
802
734
|
}
|
|
803
735
|
],
|
|
804
|
-
"
|
|
805
|
-
"
|
|
806
|
-
"
|
|
807
|
-
"
|
|
808
|
-
"
|
|
809
|
-
"
|
|
736
|
+
"@typescript-eslint/no-mixed-enums": "error",
|
|
737
|
+
"@typescript-eslint/no-namespace": "error",
|
|
738
|
+
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
|
|
739
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
|
740
|
+
"@typescript-eslint/no-non-null-assertion": "error",
|
|
741
|
+
"@typescript-eslint/no-redundant-type-constituents": "off",
|
|
742
|
+
"@typescript-eslint/no-require-imports": "error",
|
|
743
|
+
"no-shadow": "off",
|
|
744
|
+
"@typescript-eslint/no-shadow": "error",
|
|
745
|
+
"@typescript-eslint/no-this-alias": "error",
|
|
746
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": [
|
|
810
747
|
"error",
|
|
811
748
|
{
|
|
812
|
-
|
|
749
|
+
allowComparingNullableBooleansToTrue: false,
|
|
750
|
+
allowComparingNullableBooleansToFalse: true
|
|
813
751
|
}
|
|
814
752
|
],
|
|
815
|
-
"
|
|
816
|
-
"
|
|
817
|
-
"
|
|
818
|
-
"
|
|
819
|
-
"
|
|
820
|
-
"
|
|
821
|
-
"
|
|
822
|
-
"
|
|
823
|
-
"
|
|
753
|
+
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
754
|
+
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
755
|
+
"@typescript-eslint/no-unnecessary-type-arguments": "error",
|
|
756
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
757
|
+
"@typescript-eslint/no-unnecessary-type-constraint": "error",
|
|
758
|
+
"@typescript-eslint/no-unsafe-argument": "off",
|
|
759
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
760
|
+
"@typescript-eslint/no-unsafe-call": "error",
|
|
761
|
+
"@typescript-eslint/no-unsafe-declaration-merging": "error",
|
|
762
|
+
"@typescript-eslint/no-unsafe-enum-comparison": "off",
|
|
763
|
+
"@typescript-eslint/no-unsafe-member-access": "error",
|
|
764
|
+
"@typescript-eslint/no-unsafe-return": "off",
|
|
765
|
+
"@typescript-eslint/no-unsafe-unary-minus": "error",
|
|
766
|
+
"no-unused-expressions": "off",
|
|
767
|
+
"@typescript-eslint/no-unused-expressions": [
|
|
824
768
|
"error",
|
|
825
769
|
{
|
|
826
|
-
|
|
770
|
+
allowTaggedTemplates: true
|
|
827
771
|
}
|
|
828
772
|
],
|
|
829
|
-
"
|
|
830
|
-
"
|
|
831
|
-
"vue/no-use-v-if-with-v-for": "error",
|
|
832
|
-
"vue/no-useless-mustaches": [
|
|
773
|
+
"no-use-before-define": "off",
|
|
774
|
+
"@typescript-eslint/no-use-before-define": [
|
|
833
775
|
"error",
|
|
834
776
|
{
|
|
835
|
-
|
|
836
|
-
|
|
777
|
+
functions: false,
|
|
778
|
+
enums: true,
|
|
779
|
+
typedefs: false
|
|
837
780
|
}
|
|
838
781
|
],
|
|
839
|
-
"
|
|
840
|
-
"
|
|
841
|
-
"
|
|
842
|
-
"
|
|
843
|
-
"
|
|
844
|
-
"
|
|
845
|
-
"
|
|
846
|
-
"vue/padding-line-between-blocks": ["error", "always"],
|
|
847
|
-
"vue/prefer-define-options": "error",
|
|
848
|
-
"vue/prefer-import-from-vue": "error",
|
|
849
|
-
"vue/prefer-separate-static-class": "error",
|
|
850
|
-
"vue/prefer-true-attribute-shorthand": "error",
|
|
851
|
-
"vue/prop-name-casing": ["error", "camelCase"],
|
|
852
|
-
"vue/require-component-is": "error",
|
|
853
|
-
"vue/require-default-prop": "off",
|
|
854
|
-
"vue/require-explicit-emits": [
|
|
782
|
+
"no-useless-constructor": "off",
|
|
783
|
+
"@typescript-eslint/no-useless-constructor": "error",
|
|
784
|
+
"@typescript-eslint/no-useless-empty-export": "error",
|
|
785
|
+
"@typescript-eslint/no-useless-template-literals": "error",
|
|
786
|
+
"@typescript-eslint/non-nullable-type-assertion-style": "error",
|
|
787
|
+
"no-throw-literal": "off",
|
|
788
|
+
"@typescript-eslint/only-throw-error": [
|
|
855
789
|
"error",
|
|
856
790
|
{
|
|
857
|
-
|
|
791
|
+
allowThrowingAny: false,
|
|
792
|
+
allowThrowingUnknown: false
|
|
858
793
|
}
|
|
859
794
|
],
|
|
860
|
-
"
|
|
861
|
-
"
|
|
795
|
+
"@typescript-eslint/prefer-as-const": "error",
|
|
796
|
+
"@typescript-eslint/prefer-enum-initializers": "error",
|
|
797
|
+
"@typescript-eslint/prefer-find": "error",
|
|
798
|
+
"@typescript-eslint/prefer-for-of": "error",
|
|
799
|
+
"@typescript-eslint/prefer-function-type": "error",
|
|
800
|
+
"@typescript-eslint/prefer-includes": "error",
|
|
801
|
+
"@typescript-eslint/prefer-literal-enum-member": "error",
|
|
802
|
+
"@typescript-eslint/prefer-nullish-coalescing": [
|
|
862
803
|
"error",
|
|
863
804
|
{
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
805
|
+
ignoreTernaryTests: false,
|
|
806
|
+
ignoreConditionalTests: false,
|
|
807
|
+
ignoreMixedLogicalExpressions: false,
|
|
808
|
+
ignorePrimitives: {
|
|
809
|
+
bigint: false,
|
|
810
|
+
boolean: false,
|
|
811
|
+
number: false,
|
|
812
|
+
string: false
|
|
813
|
+
}
|
|
869
814
|
}
|
|
870
815
|
],
|
|
871
|
-
"
|
|
872
|
-
"
|
|
873
|
-
"
|
|
874
|
-
"
|
|
875
|
-
"
|
|
876
|
-
"
|
|
877
|
-
"
|
|
878
|
-
"
|
|
879
|
-
"
|
|
880
|
-
"
|
|
881
|
-
"
|
|
882
|
-
"
|
|
816
|
+
"@typescript-eslint/prefer-optional-chain": "error",
|
|
817
|
+
"prefer-promise-reject-errors": "off",
|
|
818
|
+
"@typescript-eslint/prefer-promise-reject-errors": "error",
|
|
819
|
+
"@typescript-eslint/prefer-readonly": "error",
|
|
820
|
+
"@typescript-eslint/prefer-readonly-parameter-types": "off",
|
|
821
|
+
"@typescript-eslint/prefer-reduce-type-parameter": "error",
|
|
822
|
+
"@typescript-eslint/prefer-regexp-exec": "error",
|
|
823
|
+
"@typescript-eslint/prefer-return-this-type": "error",
|
|
824
|
+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
|
825
|
+
"@typescript-eslint/prefer-ts-expect-error": "error",
|
|
826
|
+
"@typescript-eslint/promise-function-async": "off",
|
|
827
|
+
"@typescript-eslint/require-array-sort-compare": "error",
|
|
828
|
+
"require-await": "off",
|
|
829
|
+
"@typescript-eslint/require-await": "error",
|
|
830
|
+
"@typescript-eslint/restrict-plus-operands": "error",
|
|
831
|
+
"@typescript-eslint/restrict-template-expressions": "error",
|
|
832
|
+
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
833
|
+
"@typescript-eslint/switch-exhaustiveness-check": [
|
|
883
834
|
"error",
|
|
884
|
-
"shorthand",
|
|
885
835
|
{
|
|
886
|
-
|
|
836
|
+
requireDefaultForNonUnion: true
|
|
887
837
|
}
|
|
888
838
|
],
|
|
889
|
-
"
|
|
890
|
-
"
|
|
891
|
-
"vue/v-on-style": ["error", "shorthand"],
|
|
892
|
-
"vue/v-slot-style": [
|
|
839
|
+
"@typescript-eslint/unbound-method": "error",
|
|
840
|
+
"@typescript-eslint/unified-signatures": [
|
|
893
841
|
"error",
|
|
894
842
|
{
|
|
895
|
-
|
|
896
|
-
default: "shorthand",
|
|
897
|
-
named: "shorthand"
|
|
843
|
+
ignoreDifferentlyNamedParameters: true
|
|
898
844
|
}
|
|
899
845
|
],
|
|
900
|
-
"
|
|
901
|
-
|
|
902
|
-
"vue/valid-define-emits": "error",
|
|
903
|
-
"vue/valid-define-options": "error",
|
|
904
|
-
"vue/valid-define-props": "error",
|
|
905
|
-
"vue/valid-next-tick": "error",
|
|
906
|
-
"vue/valid-template-root": "error",
|
|
907
|
-
"vue/valid-v-bind": "error",
|
|
908
|
-
"vue/valid-v-cloak": "error",
|
|
909
|
-
"vue/valid-v-else-if": "error",
|
|
910
|
-
"vue/valid-v-else": "error",
|
|
911
|
-
"vue/valid-v-for": "error",
|
|
912
|
-
"vue/valid-v-html": "error",
|
|
913
|
-
"vue/valid-v-if": "error",
|
|
914
|
-
"vue/valid-v-memo": "error",
|
|
915
|
-
"vue/valid-v-model": "error",
|
|
916
|
-
"vue/valid-v-on": "error",
|
|
917
|
-
"vue/valid-v-once": "error",
|
|
918
|
-
"vue/valid-v-pre": "error",
|
|
919
|
-
"vue/valid-v-show": "error",
|
|
920
|
-
"vue/valid-v-slot": "error",
|
|
921
|
-
"vue/valid-v-text": "error",
|
|
922
|
-
...overrides == null ? void 0 : overrides.vue
|
|
846
|
+
"@typescript-eslint/use-unknown-in-catch-callback-variable": "error",
|
|
847
|
+
...overrides == null ? void 0 : overrides.typescript
|
|
923
848
|
};
|
|
924
|
-
return
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
849
|
+
return {
|
|
850
|
+
files,
|
|
851
|
+
languageOptions: {
|
|
852
|
+
ecmaVersion: "latest",
|
|
853
|
+
sourceType: "module",
|
|
854
|
+
parser: tsParser,
|
|
855
|
+
parserOptions: {
|
|
856
|
+
project,
|
|
857
|
+
tsconfigRootDir: process.cwd(),
|
|
858
|
+
extraFileExtensions: options.vue ? [".vue"] : []
|
|
928
859
|
}
|
|
929
860
|
},
|
|
930
|
-
{
|
|
931
|
-
|
|
932
|
-
languageOptions: {
|
|
933
|
-
parser: vueParser,
|
|
934
|
-
parserOptions: {
|
|
935
|
-
parser: tsParser,
|
|
936
|
-
project: options.project,
|
|
937
|
-
tsconfigRootDir: process.cwd(),
|
|
938
|
-
extraFileExtensions: [".vue"],
|
|
939
|
-
sourceType: "module",
|
|
940
|
-
ecmaVersion: "latest"
|
|
941
|
-
}
|
|
942
|
-
}
|
|
861
|
+
plugins: {
|
|
862
|
+
"@typescript-eslint": tsPlugin
|
|
943
863
|
},
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
864
|
+
rules
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
async function perfectionist(options) {
|
|
868
|
+
const { overrides, perfectionist: enabled = true } = options;
|
|
869
|
+
if (!enabled)
|
|
870
|
+
return {};
|
|
871
|
+
const plugin = await interopDefault(import("eslint-plugin-perfectionist"));
|
|
872
|
+
return {
|
|
873
|
+
plugins: {
|
|
874
|
+
perfectionist: plugin
|
|
875
|
+
},
|
|
876
|
+
rules: {
|
|
877
|
+
"perfectionist/sort-enums": [
|
|
878
|
+
"error",
|
|
879
|
+
{
|
|
880
|
+
type: "natural",
|
|
881
|
+
order: "asc"
|
|
882
|
+
}
|
|
883
|
+
],
|
|
884
|
+
"perfectionist/sort-exports": [
|
|
885
|
+
"error",
|
|
886
|
+
{
|
|
887
|
+
type: "line-length",
|
|
888
|
+
order: "asc"
|
|
889
|
+
}
|
|
890
|
+
],
|
|
891
|
+
"perfectionist/sort-imports": [
|
|
892
|
+
"error",
|
|
893
|
+
{
|
|
894
|
+
type: "line-length",
|
|
895
|
+
order: "asc",
|
|
896
|
+
"ignore-case": true,
|
|
897
|
+
"newlines-between": "never",
|
|
898
|
+
groups: [["side-effect-style", "side-effect"], "unknown"]
|
|
899
|
+
}
|
|
900
|
+
],
|
|
901
|
+
"perfectionist/sort-interfaces": [
|
|
902
|
+
"error",
|
|
903
|
+
{
|
|
904
|
+
type: "natural",
|
|
905
|
+
order: "asc",
|
|
906
|
+
"partition-by-new-line": true
|
|
907
|
+
}
|
|
908
|
+
],
|
|
909
|
+
"perfectionist/sort-intersection-types": [
|
|
910
|
+
"error",
|
|
911
|
+
{
|
|
912
|
+
type: "natural",
|
|
913
|
+
order: "asc"
|
|
914
|
+
}
|
|
915
|
+
],
|
|
916
|
+
"perfectionist/sort-maps": [
|
|
917
|
+
"error",
|
|
918
|
+
{
|
|
919
|
+
type: "natural",
|
|
920
|
+
order: "asc"
|
|
921
|
+
}
|
|
922
|
+
],
|
|
923
|
+
"perfectionist/sort-named-exports": [
|
|
924
|
+
"error",
|
|
925
|
+
{
|
|
926
|
+
type: "natural",
|
|
927
|
+
order: "asc"
|
|
928
|
+
}
|
|
929
|
+
],
|
|
930
|
+
"sort-imports": "off",
|
|
931
|
+
"perfectionist/sort-named-imports": [
|
|
932
|
+
"error",
|
|
933
|
+
{
|
|
934
|
+
type: "natural",
|
|
935
|
+
order: "asc"
|
|
936
|
+
}
|
|
937
|
+
],
|
|
938
|
+
"@typescript-eslint/adjacent-overload-signatures": "off",
|
|
939
|
+
"perfectionist/sort-object-types": [
|
|
940
|
+
"error",
|
|
941
|
+
{
|
|
942
|
+
type: "natural",
|
|
943
|
+
order: "asc",
|
|
944
|
+
"partition-by-new-line": true
|
|
945
|
+
}
|
|
946
|
+
],
|
|
947
|
+
...overrides == null ? void 0 : overrides.perfectionist
|
|
948
948
|
}
|
|
949
|
-
|
|
949
|
+
};
|
|
950
950
|
}
|
|
951
951
|
async function config(options) {
|
|
952
952
|
const { prettier = true } = options;
|