@deot/dev-eslint 2.9.9 → 2.9.10
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 +327 -403
- package/dist/index.d.ts +1 -1
- package/dist/index.js +292 -381
- package/package.json +10 -9
package/dist/index.js
CHANGED
|
@@ -1,392 +1,303 @@
|
|
|
1
|
-
import pluginTs from
|
|
2
|
-
import * as parserTs from
|
|
3
|
-
import js from
|
|
4
|
-
import globals from
|
|
5
|
-
import pluginJsdoc from
|
|
6
|
-
import pluginMarkdown from
|
|
7
|
-
import pluginImport from
|
|
8
|
-
import pluginStylistic from
|
|
9
|
-
import pluginVue from
|
|
10
|
-
import parserVue from
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import pluginTs from "@typescript-eslint/eslint-plugin";
|
|
2
|
+
import * as parserTs from "@typescript-eslint/parser";
|
|
3
|
+
import js from "@eslint/js";
|
|
4
|
+
import globals from "globals";
|
|
5
|
+
import pluginJsdoc from "eslint-plugin-jsdoc";
|
|
6
|
+
import pluginMarkdown from "eslint-plugin-markdown";
|
|
7
|
+
import pluginImport from "eslint-plugin-import-x";
|
|
8
|
+
import pluginStylistic from "@stylistic/eslint-plugin";
|
|
9
|
+
import pluginVue from "eslint-plugin-vue";
|
|
10
|
+
import parserVue from "vue-eslint-parser";
|
|
11
|
+
//#region packages/eslint/src/configs/_helper.ts
|
|
12
|
+
var pickOptions = async (key, options) => {
|
|
13
|
+
const configOptions = {
|
|
14
|
+
enable: typeof options?.[key] === "boolean" ? options[key] : true,
|
|
15
|
+
overrides: {},
|
|
16
|
+
...typeof options?.[key] === "object" ? options[key] : {}
|
|
17
|
+
};
|
|
18
|
+
const overrides = options?.overrides?.[key] || {};
|
|
19
|
+
return {
|
|
20
|
+
...configOptions,
|
|
21
|
+
overrides: {
|
|
22
|
+
...configOptions.overrides,
|
|
23
|
+
...overrides
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
console.error(key + ": " + invaild.join(",") + " has off default!\n");
|
|
53
|
-
}
|
|
54
|
-
if (isTest && deprecated.length) {
|
|
55
|
-
console.error(key + ": " + deprecated.join(",") + " has deprecated!\n");
|
|
56
|
-
}
|
|
57
|
-
return current;
|
|
27
|
+
var cleanRules = (key, all, recommended, current) => {
|
|
28
|
+
current = JSON.parse(JSON.stringify(current));
|
|
29
|
+
const deprecated = [];
|
|
30
|
+
const removed = [];
|
|
31
|
+
const invaild = [];
|
|
32
|
+
Object.keys(current).forEach((i) => {
|
|
33
|
+
/* istanbul ignore next -- @preserve */
|
|
34
|
+
if (all[i] === void 0 && recommended[i] === void 0) removed.push(i);
|
|
35
|
+
/* istanbul ignore next -- @preserve */
|
|
36
|
+
if (recommended[i] === void 0 && all[i] !== 0 && all[i] !== "off" && (current[i] === 0 || current[i] === "off")) invaild.push(i);
|
|
37
|
+
});
|
|
38
|
+
Object.keys(recommended).forEach((i) => {
|
|
39
|
+
if (all[i] === void 0) {
|
|
40
|
+
deprecated.push(i);
|
|
41
|
+
delete current[i];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const isTest = process.env.NODE_ENV === "UNIT" && !process.env.CI;
|
|
45
|
+
/* istanbul ignore next -- @preserve */
|
|
46
|
+
if (isTest && removed.length) console.error(key + ": " + removed.join(",") + " has removed!\n");
|
|
47
|
+
/* istanbul ignore next -- @preserve */
|
|
48
|
+
if (isTest && invaild.length) console.error(key + ": " + invaild.join(",") + " has off default!\n");
|
|
49
|
+
/* istanbul ignore next -- @preserve */
|
|
50
|
+
if (isTest && deprecated.length) console.error(key + ": " + deprecated.join(",") + " has deprecated!\n");
|
|
51
|
+
return current;
|
|
58
52
|
};
|
|
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
|
-
...cleanRules(
|
|
92
|
-
"typescript",
|
|
93
|
-
{ ...allRules, ...recommendedRules },
|
|
94
|
-
// all使用了extends, 但这里使用flat config
|
|
95
|
-
recommendedRules,
|
|
96
|
-
rules
|
|
97
|
-
),
|
|
98
|
-
...options.overrides
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
];
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region packages/eslint/src/configs/typescript.ts
|
|
55
|
+
var typescript = async (options$) => {
|
|
56
|
+
const options = await pickOptions("typescript", options$);
|
|
57
|
+
if (!options.enable) return [];
|
|
58
|
+
const recommendedRules = pluginTs.configs["eslint-recommended"].overrides[0].rules;
|
|
59
|
+
const allRules = pluginTs.configs["all"].rules;
|
|
60
|
+
const rules = {
|
|
61
|
+
...recommendedRules,
|
|
62
|
+
"@typescript-eslint/no-shadow": 2,
|
|
63
|
+
"@typescript-eslint/no-unused-vars": 1,
|
|
64
|
+
"no-unused-vars": 0
|
|
65
|
+
};
|
|
66
|
+
return [{ plugins: { "@typescript-eslint": pluginTs } }, {
|
|
67
|
+
files: [
|
|
68
|
+
"*.ts",
|
|
69
|
+
"*.tsx",
|
|
70
|
+
"*.mts",
|
|
71
|
+
"*.cts"
|
|
72
|
+
].map((i) => "**/" + i),
|
|
73
|
+
languageOptions: {
|
|
74
|
+
parser: parserTs,
|
|
75
|
+
parserOptions: { sourceType: "module" }
|
|
76
|
+
},
|
|
77
|
+
rules: {
|
|
78
|
+
...cleanRules("typescript", {
|
|
79
|
+
...allRules,
|
|
80
|
+
...recommendedRules
|
|
81
|
+
}, recommendedRules, rules),
|
|
82
|
+
...options.overrides
|
|
83
|
+
}
|
|
84
|
+
}];
|
|
102
85
|
};
|
|
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
|
-
sourceType: "module"
|
|
142
|
-
},
|
|
143
|
-
rules: {
|
|
144
|
-
...cleanRules("javascript", allRules, recommendedRules, rules),
|
|
145
|
-
...options.overrides
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
];
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region packages/eslint/src/configs/javascript.ts
|
|
88
|
+
var javascript = async (options$) => {
|
|
89
|
+
const options = await pickOptions("javascript", options$);
|
|
90
|
+
if (!options.enable) return [];
|
|
91
|
+
const allRules = js.configs.all.rules;
|
|
92
|
+
const recommendedRules = js.configs.recommended.rules;
|
|
93
|
+
const rules = {
|
|
94
|
+
...recommendedRules,
|
|
95
|
+
"no-undef": 1,
|
|
96
|
+
"no-debugger": 1,
|
|
97
|
+
"no-unused-vars": 1,
|
|
98
|
+
"no-useless-escape": 0,
|
|
99
|
+
"prefer-const": [2, {
|
|
100
|
+
destructuring: "all",
|
|
101
|
+
ignoreReadBeforeAssign: false
|
|
102
|
+
}]
|
|
103
|
+
};
|
|
104
|
+
return [{
|
|
105
|
+
languageOptions: {
|
|
106
|
+
ecmaVersion: "latest",
|
|
107
|
+
globals: {
|
|
108
|
+
...globals.browser,
|
|
109
|
+
...globals.es2021,
|
|
110
|
+
...globals.node
|
|
111
|
+
},
|
|
112
|
+
parserOptions: {
|
|
113
|
+
ecmaFeatures: { jsx: true },
|
|
114
|
+
ecmaVersion: 2022,
|
|
115
|
+
sourceType: "module"
|
|
116
|
+
},
|
|
117
|
+
sourceType: "module"
|
|
118
|
+
},
|
|
119
|
+
rules: {
|
|
120
|
+
...cleanRules("javascript", allRules, recommendedRules, rules),
|
|
121
|
+
...options.overrides
|
|
122
|
+
}
|
|
123
|
+
}];
|
|
149
124
|
};
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
plugins: {
|
|
165
|
-
jsdoc: pluginJsdoc
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
rules: {
|
|
170
|
-
...cleanRules("jsdoc", recommendedRules, recommendedRules, rules),
|
|
171
|
-
...options.overrides
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
];
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region packages/eslint/src/configs/jsdoc.ts
|
|
127
|
+
var jsdoc = async (options$) => {
|
|
128
|
+
const options = await pickOptions("jsdoc", options$);
|
|
129
|
+
if (!options.enable) return [];
|
|
130
|
+
const recommendedRules = pluginJsdoc.configs["flat/recommended-typescript"].rules;
|
|
131
|
+
const rules = {
|
|
132
|
+
...recommendedRules,
|
|
133
|
+
"jsdoc/check-tag-names": 0
|
|
134
|
+
};
|
|
135
|
+
return [{ plugins: { jsdoc: pluginJsdoc } }, { rules: {
|
|
136
|
+
...cleanRules("jsdoc", recommendedRules, recommendedRules, rules),
|
|
137
|
+
...options.overrides
|
|
138
|
+
} }];
|
|
175
139
|
};
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
parserOptions: {
|
|
203
|
-
ecmaFeatures: {
|
|
204
|
-
impliedStrict: true
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
rules: {
|
|
209
|
-
...config.rules,
|
|
210
|
-
"no-console": 1,
|
|
211
|
-
...options.overrides
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
];
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region packages/eslint/src/configs/markdown.ts
|
|
142
|
+
var markdown = async (options$) => {
|
|
143
|
+
const options = await pickOptions("markdown", options$);
|
|
144
|
+
if (!options.enable) return [];
|
|
145
|
+
const config = pluginMarkdown.configs.recommended[2];
|
|
146
|
+
return [
|
|
147
|
+
{ plugins: { markdown: pluginMarkdown } },
|
|
148
|
+
{
|
|
149
|
+
files: ["**/*.md"],
|
|
150
|
+
processor: "markdown/markdown"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
files: ["**/*.md/*.ts"],
|
|
154
|
+
rules: { "@typescript-eslint/no-unused-vars": 0 }
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
files: ["**/*.md/**"],
|
|
158
|
+
languageOptions: { parserOptions: { ecmaFeatures: { impliedStrict: true } } },
|
|
159
|
+
rules: {
|
|
160
|
+
...config.rules,
|
|
161
|
+
"no-console": 1,
|
|
162
|
+
...options.overrides
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
];
|
|
215
166
|
};
|
|
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
|
-
return [
|
|
242
|
-
{
|
|
243
|
-
ignores: [
|
|
244
|
-
...defaults,
|
|
245
|
-
...ignores$
|
|
246
|
-
]
|
|
247
|
-
}
|
|
248
|
-
];
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region packages/eslint/src/configs/ignores.ts
|
|
169
|
+
var ignores = async (ignores$ = []) => {
|
|
170
|
+
let defaults = [
|
|
171
|
+
"**/node_modules",
|
|
172
|
+
"**/dist",
|
|
173
|
+
"**/tmp",
|
|
174
|
+
"**/temp",
|
|
175
|
+
"**/coverage",
|
|
176
|
+
"**/package-lock.json",
|
|
177
|
+
"**/yarn.lock",
|
|
178
|
+
"**/pnpm-lock.yaml"
|
|
179
|
+
];
|
|
180
|
+
if (ignores$ && ignores$.length) defaults = defaults.filter((i) => {
|
|
181
|
+
if (ignores$.includes(i)) return false;
|
|
182
|
+
const reverse = "!" + i;
|
|
183
|
+
if (ignores$.includes(reverse)) {
|
|
184
|
+
ignores$ = ignores$?.filter((j) => j !== reverse);
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
return true;
|
|
188
|
+
});
|
|
189
|
+
return [{ ignores: [...defaults, ...ignores$] }];
|
|
249
190
|
};
|
|
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
|
-
...cleanRules(
|
|
281
|
-
"import",
|
|
282
|
-
Object.keys(pluginImport.rules).reduce((pre, key) => {
|
|
283
|
-
pre[`import-x/${key}`] = 2;
|
|
284
|
-
return pre;
|
|
285
|
-
}, {}),
|
|
286
|
-
recommendedRules,
|
|
287
|
-
rules
|
|
288
|
-
),
|
|
289
|
-
...options.overrides
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
];
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region packages/eslint/src/configs/imports.ts
|
|
193
|
+
var imports = async (options$) => {
|
|
194
|
+
const options = await pickOptions("import", options$);
|
|
195
|
+
if (!options.enable) return [];
|
|
196
|
+
const recommendedRules = pluginImport.configs.recommended.rules;
|
|
197
|
+
const rules = {
|
|
198
|
+
...recommendedRules,
|
|
199
|
+
"import-x/newline-after-import": 1,
|
|
200
|
+
"import-x/no-unresolved": 0,
|
|
201
|
+
"import-x/namespace": 0,
|
|
202
|
+
"import-x/default": 0,
|
|
203
|
+
"import-x/no-named-as-default": 0,
|
|
204
|
+
"import-x/no-named-as-default-member": 0
|
|
205
|
+
};
|
|
206
|
+
return [{
|
|
207
|
+
plugins: { "import-x": pluginImport },
|
|
208
|
+
settings: { "import/parsers": { espree: [
|
|
209
|
+
".js",
|
|
210
|
+
".cjs",
|
|
211
|
+
".mjs",
|
|
212
|
+
".jsx"
|
|
213
|
+
] } }
|
|
214
|
+
}, { rules: {
|
|
215
|
+
...cleanRules("import", Object.keys(pluginImport.rules).reduce((pre, key) => {
|
|
216
|
+
pre[`import-x/${key}`] = 2;
|
|
217
|
+
return pre;
|
|
218
|
+
}, {}), recommendedRules, rules),
|
|
219
|
+
...options.overrides
|
|
220
|
+
} }];
|
|
293
221
|
};
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
"@stylistic": pluginStylistic
|
|
328
|
-
}
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
rules: {
|
|
332
|
-
...cleanRules("stylistic", allRules, allRules, rules),
|
|
333
|
-
...options.overrides
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
];
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region packages/eslint/src/configs/stylistic.ts
|
|
224
|
+
var stylistic = async (options$) => {
|
|
225
|
+
const options = await pickOptions("stylistic", options$);
|
|
226
|
+
if (!options.enable) return [];
|
|
227
|
+
const allRules = pluginStylistic.configs.customize({
|
|
228
|
+
indent: "tab",
|
|
229
|
+
quotes: "single",
|
|
230
|
+
semi: true,
|
|
231
|
+
jsx: true
|
|
232
|
+
}).rules;
|
|
233
|
+
const rules = {
|
|
234
|
+
...allRules,
|
|
235
|
+
"@stylistic/comma-dangle": ["warn", {
|
|
236
|
+
arrays: "never",
|
|
237
|
+
objects: "ignore",
|
|
238
|
+
imports: "never",
|
|
239
|
+
exports: "never",
|
|
240
|
+
functions: "ignore"
|
|
241
|
+
}],
|
|
242
|
+
"@stylistic/brace-style": [
|
|
243
|
+
"error",
|
|
244
|
+
"1tbs",
|
|
245
|
+
{ allowSingleLine: true }
|
|
246
|
+
],
|
|
247
|
+
"@stylistic/member-delimiter-style": 1,
|
|
248
|
+
"@stylistic/max-statements-per-line": ["off", { max: 1 }],
|
|
249
|
+
"@stylistic/max-len": [1, { code: 150 }]
|
|
250
|
+
};
|
|
251
|
+
return [{ plugins: { "@stylistic": pluginStylistic } }, { rules: {
|
|
252
|
+
...cleanRules("stylistic", allRules, allRules, rules),
|
|
253
|
+
...options.overrides
|
|
254
|
+
} }];
|
|
337
255
|
};
|
|
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
|
-
rules: {
|
|
369
|
-
...cleanRules("vue", essentialRules, essentialRules, rules),
|
|
370
|
-
...options.overrides
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
];
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region packages/eslint/src/configs/vue.ts
|
|
258
|
+
var vue = async (options$) => {
|
|
259
|
+
const options = await pickOptions("vue", options$);
|
|
260
|
+
if (!options.enable) return [];
|
|
261
|
+
const essentialRules = pluginVue.configs["essential"].rules;
|
|
262
|
+
const rules = {
|
|
263
|
+
...essentialRules,
|
|
264
|
+
"vue/html-indent": ["error", "tab"],
|
|
265
|
+
"vue/no-multiple-template-root": 0,
|
|
266
|
+
"vue/multi-word-component-names": 0,
|
|
267
|
+
"vue/no-shared-component-data": 0
|
|
268
|
+
};
|
|
269
|
+
return [
|
|
270
|
+
{ plugins: { vue: pluginVue } },
|
|
271
|
+
...pluginVue.configs["flat/base"],
|
|
272
|
+
{
|
|
273
|
+
files: ["**/*.vue"],
|
|
274
|
+
languageOptions: {
|
|
275
|
+
parser: parserVue,
|
|
276
|
+
parserOptions: { sourceType: "module" }
|
|
277
|
+
},
|
|
278
|
+
rules: {
|
|
279
|
+
...cleanRules("vue", essentialRules, essentialRules, rules),
|
|
280
|
+
...options.overrides
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
];
|
|
374
284
|
};
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region packages/eslint/src/configure.ts
|
|
287
|
+
var configure = async (options, ...userConfigs) => {
|
|
288
|
+
return [
|
|
289
|
+
...await ignores(options?.ignores),
|
|
290
|
+
...await javascript(options),
|
|
291
|
+
...await typescript(options),
|
|
292
|
+
...await jsdoc(options),
|
|
293
|
+
...await markdown(options),
|
|
294
|
+
...await imports(options),
|
|
295
|
+
...await stylistic(options),
|
|
296
|
+
...await vue(options)
|
|
297
|
+
].concat(userConfigs);
|
|
388
298
|
};
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
299
|
+
//#endregion
|
|
300
|
+
//#region packages/eslint/src/index.ts
|
|
301
|
+
var src_default = configure();
|
|
302
|
+
//#endregion
|
|
303
|
+
export { configure, src_default as default };
|