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