@sxzz/eslint-config 3.5.4 → 3.6.0
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/{index.cjs → dist/index.cjs} +630 -309
- package/dist/index.d.cts +98 -0
- package/dist/index.d.ts +98 -0
- package/dist/index.js +1016 -0
- package/package.json +18 -19
- package/index.js +0 -10
- package/src/eslint-comments.js +0 -17
- package/src/js.js +0 -256
- package/src/jsonc.js +0 -95
- package/src/markdown.js +0 -44
- package/src/presets.js +0 -69
- package/src/prettier.js +0 -19
- package/src/shared.js +0 -67
- package/src/typescript.js +0 -58
- package/src/unocss.js +0 -13
- package/src/vue.js +0 -137
- package/src/yml.js +0 -21
|
@@ -27,46 +27,114 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
|
-
// index.
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
GLOB_ALL_SRC: () => GLOB_ALL_SRC,
|
|
34
|
+
GLOB_CSS: () => GLOB_CSS,
|
|
35
|
+
GLOB_DIST: () => GLOB_DIST,
|
|
36
|
+
GLOB_EXCLUDE: () => GLOB_EXCLUDE,
|
|
37
|
+
GLOB_HTML: () => GLOB_HTML,
|
|
38
|
+
GLOB_JS: () => GLOB_JS,
|
|
39
|
+
GLOB_JSON: () => GLOB_JSON,
|
|
40
|
+
GLOB_JSON5: () => GLOB_JSON5,
|
|
41
|
+
GLOB_JSONC: () => GLOB_JSONC,
|
|
42
|
+
GLOB_JSX: () => GLOB_JSX,
|
|
43
|
+
GLOB_LESS: () => GLOB_LESS,
|
|
44
|
+
GLOB_LOCKFILE: () => GLOB_LOCKFILE,
|
|
45
|
+
GLOB_MARKDOWN: () => GLOB_MARKDOWN,
|
|
46
|
+
GLOB_NODE_MODULES: () => GLOB_NODE_MODULES,
|
|
47
|
+
GLOB_SCSS: () => GLOB_SCSS,
|
|
48
|
+
GLOB_SRC: () => GLOB_SRC,
|
|
49
|
+
GLOB_SRC_EXT: () => GLOB_SRC_EXT,
|
|
50
|
+
GLOB_STYLE: () => GLOB_STYLE,
|
|
51
|
+
GLOB_TS: () => GLOB_TS,
|
|
52
|
+
GLOB_TSX: () => GLOB_TSX,
|
|
53
|
+
GLOB_VUE: () => GLOB_VUE,
|
|
54
|
+
GLOB_YAML: () => GLOB_YAML,
|
|
33
55
|
all: () => all,
|
|
34
|
-
antfuPlugin: () => import_eslint_plugin_antfu.default,
|
|
35
56
|
basic: () => basic,
|
|
36
|
-
|
|
57
|
+
comments: () => comments,
|
|
58
|
+
configPrettier: () => configPrettier,
|
|
37
59
|
getVueVersion: () => getVueVersion,
|
|
38
|
-
|
|
60
|
+
hasTypeScript: () => hasTypeScript,
|
|
61
|
+
hasVue: () => hasVue,
|
|
62
|
+
ignores: () => ignores,
|
|
39
63
|
imports: () => imports,
|
|
40
|
-
|
|
64
|
+
isInEditor: () => isInEditor,
|
|
65
|
+
javascript: () => javascript,
|
|
41
66
|
jsonc: () => jsonc,
|
|
42
|
-
jsx: () => jsx,
|
|
43
67
|
markdown: () => markdown,
|
|
44
|
-
|
|
68
|
+
parserJsonc: () => parserJsonc,
|
|
69
|
+
parserTypeScript: () => parserTypeScript,
|
|
70
|
+
parserVue: () => parserVue,
|
|
71
|
+
parserYml: () => parserYml,
|
|
72
|
+
pluginAntfu: () => pluginAntfu,
|
|
73
|
+
pluginComments: () => pluginComments,
|
|
74
|
+
pluginImport: () => pluginImport,
|
|
75
|
+
pluginJsonc: () => pluginJsonc,
|
|
76
|
+
pluginMarkdown: () => pluginMarkdown,
|
|
77
|
+
pluginPrettier: () => pluginPrettier,
|
|
78
|
+
pluginTypeScript: () => pluginTypeScript,
|
|
79
|
+
pluginUnicorn: () => pluginUnicorn,
|
|
80
|
+
pluginUnocss: () => pluginUnocss,
|
|
81
|
+
pluginUnusedImports: () => pluginUnusedImports,
|
|
82
|
+
pluginVue: () => pluginVue,
|
|
83
|
+
pluginYml: () => pluginYml,
|
|
84
|
+
presetBasic: () => basic,
|
|
85
|
+
presetJavaScript: () => presetJavaScript,
|
|
86
|
+
presetLangsExtensions: () => presetLangsExtensions,
|
|
45
87
|
prettier: () => prettier,
|
|
46
88
|
reactivityTransform: () => reactivityTransform,
|
|
89
|
+
sortPackageJson: () => sortPackageJson,
|
|
90
|
+
sortTsconfig: () => sortTsconfig,
|
|
47
91
|
sxzz: () => sxzz,
|
|
48
|
-
tsParser: () => import_parser.default,
|
|
49
|
-
tsPlugin: () => import_eslint_plugin2.default,
|
|
50
92
|
typescript: () => typescript,
|
|
51
93
|
unicorn: () => unicorn,
|
|
52
|
-
unicornPlugin: () => import_eslint_plugin_unicorn.default,
|
|
53
94
|
unocss: () => unocss,
|
|
54
95
|
vue: () => vue,
|
|
55
|
-
vueParser: () => import_vue_eslint_parser.default,
|
|
56
|
-
vuePlugin: () => import_eslint_plugin_vue.default,
|
|
57
96
|
yml: () => yml
|
|
58
97
|
});
|
|
59
|
-
module.exports = __toCommonJS(
|
|
98
|
+
module.exports = __toCommonJS(src_exports);
|
|
60
99
|
|
|
61
|
-
// src/
|
|
62
|
-
var
|
|
63
|
-
var
|
|
100
|
+
// src/plugins.ts
|
|
101
|
+
var _pluginAntfu = __toESM(require("eslint-plugin-antfu"), 1);
|
|
102
|
+
var _pluginComments = __toESM(require("eslint-plugin-eslint-comments"), 1);
|
|
103
|
+
var _pluginMarkdown = __toESM(require("eslint-plugin-markdown"), 1);
|
|
104
|
+
var _pluginTypeScript = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
|
|
105
|
+
var _pluginUnicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
106
|
+
var _pluginVue = __toESM(require("eslint-plugin-vue"), 1);
|
|
107
|
+
var _pluginUnocss = __toESM(require("@unocss/eslint-plugin"), 1);
|
|
108
|
+
var _pluginPrettier = __toESM(require("eslint-plugin-prettier"), 1);
|
|
109
|
+
var pluginImport = __toESM(require("eslint-plugin-i"), 1);
|
|
110
|
+
var pluginJsonc = __toESM(require("eslint-plugin-jsonc"), 1);
|
|
111
|
+
var pluginUnusedImports = __toESM(require("eslint-plugin-unused-imports"), 1);
|
|
112
|
+
var pluginYml = __toESM(require("eslint-plugin-yml"), 1);
|
|
113
|
+
var parserTypeScript = __toESM(require("@typescript-eslint/parser"), 1);
|
|
114
|
+
var parserVue = __toESM(require("vue-eslint-parser"), 1);
|
|
115
|
+
var parserYml = __toESM(require("yaml-eslint-parser"), 1);
|
|
116
|
+
var parserJsonc = __toESM(require("jsonc-eslint-parser"), 1);
|
|
117
|
+
var configPrettier = __toESM(require("eslint-config-prettier"), 1);
|
|
118
|
+
function interopDefault(m) {
|
|
119
|
+
return m.default || m;
|
|
120
|
+
}
|
|
121
|
+
var pluginAntfu = interopDefault(_pluginAntfu);
|
|
122
|
+
var pluginComments = interopDefault(_pluginComments);
|
|
123
|
+
var pluginMarkdown = interopDefault(_pluginMarkdown);
|
|
124
|
+
var pluginTypeScript = interopDefault(_pluginTypeScript);
|
|
125
|
+
var pluginUnicorn = interopDefault(_pluginUnicorn);
|
|
126
|
+
var pluginVue = interopDefault(_pluginVue);
|
|
127
|
+
var pluginUnocss = interopDefault(_pluginUnocss);
|
|
128
|
+
var pluginPrettier = interopDefault(_pluginPrettier);
|
|
129
|
+
|
|
130
|
+
// src/configs/comments.ts
|
|
131
|
+
var comments = [
|
|
64
132
|
{
|
|
65
133
|
plugins: {
|
|
66
|
-
"eslint-comments":
|
|
134
|
+
"eslint-comments": pluginComments
|
|
67
135
|
},
|
|
68
136
|
rules: {
|
|
69
|
-
...
|
|
137
|
+
...pluginComments.configs.recommended.rules,
|
|
70
138
|
"eslint-comments/disable-enable-pair": [
|
|
71
139
|
"error",
|
|
72
140
|
{ allowWholeFile: true }
|
|
@@ -75,25 +143,37 @@ var eslintComments = [
|
|
|
75
143
|
}
|
|
76
144
|
];
|
|
77
145
|
|
|
78
|
-
// src/
|
|
79
|
-
var import_globals = __toESM(require("globals"), 1);
|
|
80
|
-
var import_js = __toESM(require("@eslint/js"), 1);
|
|
81
|
-
var import_eslint_plugin_import = __toESM(require("eslint-plugin-import"), 1);
|
|
82
|
-
var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
83
|
-
var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
|
|
84
|
-
var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
|
|
85
|
-
|
|
86
|
-
// src/shared.js
|
|
146
|
+
// src/globs.ts
|
|
87
147
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
88
148
|
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
149
|
+
var GLOB_JS = "**/*.?([cm])js";
|
|
150
|
+
var GLOB_JSX = "**/*.?([cm])jsx";
|
|
89
151
|
var GLOB_TS = "**/*.?([cm])ts";
|
|
90
152
|
var GLOB_TSX = "**/*.?([cm])tsx";
|
|
153
|
+
var GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
154
|
+
var GLOB_CSS = "**/*.css";
|
|
155
|
+
var GLOB_LESS = "**/*.less";
|
|
156
|
+
var GLOB_SCSS = "**/*.scss";
|
|
91
157
|
var GLOB_JSON = "**/*.json";
|
|
92
158
|
var GLOB_JSON5 = "**/*.json5";
|
|
93
159
|
var GLOB_JSONC = "**/*.jsonc";
|
|
94
160
|
var GLOB_MARKDOWN = "**/*.md";
|
|
95
161
|
var GLOB_VUE = "**/*.vue";
|
|
96
162
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
163
|
+
var GLOB_HTML = "**/*.htm?(l)";
|
|
164
|
+
var GLOB_ALL_SRC = (
|
|
165
|
+
/** @type {const} */
|
|
166
|
+
[
|
|
167
|
+
GLOB_SRC,
|
|
168
|
+
GLOB_STYLE,
|
|
169
|
+
GLOB_JSON,
|
|
170
|
+
GLOB_JSON5,
|
|
171
|
+
GLOB_MARKDOWN,
|
|
172
|
+
GLOB_VUE,
|
|
173
|
+
GLOB_YAML,
|
|
174
|
+
GLOB_HTML
|
|
175
|
+
]
|
|
176
|
+
);
|
|
97
177
|
var GLOB_NODE_MODULES = (
|
|
98
178
|
/** @type {const} */
|
|
99
179
|
"**/node_modules"
|
|
@@ -136,10 +216,75 @@ var GLOB_EXCLUDE = (
|
|
|
136
216
|
]
|
|
137
217
|
);
|
|
138
218
|
|
|
139
|
-
// src/
|
|
140
|
-
var
|
|
141
|
-
|
|
142
|
-
|
|
219
|
+
// src/configs/ignores.ts
|
|
220
|
+
var ignores = [{ ignores: GLOB_EXCLUDE }];
|
|
221
|
+
|
|
222
|
+
// src/configs/imports.ts
|
|
223
|
+
var imports = [
|
|
224
|
+
{
|
|
225
|
+
plugins: {
|
|
226
|
+
import: pluginImport,
|
|
227
|
+
antfu: pluginAntfu
|
|
228
|
+
},
|
|
229
|
+
rules: {
|
|
230
|
+
"import/first": "error",
|
|
231
|
+
"import/no-default-export": "error",
|
|
232
|
+
"import/no-duplicates": "error",
|
|
233
|
+
"import/no-mutable-exports": "error",
|
|
234
|
+
"import/no-named-default": "error",
|
|
235
|
+
"import/no-self-import": "error",
|
|
236
|
+
"import/no-webpack-loader-syntax": "error",
|
|
237
|
+
"import/order": [
|
|
238
|
+
"error",
|
|
239
|
+
{
|
|
240
|
+
groups: [
|
|
241
|
+
"builtin",
|
|
242
|
+
"external",
|
|
243
|
+
"internal",
|
|
244
|
+
"parent",
|
|
245
|
+
"sibling",
|
|
246
|
+
"index",
|
|
247
|
+
"object",
|
|
248
|
+
"type"
|
|
249
|
+
],
|
|
250
|
+
pathGroups: [{ pattern: "{{@,~}/,#}**", group: "internal" }],
|
|
251
|
+
pathGroupsExcludedImportTypes: ["type"]
|
|
252
|
+
}
|
|
253
|
+
],
|
|
254
|
+
"antfu/import-dedupe": "error",
|
|
255
|
+
"antfu/prefer-inline-type-import": "error"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
files: [
|
|
260
|
+
`**/*config*.${GLOB_SRC_EXT}`,
|
|
261
|
+
`**/views/${GLOB_SRC}`,
|
|
262
|
+
`**/pages/${GLOB_SRC}`,
|
|
263
|
+
`**/{index,vite,esbuild,rollup,webpack,rspack}.ts`,
|
|
264
|
+
"**/*.d.ts",
|
|
265
|
+
`${GLOB_MARKDOWN}/**`
|
|
266
|
+
],
|
|
267
|
+
plugins: {
|
|
268
|
+
import: pluginImport
|
|
269
|
+
},
|
|
270
|
+
rules: {
|
|
271
|
+
"import/no-default-export": "off"
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
];
|
|
275
|
+
|
|
276
|
+
// src/configs/javascript.ts
|
|
277
|
+
var import_globals = __toESM(require("globals"), 1);
|
|
278
|
+
|
|
279
|
+
// src/env.ts
|
|
280
|
+
var import_node_process = __toESM(require("process"), 1);
|
|
281
|
+
var import_local_pkg = require("local-pkg");
|
|
282
|
+
var isInEditor = (import_node_process.default.env.VSCODE_PID || import_node_process.default.env.JETBRAINS_IDE) && !import_node_process.default.env.CI;
|
|
283
|
+
var hasTypeScript = (0, import_local_pkg.isPackageExists)("typescript");
|
|
284
|
+
var hasVue = (0, import_local_pkg.isPackageExists)("vue") || (0, import_local_pkg.isPackageExists)("nuxt") || (0, import_local_pkg.isPackageExists)("vitepress") || (0, import_local_pkg.isPackageExists)("@slidev/cli");
|
|
285
|
+
|
|
286
|
+
// src/configs/javascript.ts
|
|
287
|
+
var javascript = [
|
|
143
288
|
{
|
|
144
289
|
languageOptions: {
|
|
145
290
|
globals: {
|
|
@@ -147,15 +292,81 @@ var js = [
|
|
|
147
292
|
...import_globals.default.es2021,
|
|
148
293
|
...import_globals.default.node
|
|
149
294
|
},
|
|
295
|
+
parserOptions: {
|
|
296
|
+
ecmaFeatures: {
|
|
297
|
+
jsx: true
|
|
298
|
+
},
|
|
299
|
+
sourceType: "module"
|
|
300
|
+
},
|
|
150
301
|
sourceType: "module"
|
|
151
302
|
},
|
|
152
303
|
plugins: {
|
|
153
|
-
"unused-imports":
|
|
304
|
+
"unused-imports": pluginUnusedImports
|
|
154
305
|
},
|
|
155
306
|
rules: {
|
|
156
|
-
"
|
|
157
|
-
"
|
|
307
|
+
"constructor-super": "error",
|
|
308
|
+
"for-direction": "error",
|
|
309
|
+
"getter-return": "error",
|
|
310
|
+
"no-async-promise-executor": "error",
|
|
311
|
+
"no-case-declarations": "error",
|
|
312
|
+
"no-class-assign": "error",
|
|
313
|
+
"no-compare-neg-zero": "error",
|
|
314
|
+
"no-cond-assign": "error",
|
|
315
|
+
"no-const-assign": "error",
|
|
316
|
+
"no-constant-condition": "error",
|
|
317
|
+
"no-control-regex": "error",
|
|
158
318
|
"no-debugger": "warn",
|
|
319
|
+
"no-delete-var": "error",
|
|
320
|
+
"no-dupe-args": "error",
|
|
321
|
+
"no-dupe-class-members": "error",
|
|
322
|
+
"no-dupe-else-if": "error",
|
|
323
|
+
"no-dupe-keys": "error",
|
|
324
|
+
"no-duplicate-case": "error",
|
|
325
|
+
"no-empty": ["error", { allowEmptyCatch: true }],
|
|
326
|
+
"no-empty-character-class": "error",
|
|
327
|
+
"no-empty-pattern": "error",
|
|
328
|
+
"no-ex-assign": "error",
|
|
329
|
+
"no-extra-boolean-cast": "error",
|
|
330
|
+
"no-fallthrough": ["warn", { commentPattern: "break[\\s\\w]*omitted" }],
|
|
331
|
+
"no-func-assign": "error",
|
|
332
|
+
"no-global-assign": "error",
|
|
333
|
+
"no-import-assign": "error",
|
|
334
|
+
"no-inner-declarations": "error",
|
|
335
|
+
"no-invalid-regexp": "error",
|
|
336
|
+
"no-irregular-whitespace": "error",
|
|
337
|
+
"no-loss-of-precision": "error",
|
|
338
|
+
"no-misleading-character-class": "error",
|
|
339
|
+
"no-mixed-spaces-and-tabs": "error",
|
|
340
|
+
"no-new-symbol": "error",
|
|
341
|
+
"no-nonoctal-decimal-escape": "error",
|
|
342
|
+
"no-obj-calls": "error",
|
|
343
|
+
"no-octal": "error",
|
|
344
|
+
"no-prototype-builtins": "error",
|
|
345
|
+
"no-redeclare": "error",
|
|
346
|
+
"no-regex-spaces": "error",
|
|
347
|
+
"no-self-assign": "error",
|
|
348
|
+
"no-setter-return": "error",
|
|
349
|
+
"no-shadow-restricted-names": "error",
|
|
350
|
+
"no-sparse-arrays": "error",
|
|
351
|
+
"no-this-before-super": "error",
|
|
352
|
+
"no-undef": "error",
|
|
353
|
+
"no-unexpected-multiline": "error",
|
|
354
|
+
"no-unreachable": "error",
|
|
355
|
+
"no-unsafe-finally": "error",
|
|
356
|
+
"no-unsafe-negation": "error",
|
|
357
|
+
"no-unsafe-optional-chaining": "error",
|
|
358
|
+
"no-unused-labels": "error",
|
|
359
|
+
"no-unused-vars": "off",
|
|
360
|
+
"no-useless-backreference": "error",
|
|
361
|
+
"no-useless-catch": "error",
|
|
362
|
+
"no-useless-escape": "error",
|
|
363
|
+
"no-with": "error",
|
|
364
|
+
"require-yield": "error",
|
|
365
|
+
"use-isnan": [
|
|
366
|
+
"error",
|
|
367
|
+
{ enforceForIndexOf: true, enforceForSwitchCase: true }
|
|
368
|
+
],
|
|
369
|
+
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
159
370
|
"no-console": ["warn", { allow: ["warn", "error"] }],
|
|
160
371
|
"no-restricted-syntax": [
|
|
161
372
|
"error",
|
|
@@ -164,7 +375,6 @@ var js = [
|
|
|
164
375
|
"WithStatement"
|
|
165
376
|
],
|
|
166
377
|
"no-return-await": "warn",
|
|
167
|
-
"no-empty": ["error", { allowEmptyCatch: true }],
|
|
168
378
|
"sort-imports": [
|
|
169
379
|
"error",
|
|
170
380
|
{
|
|
@@ -176,20 +386,21 @@ var js = [
|
|
|
176
386
|
}
|
|
177
387
|
],
|
|
178
388
|
"dot-notation": "warn",
|
|
179
|
-
"no-var": "error",
|
|
180
|
-
"prefer-const": [
|
|
181
|
-
"warn",
|
|
182
|
-
{ destructuring: "all", ignoreReadBeforeAssign: true }
|
|
183
|
-
],
|
|
184
389
|
"prefer-arrow-callback": [
|
|
185
390
|
"error",
|
|
186
391
|
{ allowNamedFunctions: false, allowUnboundThis: true }
|
|
187
392
|
],
|
|
393
|
+
"prefer-const": [
|
|
394
|
+
"warn",
|
|
395
|
+
{ destructuring: "all", ignoreReadBeforeAssign: true }
|
|
396
|
+
],
|
|
397
|
+
"prefer-exponentiation-operator": "error",
|
|
188
398
|
"object-shorthand": [
|
|
189
399
|
"error",
|
|
190
400
|
"always",
|
|
191
401
|
{ ignoreConstructors: false, avoidQuotes: true }
|
|
192
402
|
],
|
|
403
|
+
"prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
|
|
193
404
|
"prefer-rest-params": "error",
|
|
194
405
|
"prefer-spread": "error",
|
|
195
406
|
"prefer-template": "error",
|
|
@@ -198,10 +409,7 @@ var js = [
|
|
|
198
409
|
"block-scoped-var": "error",
|
|
199
410
|
eqeqeq: ["error", "smart"],
|
|
200
411
|
"no-alert": "warn",
|
|
201
|
-
"no-case-declarations": "error",
|
|
202
|
-
"no-fallthrough": ["warn", { commentPattern: "break[\\s\\w]*omitted" }],
|
|
203
412
|
"no-multi-str": "error",
|
|
204
|
-
"no-with": "error",
|
|
205
413
|
"no-void": "error",
|
|
206
414
|
"no-duplicate-imports": "error",
|
|
207
415
|
"no-unused-expressions": [
|
|
@@ -213,7 +421,9 @@ var js = [
|
|
|
213
421
|
}
|
|
214
422
|
],
|
|
215
423
|
"no-lonely-if": "error",
|
|
216
|
-
"
|
|
424
|
+
"wrap-iife": ["error", "any", { functionPrototypeMethods: true }],
|
|
425
|
+
"vars-on-top": "error",
|
|
426
|
+
"unicode-bom": ["error", "never"],
|
|
217
427
|
"unused-imports/no-unused-imports": isInEditor ? "off" : "error",
|
|
218
428
|
"unused-imports/no-unused-vars": [
|
|
219
429
|
"error",
|
|
@@ -234,165 +444,94 @@ var js = [
|
|
|
234
444
|
}
|
|
235
445
|
}
|
|
236
446
|
];
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
languageOptions: {
|
|
241
|
-
parserOptions: {
|
|
242
|
-
ecmaFeatures: {
|
|
243
|
-
jsx: true
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
];
|
|
249
|
-
var imports = [
|
|
447
|
+
|
|
448
|
+
// src/configs/jsonc.ts
|
|
449
|
+
var jsonc = [
|
|
250
450
|
{
|
|
451
|
+
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
251
452
|
plugins: {
|
|
252
|
-
|
|
253
|
-
antfu: import_eslint_plugin_antfu.default
|
|
254
|
-
},
|
|
255
|
-
settings: {
|
|
256
|
-
"import/resolver": {
|
|
257
|
-
node: { extensions: [".js", ".mjs", ".ts", ".mts", ".d.ts"] }
|
|
258
|
-
}
|
|
453
|
+
jsonc: pluginJsonc
|
|
259
454
|
},
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
"import/no-mutable-exports": "error",
|
|
263
|
-
"import/no-duplicates": "error",
|
|
264
|
-
"import/order": [
|
|
265
|
-
"error",
|
|
266
|
-
{
|
|
267
|
-
groups: [
|
|
268
|
-
"builtin",
|
|
269
|
-
"external",
|
|
270
|
-
"internal",
|
|
271
|
-
"parent",
|
|
272
|
-
"sibling",
|
|
273
|
-
"index",
|
|
274
|
-
"object",
|
|
275
|
-
"type"
|
|
276
|
-
],
|
|
277
|
-
pathGroups: [{ pattern: "@/**", group: "internal" }],
|
|
278
|
-
pathGroupsExcludedImportTypes: ["type"]
|
|
279
|
-
}
|
|
280
|
-
],
|
|
281
|
-
"import/no-default-export": "error",
|
|
282
|
-
"antfu/import-dedupe": "error",
|
|
283
|
-
"antfu/prefer-inline-type-import": "error"
|
|
284
|
-
}
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
files: [
|
|
288
|
-
`**/*config*.${GLOB_SRC_EXT}`,
|
|
289
|
-
`**/views/${GLOB_SRC}`,
|
|
290
|
-
`**/pages/${GLOB_SRC}`,
|
|
291
|
-
`**/{index,vite,esbuild,rollup,webpack,rspack}.ts`,
|
|
292
|
-
"**/*.d.ts",
|
|
293
|
-
`${GLOB_MARKDOWN}/**`
|
|
294
|
-
],
|
|
295
|
-
plugins: {
|
|
296
|
-
import: import_eslint_plugin_import.default
|
|
455
|
+
languageOptions: {
|
|
456
|
+
parser: parserJsonc
|
|
297
457
|
},
|
|
298
458
|
rules: {
|
|
299
|
-
"
|
|
459
|
+
...pluginJsonc.configs["recommended-with-jsonc"].rules,
|
|
460
|
+
"jsonc/quote-props": "off",
|
|
461
|
+
"jsonc/quotes": "off"
|
|
300
462
|
}
|
|
301
463
|
}
|
|
302
464
|
];
|
|
303
|
-
|
|
465
|
+
|
|
466
|
+
// src/configs/markdown.ts
|
|
467
|
+
var markdown = [
|
|
304
468
|
{
|
|
469
|
+
files: [GLOB_MARKDOWN],
|
|
305
470
|
plugins: {
|
|
306
|
-
|
|
471
|
+
markdown: pluginMarkdown
|
|
307
472
|
},
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
"error",
|
|
317
|
-
{
|
|
318
|
-
cases: { kebabCase: true, pascalCase: true },
|
|
319
|
-
ignore: [/^[A-Z]+\..*$/]
|
|
473
|
+
processor: "markdown/markdown"
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
|
|
477
|
+
languageOptions: {
|
|
478
|
+
parserOptions: {
|
|
479
|
+
ecmaFeatures: {
|
|
480
|
+
impliedStrict: true
|
|
320
481
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
"
|
|
326
|
-
"
|
|
327
|
-
"
|
|
328
|
-
"
|
|
329
|
-
"
|
|
330
|
-
"
|
|
331
|
-
"
|
|
332
|
-
"
|
|
333
|
-
"
|
|
334
|
-
"
|
|
335
|
-
"
|
|
336
|
-
"
|
|
337
|
-
"
|
|
338
|
-
"
|
|
339
|
-
"
|
|
340
|
-
"
|
|
341
|
-
"
|
|
342
|
-
"unicorn/prefer-at": "error",
|
|
343
|
-
"unicorn/prefer-blob-reading-methods": "error",
|
|
344
|
-
"unicorn/prefer-date-now": "error",
|
|
345
|
-
"unicorn/prefer-dom-node-append": "error",
|
|
346
|
-
"unicorn/prefer-dom-node-dataset": "error",
|
|
347
|
-
"unicorn/prefer-dom-node-remove": "error",
|
|
348
|
-
"unicorn/prefer-dom-node-text-content": "error",
|
|
349
|
-
"unicorn/prefer-includes": "error",
|
|
350
|
-
"unicorn/prefer-keyboard-event-key": "error",
|
|
351
|
-
"unicorn/prefer-math-trunc": "error",
|
|
352
|
-
"unicorn/prefer-modern-dom-apis": "error",
|
|
353
|
-
"unicorn/prefer-modern-math-apis": "error",
|
|
354
|
-
"unicorn/prefer-negative-index": "error",
|
|
355
|
-
"unicorn/prefer-node-protocol": "error",
|
|
356
|
-
"unicorn/prefer-number-properties": "error",
|
|
357
|
-
"unicorn/prefer-optional-catch-binding": "error",
|
|
358
|
-
"unicorn/prefer-prototype-methods": "error",
|
|
359
|
-
"unicorn/prefer-query-selector": "error",
|
|
360
|
-
"unicorn/prefer-reflect-apply": "error",
|
|
361
|
-
"unicorn/prefer-regexp-test": "error",
|
|
362
|
-
"unicorn/prefer-string-replace-all": "error",
|
|
363
|
-
"unicorn/prefer-string-slice": "error",
|
|
364
|
-
"unicorn/prefer-string-starts-ends-with": "error",
|
|
365
|
-
"unicorn/prefer-string-trim-start-end": "error",
|
|
366
|
-
"unicorn/prefer-top-level-await": "error",
|
|
367
|
-
"unicorn/prefer-type-error": "error",
|
|
368
|
-
"unicorn/throw-new-error": "error"
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
rules: {
|
|
485
|
+
...pluginMarkdown.configs.recommended.overrides[1].rules,
|
|
486
|
+
"@typescript-eslint/comma-dangle": "off",
|
|
487
|
+
"@typescript-eslint/consistent-type-imports": "off",
|
|
488
|
+
"@typescript-eslint/no-namespace": "off",
|
|
489
|
+
"@typescript-eslint/no-redeclare": "off",
|
|
490
|
+
"@typescript-eslint/no-require-imports": "off",
|
|
491
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
492
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
493
|
+
"@typescript-eslint/no-var-requires": "off",
|
|
494
|
+
"@typescript-eslint/no-extraneous-class": "off",
|
|
495
|
+
"no-alert": "off",
|
|
496
|
+
"no-console": "off",
|
|
497
|
+
"no-restricted-imports": "off",
|
|
498
|
+
"no-undef": "off",
|
|
499
|
+
"no-unused-expressions": "off",
|
|
500
|
+
"no-unused-vars": "off",
|
|
501
|
+
"unused-imports/no-unused-vars": "off",
|
|
502
|
+
"unused-imports/no-unused-imports": "off"
|
|
369
503
|
}
|
|
370
504
|
}
|
|
371
505
|
];
|
|
372
506
|
|
|
373
|
-
// src/
|
|
374
|
-
var
|
|
375
|
-
|
|
376
|
-
var
|
|
507
|
+
// src/configs/prettier.ts
|
|
508
|
+
var prettierConflictRules = { ...configPrettier.rules };
|
|
509
|
+
delete prettierConflictRules["vue/html-self-closing"];
|
|
510
|
+
var prettier = [
|
|
377
511
|
{
|
|
378
|
-
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
379
512
|
plugins: {
|
|
380
|
-
|
|
381
|
-
},
|
|
382
|
-
languageOptions: {
|
|
383
|
-
parser: import_jsonc_eslint_parser.default
|
|
513
|
+
prettier: pluginPrettier
|
|
384
514
|
},
|
|
385
515
|
rules: {
|
|
386
|
-
...
|
|
387
|
-
|
|
388
|
-
"
|
|
516
|
+
...prettierConflictRules,
|
|
517
|
+
...pluginPrettier.configs.recommended.rules,
|
|
518
|
+
"prettier/prettier": "warn"
|
|
389
519
|
}
|
|
390
520
|
}
|
|
391
521
|
];
|
|
392
|
-
|
|
522
|
+
|
|
523
|
+
// src/configs/sort.ts
|
|
524
|
+
var sortPackageJson = [
|
|
393
525
|
{
|
|
394
526
|
files: ["**/package.json"],
|
|
395
527
|
rules: {
|
|
528
|
+
"jsonc/sort-array-values": [
|
|
529
|
+
"error",
|
|
530
|
+
{
|
|
531
|
+
pathPattern: "^files$",
|
|
532
|
+
order: { type: "asc" }
|
|
533
|
+
}
|
|
534
|
+
],
|
|
396
535
|
"jsonc/sort-keys": [
|
|
397
536
|
"error",
|
|
398
537
|
{
|
|
@@ -449,100 +588,168 @@ var pkgOrder = [
|
|
|
449
588
|
{
|
|
450
589
|
pathPattern: "^exports.*$",
|
|
451
590
|
order: ["types", "require", "import", "default"]
|
|
452
|
-
}
|
|
453
|
-
],
|
|
454
|
-
"jsonc/sort-array-values": [
|
|
455
|
-
"error",
|
|
591
|
+
},
|
|
456
592
|
{
|
|
457
|
-
|
|
458
|
-
|
|
593
|
+
order: { type: "asc" },
|
|
594
|
+
pathPattern: "^resolutions$"
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
order: { type: "asc" },
|
|
598
|
+
pathPattern: "^pnpm.overrides$"
|
|
459
599
|
}
|
|
460
600
|
]
|
|
461
601
|
}
|
|
462
602
|
}
|
|
463
603
|
];
|
|
464
|
-
|
|
465
|
-
// src/markdown.js
|
|
466
|
-
var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1);
|
|
467
|
-
var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
|
|
468
|
-
var markdown = [
|
|
469
|
-
{
|
|
470
|
-
files: [GLOB_MARKDOWN],
|
|
471
|
-
plugins: {
|
|
472
|
-
markdown: import_eslint_plugin_markdown.default
|
|
473
|
-
},
|
|
474
|
-
processor: "markdown/markdown"
|
|
475
|
-
},
|
|
476
|
-
{
|
|
477
|
-
files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
|
|
478
|
-
languageOptions: {
|
|
479
|
-
parserOptions: {
|
|
480
|
-
ecmaFeatures: {
|
|
481
|
-
impliedStrict: true
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
},
|
|
485
|
-
plugins: {
|
|
486
|
-
"@typescript-eslint": import_eslint_plugin.default
|
|
487
|
-
},
|
|
488
|
-
rules: {
|
|
489
|
-
...import_eslint_plugin_markdown.default.configs.recommended.overrides[1].rules,
|
|
490
|
-
"@typescript-eslint/no-redeclare": "off",
|
|
491
|
-
"@typescript-eslint/no-unused-vars": "off",
|
|
492
|
-
"@typescript-eslint/no-use-before-define": "off",
|
|
493
|
-
"@typescript-eslint/no-var-requires": "off",
|
|
494
|
-
"@typescript-eslint/no-extraneous-class": "off",
|
|
495
|
-
"no-alert": "off",
|
|
496
|
-
"no-console": "off",
|
|
497
|
-
"no-restricted-imports": "off",
|
|
498
|
-
"no-undef": "off",
|
|
499
|
-
"no-unused-expressions": "off",
|
|
500
|
-
"no-unused-vars": "off",
|
|
501
|
-
"unused-imports/no-unused-vars": "off",
|
|
502
|
-
"unused-imports/no-unused-imports": "off"
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
];
|
|
506
|
-
|
|
507
|
-
// src/prettier.js
|
|
508
|
-
var import_eslint_plugin_prettier = __toESM(require("eslint-plugin-prettier"), 1);
|
|
509
|
-
var import_eslint_config_prettier = __toESM(require("eslint-config-prettier"), 1);
|
|
510
|
-
var prettierConflictRules = { ...import_eslint_config_prettier.default.rules };
|
|
511
|
-
delete prettierConflictRules["vue/html-self-closing"];
|
|
512
|
-
var prettier = [
|
|
604
|
+
var sortTsconfig = [
|
|
513
605
|
{
|
|
514
|
-
|
|
515
|
-
prettier: import_eslint_plugin_prettier.default
|
|
516
|
-
},
|
|
606
|
+
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
517
607
|
rules: {
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
608
|
+
"jsonc/sort-keys": [
|
|
609
|
+
"error",
|
|
610
|
+
{
|
|
611
|
+
order: [
|
|
612
|
+
"extends",
|
|
613
|
+
"compilerOptions",
|
|
614
|
+
"references",
|
|
615
|
+
"files",
|
|
616
|
+
"include",
|
|
617
|
+
"exclude"
|
|
618
|
+
],
|
|
619
|
+
pathPattern: "^$"
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
order: [
|
|
623
|
+
/* Projects */
|
|
624
|
+
"incremental",
|
|
625
|
+
"composite",
|
|
626
|
+
"tsBuildInfoFile",
|
|
627
|
+
"disableSourceOfProjectReferenceRedirect",
|
|
628
|
+
"disableSolutionSearching",
|
|
629
|
+
"disableReferencedProjectLoad",
|
|
630
|
+
/* Language and Environment */
|
|
631
|
+
"target",
|
|
632
|
+
"lib",
|
|
633
|
+
"jsx",
|
|
634
|
+
"experimentalDecorators",
|
|
635
|
+
"emitDecoratorMetadata",
|
|
636
|
+
"jsxFactory",
|
|
637
|
+
"jsxFragmentFactory",
|
|
638
|
+
"jsxImportSource",
|
|
639
|
+
"reactNamespace",
|
|
640
|
+
"noLib",
|
|
641
|
+
"useDefineForClassFields",
|
|
642
|
+
"moduleDetection",
|
|
643
|
+
/* Modules */
|
|
644
|
+
"module",
|
|
645
|
+
"rootDir",
|
|
646
|
+
"moduleResolution",
|
|
647
|
+
"baseUrl",
|
|
648
|
+
"paths",
|
|
649
|
+
"rootDirs",
|
|
650
|
+
"typeRoots",
|
|
651
|
+
"types",
|
|
652
|
+
"allowUmdGlobalAccess",
|
|
653
|
+
"moduleSuffixes",
|
|
654
|
+
"allowImportingTsExtensions",
|
|
655
|
+
"resolvePackageJsonExports",
|
|
656
|
+
"resolvePackageJsonImports",
|
|
657
|
+
"customConditions",
|
|
658
|
+
"resolveJsonModule",
|
|
659
|
+
"allowArbitraryExtensions",
|
|
660
|
+
"noResolve",
|
|
661
|
+
/* JavaScript Support */
|
|
662
|
+
"allowJs",
|
|
663
|
+
"checkJs",
|
|
664
|
+
"maxNodeModuleJsDepth",
|
|
665
|
+
/* Emit */
|
|
666
|
+
"declaration",
|
|
667
|
+
"declarationMap",
|
|
668
|
+
"emitDeclarationOnly",
|
|
669
|
+
"sourceMap",
|
|
670
|
+
"inlineSourceMap",
|
|
671
|
+
"outFile",
|
|
672
|
+
"outDir",
|
|
673
|
+
"removeComments",
|
|
674
|
+
"noEmit",
|
|
675
|
+
"importHelpers",
|
|
676
|
+
"importsNotUsedAsValues",
|
|
677
|
+
"downlevelIteration",
|
|
678
|
+
"sourceRoot",
|
|
679
|
+
"mapRoot",
|
|
680
|
+
"inlineSources",
|
|
681
|
+
"emitBOM",
|
|
682
|
+
"newLine",
|
|
683
|
+
"stripInternal",
|
|
684
|
+
"noEmitHelpers",
|
|
685
|
+
"noEmitOnError",
|
|
686
|
+
"preserveConstEnums",
|
|
687
|
+
"declarationDir",
|
|
688
|
+
"preserveValueImports",
|
|
689
|
+
/* Interop Constraints */
|
|
690
|
+
"isolatedModules",
|
|
691
|
+
"verbatimModuleSyntax",
|
|
692
|
+
"allowSyntheticDefaultImports",
|
|
693
|
+
"esModuleInterop",
|
|
694
|
+
"preserveSymlinks",
|
|
695
|
+
"forceConsistentCasingInFileNames",
|
|
696
|
+
/* Type Checking */
|
|
697
|
+
"strict",
|
|
698
|
+
"strictBindCallApply",
|
|
699
|
+
"strictFunctionTypes",
|
|
700
|
+
"strictNullChecks",
|
|
701
|
+
"strictPropertyInitialization",
|
|
702
|
+
"allowUnreachableCode",
|
|
703
|
+
"allowUnusedLabels",
|
|
704
|
+
"alwaysStrict",
|
|
705
|
+
"exactOptionalPropertyTypes",
|
|
706
|
+
"noFallthroughCasesInSwitch",
|
|
707
|
+
"noImplicitAny",
|
|
708
|
+
"noImplicitOverride",
|
|
709
|
+
"noImplicitReturns",
|
|
710
|
+
"noImplicitThis",
|
|
711
|
+
"noPropertyAccessFromIndexSignature",
|
|
712
|
+
"noUncheckedIndexedAccess",
|
|
713
|
+
"noUnusedLocals",
|
|
714
|
+
"noUnusedParameters",
|
|
715
|
+
"useUnknownInCatchVariables",
|
|
716
|
+
/* Completeness */
|
|
717
|
+
"skipDefaultLibCheck",
|
|
718
|
+
"skipLibCheck"
|
|
719
|
+
],
|
|
720
|
+
pathPattern: "^compilerOptions$"
|
|
721
|
+
}
|
|
722
|
+
]
|
|
521
723
|
}
|
|
522
724
|
}
|
|
523
725
|
];
|
|
524
726
|
|
|
525
|
-
// src/typescript.
|
|
526
|
-
var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
|
|
527
|
-
var import_eslint_plugin2 = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
|
|
727
|
+
// src/configs/typescript.ts
|
|
528
728
|
var typescript = [
|
|
529
729
|
{
|
|
530
730
|
files: [GLOB_TS, GLOB_TSX],
|
|
531
731
|
languageOptions: {
|
|
532
|
-
parser:
|
|
732
|
+
parser: parserTypeScript,
|
|
533
733
|
parserOptions: {
|
|
534
734
|
sourceType: "module"
|
|
535
735
|
}
|
|
536
736
|
},
|
|
537
737
|
plugins: {
|
|
538
|
-
"@typescript-eslint":
|
|
738
|
+
"@typescript-eslint": pluginTypeScript
|
|
539
739
|
},
|
|
540
740
|
rules: {
|
|
541
|
-
...
|
|
542
|
-
...
|
|
741
|
+
...pluginTypeScript.configs["eslint-recommended"].overrides[0].rules,
|
|
742
|
+
...pluginTypeScript.configs.strict.rules,
|
|
543
743
|
"@typescript-eslint/no-redeclare": "error",
|
|
544
744
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
545
745
|
"@typescript-eslint/ban-types": "off",
|
|
746
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
747
|
+
"error",
|
|
748
|
+
{
|
|
749
|
+
assertionStyle: "as",
|
|
750
|
+
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
751
|
+
}
|
|
752
|
+
],
|
|
546
753
|
"@typescript-eslint/consistent-type-imports": [
|
|
547
754
|
"error",
|
|
548
755
|
{ fixStyle: "inline-type-imports", disallowTypeAnnotations: false }
|
|
@@ -557,7 +764,9 @@ var typescript = [
|
|
|
557
764
|
{
|
|
558
765
|
files: ["**/*.d.ts"],
|
|
559
766
|
rules: {
|
|
560
|
-
"
|
|
767
|
+
"eslint-comments/no-unlimited-disable": "off",
|
|
768
|
+
"import/no-duplicates": "off",
|
|
769
|
+
"unused-imports/no-unused-vars": "off"
|
|
561
770
|
}
|
|
562
771
|
},
|
|
563
772
|
{
|
|
@@ -569,31 +778,100 @@ var typescript = [
|
|
|
569
778
|
{
|
|
570
779
|
files: ["**/*.js", "**/*.cjs"],
|
|
571
780
|
rules: {
|
|
781
|
+
"@typescript-eslint/no-require-imports": "off",
|
|
572
782
|
"@typescript-eslint/no-var-requires": "off"
|
|
573
783
|
}
|
|
574
784
|
}
|
|
575
785
|
];
|
|
576
786
|
|
|
577
|
-
// src/
|
|
578
|
-
var
|
|
787
|
+
// src/configs/unicorn.ts
|
|
788
|
+
var unicorn = [
|
|
789
|
+
{
|
|
790
|
+
plugins: {
|
|
791
|
+
unicorn: pluginUnicorn
|
|
792
|
+
},
|
|
793
|
+
rules: {
|
|
794
|
+
"unicorn/better-regex": "error",
|
|
795
|
+
"unicorn/catch-error-name": "error",
|
|
796
|
+
"unicorn/custom-error-definition": "error",
|
|
797
|
+
"unicorn/error-message": "error",
|
|
798
|
+
"unicorn/escape-case": "error",
|
|
799
|
+
"unicorn/explicit-length-check": "error",
|
|
800
|
+
"unicorn/filename-case": [
|
|
801
|
+
"error",
|
|
802
|
+
{
|
|
803
|
+
cases: { kebabCase: true, pascalCase: true },
|
|
804
|
+
ignore: [/^[A-Z]+\..*$/]
|
|
805
|
+
}
|
|
806
|
+
],
|
|
807
|
+
"unicorn/new-for-builtins": "error",
|
|
808
|
+
"unicorn/no-array-callback-reference": "error",
|
|
809
|
+
"unicorn/no-array-method-this-argument": "error",
|
|
810
|
+
"unicorn/no-array-push-push": "error",
|
|
811
|
+
"unicorn/no-console-spaces": "error",
|
|
812
|
+
"unicorn/no-for-loop": "error",
|
|
813
|
+
"unicorn/no-hex-escape": "error",
|
|
814
|
+
"unicorn/no-instanceof-array": "error",
|
|
815
|
+
"unicorn/no-invalid-remove-event-listener": "error",
|
|
816
|
+
"unicorn/no-lonely-if": "error",
|
|
817
|
+
"unicorn/no-new-array": "error",
|
|
818
|
+
"unicorn/no-new-buffer": "error",
|
|
819
|
+
"unicorn/no-static-only-class": "error",
|
|
820
|
+
"unicorn/no-unnecessary-await": "error",
|
|
821
|
+
"unicorn/no-zero-fractions": `error`,
|
|
822
|
+
"unicorn/prefer-add-event-listener": "error",
|
|
823
|
+
"unicorn/prefer-array-find": "error",
|
|
824
|
+
"unicorn/prefer-array-flat-map": "error",
|
|
825
|
+
"unicorn/prefer-array-index-of": "error",
|
|
826
|
+
"unicorn/prefer-array-some": "error",
|
|
827
|
+
"unicorn/prefer-at": "error",
|
|
828
|
+
"unicorn/prefer-blob-reading-methods": "error",
|
|
829
|
+
"unicorn/prefer-date-now": "error",
|
|
830
|
+
"unicorn/prefer-dom-node-append": "error",
|
|
831
|
+
"unicorn/prefer-dom-node-dataset": "error",
|
|
832
|
+
"unicorn/prefer-dom-node-remove": "error",
|
|
833
|
+
"unicorn/prefer-dom-node-text-content": "error",
|
|
834
|
+
"unicorn/prefer-includes": "error",
|
|
835
|
+
"unicorn/prefer-keyboard-event-key": "error",
|
|
836
|
+
"unicorn/prefer-math-trunc": "error",
|
|
837
|
+
"unicorn/prefer-modern-dom-apis": "error",
|
|
838
|
+
"unicorn/prefer-modern-math-apis": "error",
|
|
839
|
+
"unicorn/prefer-negative-index": "error",
|
|
840
|
+
"unicorn/prefer-node-protocol": "error",
|
|
841
|
+
"unicorn/prefer-number-properties": "error",
|
|
842
|
+
"unicorn/prefer-optional-catch-binding": "error",
|
|
843
|
+
"unicorn/prefer-prototype-methods": "error",
|
|
844
|
+
"unicorn/prefer-query-selector": "error",
|
|
845
|
+
"unicorn/prefer-reflect-apply": "error",
|
|
846
|
+
"unicorn/prefer-regexp-test": "error",
|
|
847
|
+
"unicorn/prefer-string-replace-all": "error",
|
|
848
|
+
"unicorn/prefer-string-slice": "error",
|
|
849
|
+
"unicorn/prefer-string-starts-ends-with": "error",
|
|
850
|
+
"unicorn/prefer-string-trim-start-end": "error",
|
|
851
|
+
"unicorn/prefer-top-level-await": "error",
|
|
852
|
+
"unicorn/prefer-type-error": "error",
|
|
853
|
+
"unicorn/throw-new-error": "error"
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
];
|
|
857
|
+
|
|
858
|
+
// src/configs/unocss.ts
|
|
579
859
|
var unocss = [
|
|
580
860
|
{
|
|
581
861
|
plugins: {
|
|
582
|
-
"@unocss":
|
|
862
|
+
"@unocss": pluginUnocss
|
|
583
863
|
},
|
|
584
864
|
rules: {
|
|
585
|
-
...
|
|
865
|
+
...pluginUnocss.configs.recommended.rules
|
|
586
866
|
}
|
|
587
867
|
}
|
|
588
868
|
];
|
|
589
869
|
|
|
590
|
-
// src/vue.
|
|
591
|
-
var
|
|
592
|
-
var
|
|
593
|
-
var import_eslint_plugin_vue = __toESM(require("eslint-plugin-vue"), 1);
|
|
594
|
-
var import_eslint_plugin4 = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
|
|
870
|
+
// src/configs/vue.ts
|
|
871
|
+
var import_local_pkg2 = require("local-pkg");
|
|
872
|
+
var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
|
|
595
873
|
function getVueVersion() {
|
|
596
|
-
const pkg = (0,
|
|
874
|
+
const pkg = (0, import_local_pkg2.getPackageInfoSync)("vue", { paths: [process.cwd()] });
|
|
597
875
|
if (pkg && typeof pkg.version === "string" && !Number.isNaN(+pkg.version[0])) {
|
|
598
876
|
return +pkg.version[0];
|
|
599
877
|
}
|
|
@@ -614,7 +892,7 @@ var reactivityTransform = [
|
|
|
614
892
|
}
|
|
615
893
|
},
|
|
616
894
|
plugins: {
|
|
617
|
-
vue:
|
|
895
|
+
vue: pluginVue
|
|
618
896
|
},
|
|
619
897
|
rules: {
|
|
620
898
|
"vue/no-setup-props-reactivity-loss": "off"
|
|
@@ -659,26 +937,26 @@ var vueCustomRules = {
|
|
|
659
937
|
"vue/no-empty-pattern": "error"
|
|
660
938
|
};
|
|
661
939
|
var vue3Rules = {
|
|
662
|
-
...
|
|
663
|
-
...
|
|
664
|
-
...
|
|
665
|
-
...
|
|
940
|
+
...pluginVue.configs.base.rules,
|
|
941
|
+
...pluginVue.configs["vue3-essential"].rules,
|
|
942
|
+
...pluginVue.configs["vue3-strongly-recommended"].rules,
|
|
943
|
+
...pluginVue.configs["vue3-recommended"].rules
|
|
666
944
|
};
|
|
667
945
|
var vue2Rules = {
|
|
668
|
-
...
|
|
669
|
-
...
|
|
670
|
-
...
|
|
671
|
-
...
|
|
946
|
+
...pluginVue.configs.base.rules,
|
|
947
|
+
...pluginVue.configs.essential.rules,
|
|
948
|
+
...pluginVue.configs["strongly-recommended"].rules,
|
|
949
|
+
...pluginVue.configs.recommended.rules
|
|
672
950
|
};
|
|
673
951
|
var vue = [
|
|
674
952
|
{
|
|
675
953
|
files: [GLOB_VUE],
|
|
676
954
|
plugins: {
|
|
677
|
-
vue:
|
|
678
|
-
"@typescript-eslint":
|
|
955
|
+
vue: pluginVue,
|
|
956
|
+
"@typescript-eslint": import_eslint_plugin.default
|
|
679
957
|
},
|
|
680
958
|
languageOptions: {
|
|
681
|
-
parser:
|
|
959
|
+
parser: parserVue,
|
|
682
960
|
parserOptions: {
|
|
683
961
|
parser: "@typescript-eslint/parser",
|
|
684
962
|
sourceType: "module",
|
|
@@ -688,14 +966,14 @@ var vue = [
|
|
|
688
966
|
}
|
|
689
967
|
}
|
|
690
968
|
},
|
|
691
|
-
processor:
|
|
969
|
+
processor: pluginVue.processors[".vue"],
|
|
692
970
|
rules: {
|
|
693
971
|
...typescript[0].rules
|
|
694
972
|
}
|
|
695
973
|
},
|
|
696
974
|
{
|
|
697
975
|
plugins: {
|
|
698
|
-
vue:
|
|
976
|
+
vue: pluginVue
|
|
699
977
|
},
|
|
700
978
|
rules: {
|
|
701
979
|
...isVue3 ? vue3Rules : vue2Rules,
|
|
@@ -705,39 +983,43 @@ var vue = [
|
|
|
705
983
|
...reactivityTransform
|
|
706
984
|
];
|
|
707
985
|
|
|
708
|
-
// src/yml.
|
|
709
|
-
var import_eslint_plugin_yml = __toESM(require("eslint-plugin-yml"), 1);
|
|
710
|
-
var import_yaml_eslint_parser = __toESM(require("yaml-eslint-parser"), 1);
|
|
986
|
+
// src/configs/yml.ts
|
|
711
987
|
var yml = [
|
|
712
988
|
{
|
|
713
989
|
files: [GLOB_YAML],
|
|
714
990
|
plugins: {
|
|
715
|
-
yml:
|
|
991
|
+
yml: pluginYml
|
|
716
992
|
},
|
|
717
993
|
languageOptions: {
|
|
718
|
-
parser:
|
|
994
|
+
parser: parserYml
|
|
719
995
|
},
|
|
720
996
|
rules: {
|
|
721
|
-
...
|
|
722
|
-
...
|
|
997
|
+
...pluginYml.configs.standard.rules,
|
|
998
|
+
...pluginYml.configs.prettier.rules,
|
|
723
999
|
"yml/no-empty-mapping-value": "off"
|
|
724
1000
|
}
|
|
725
1001
|
}
|
|
726
1002
|
];
|
|
727
1003
|
|
|
728
|
-
// src/presets.
|
|
729
|
-
var
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
...
|
|
733
|
-
...jsx,
|
|
734
|
-
...typescript,
|
|
1004
|
+
// src/presets.ts
|
|
1005
|
+
var presetJavaScript = [
|
|
1006
|
+
...ignores,
|
|
1007
|
+
...javascript,
|
|
1008
|
+
...comments,
|
|
735
1009
|
...imports,
|
|
736
|
-
...unicorn
|
|
737
|
-
|
|
738
|
-
|
|
1010
|
+
...unicorn
|
|
1011
|
+
];
|
|
1012
|
+
var presetLangsExtensions = [
|
|
1013
|
+
...markdown,
|
|
739
1014
|
...yml,
|
|
740
|
-
...
|
|
1015
|
+
...jsonc,
|
|
1016
|
+
...sortPackageJson,
|
|
1017
|
+
...sortTsconfig
|
|
1018
|
+
];
|
|
1019
|
+
var basic = [
|
|
1020
|
+
...presetJavaScript,
|
|
1021
|
+
...typescript,
|
|
1022
|
+
...presetLangsExtensions
|
|
741
1023
|
];
|
|
742
1024
|
var all = [...basic, ...vue, ...unocss, ...prettier];
|
|
743
1025
|
function sxzz(config = [], {
|
|
@@ -746,50 +1028,89 @@ function sxzz(config = [], {
|
|
|
746
1028
|
markdown: enableMarkdown = true,
|
|
747
1029
|
unocss: enableUnocss = false
|
|
748
1030
|
} = {}) {
|
|
749
|
-
const
|
|
750
|
-
|
|
1031
|
+
const configs = [];
|
|
1032
|
+
configs.push(...basic);
|
|
751
1033
|
if (enableVue) {
|
|
752
|
-
|
|
1034
|
+
configs.push(...vue);
|
|
753
1035
|
}
|
|
754
1036
|
if (enableMarkdown) {
|
|
755
|
-
|
|
1037
|
+
configs.push(...markdown);
|
|
756
1038
|
}
|
|
757
1039
|
if (enableUnocss) {
|
|
758
|
-
|
|
1040
|
+
configs.push(...unocss);
|
|
759
1041
|
}
|
|
760
1042
|
if (enablePrettier) {
|
|
761
|
-
|
|
1043
|
+
configs.push(...prettier);
|
|
762
1044
|
}
|
|
763
1045
|
if (Object.keys(config).length > 0) {
|
|
764
|
-
|
|
1046
|
+
configs.push(...Array.isArray(config) ? config : [config]);
|
|
765
1047
|
}
|
|
766
|
-
return
|
|
1048
|
+
return configs;
|
|
767
1049
|
}
|
|
768
1050
|
// Annotate the CommonJS export names for ESM import in node:
|
|
769
1051
|
0 && (module.exports = {
|
|
1052
|
+
GLOB_ALL_SRC,
|
|
1053
|
+
GLOB_CSS,
|
|
1054
|
+
GLOB_DIST,
|
|
1055
|
+
GLOB_EXCLUDE,
|
|
1056
|
+
GLOB_HTML,
|
|
1057
|
+
GLOB_JS,
|
|
1058
|
+
GLOB_JSON,
|
|
1059
|
+
GLOB_JSON5,
|
|
1060
|
+
GLOB_JSONC,
|
|
1061
|
+
GLOB_JSX,
|
|
1062
|
+
GLOB_LESS,
|
|
1063
|
+
GLOB_LOCKFILE,
|
|
1064
|
+
GLOB_MARKDOWN,
|
|
1065
|
+
GLOB_NODE_MODULES,
|
|
1066
|
+
GLOB_SCSS,
|
|
1067
|
+
GLOB_SRC,
|
|
1068
|
+
GLOB_SRC_EXT,
|
|
1069
|
+
GLOB_STYLE,
|
|
1070
|
+
GLOB_TS,
|
|
1071
|
+
GLOB_TSX,
|
|
1072
|
+
GLOB_VUE,
|
|
1073
|
+
GLOB_YAML,
|
|
770
1074
|
all,
|
|
771
|
-
antfuPlugin,
|
|
772
1075
|
basic,
|
|
773
|
-
|
|
1076
|
+
comments,
|
|
1077
|
+
configPrettier,
|
|
774
1078
|
getVueVersion,
|
|
775
|
-
|
|
1079
|
+
hasTypeScript,
|
|
1080
|
+
hasVue,
|
|
1081
|
+
ignores,
|
|
776
1082
|
imports,
|
|
777
|
-
|
|
1083
|
+
isInEditor,
|
|
1084
|
+
javascript,
|
|
778
1085
|
jsonc,
|
|
779
|
-
jsx,
|
|
780
1086
|
markdown,
|
|
781
|
-
|
|
1087
|
+
parserJsonc,
|
|
1088
|
+
parserTypeScript,
|
|
1089
|
+
parserVue,
|
|
1090
|
+
parserYml,
|
|
1091
|
+
pluginAntfu,
|
|
1092
|
+
pluginComments,
|
|
1093
|
+
pluginImport,
|
|
1094
|
+
pluginJsonc,
|
|
1095
|
+
pluginMarkdown,
|
|
1096
|
+
pluginPrettier,
|
|
1097
|
+
pluginTypeScript,
|
|
1098
|
+
pluginUnicorn,
|
|
1099
|
+
pluginUnocss,
|
|
1100
|
+
pluginUnusedImports,
|
|
1101
|
+
pluginVue,
|
|
1102
|
+
pluginYml,
|
|
1103
|
+
presetBasic,
|
|
1104
|
+
presetJavaScript,
|
|
1105
|
+
presetLangsExtensions,
|
|
782
1106
|
prettier,
|
|
783
1107
|
reactivityTransform,
|
|
1108
|
+
sortPackageJson,
|
|
1109
|
+
sortTsconfig,
|
|
784
1110
|
sxzz,
|
|
785
|
-
tsParser,
|
|
786
|
-
tsPlugin,
|
|
787
1111
|
typescript,
|
|
788
1112
|
unicorn,
|
|
789
|
-
unicornPlugin,
|
|
790
1113
|
unocss,
|
|
791
1114
|
vue,
|
|
792
|
-
vueParser,
|
|
793
|
-
vuePlugin,
|
|
794
1115
|
yml
|
|
795
1116
|
});
|