@ntnyq/eslint-config 2.0.0-beta.26 → 2.0.0-beta.28
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 +363 -126
- package/dist/index.d.cts +39 -16
- package/dist/index.d.ts +39 -16
- package/dist/index.js +346 -116
- package/package.json +6 -7
package/dist/index.cjs
CHANGED
|
@@ -5,9 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target,
|
|
9
|
-
for (var name in
|
|
10
|
-
__defProp(target, name, { get:
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
11
|
};
|
|
12
12
|
var __copyProps = (to, from, except, desc) => {
|
|
13
13
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -52,13 +52,14 @@ __export(src_exports, {
|
|
|
52
52
|
GLOB_TSX: () => GLOB_TSX,
|
|
53
53
|
GLOB_VUE: () => GLOB_VUE,
|
|
54
54
|
GLOB_YAML: () => GLOB_YAML,
|
|
55
|
-
all: () => all,
|
|
56
|
-
basic: () => basic,
|
|
57
55
|
comments: () => comments,
|
|
58
|
-
common: () => common,
|
|
59
56
|
getVueVersion: () => getVueVersion,
|
|
57
|
+
hasTypeScript: () => hasTypeScript,
|
|
58
|
+
hasUnoCSS: () => hasUnoCSS,
|
|
59
|
+
hasVue: () => hasVue,
|
|
60
60
|
ignores: () => ignores,
|
|
61
61
|
imports: () => imports,
|
|
62
|
+
interopDefault: () => interopDefault,
|
|
62
63
|
javascript: () => javascript,
|
|
63
64
|
jsonc: () => jsonc,
|
|
64
65
|
jsx: () => jsx,
|
|
@@ -66,24 +67,30 @@ __export(src_exports, {
|
|
|
66
67
|
node: () => node,
|
|
67
68
|
ntnyq: () => ntnyq,
|
|
68
69
|
parserJsonc: () => parserJsonc,
|
|
69
|
-
parserTs: () => parserTs,
|
|
70
70
|
parserVue: () => parserVue,
|
|
71
71
|
parserYaml: () => parserYaml,
|
|
72
72
|
pluginComments: () => import_eslint_plugin_eslint_comments.default,
|
|
73
|
-
pluginImport: () =>
|
|
73
|
+
pluginImport: () => import_eslint_plugin_import_x.default,
|
|
74
74
|
pluginJsonc: () => pluginJsonc,
|
|
75
75
|
pluginMarkdown: () => import_eslint_plugin_markdown.default,
|
|
76
76
|
pluginNode: () => import_eslint_plugin_n.default,
|
|
77
77
|
pluginPrettier: () => import_eslint_plugin_prettier.default,
|
|
78
|
-
pluginTs: () => import_eslint_plugin2.default,
|
|
79
78
|
pluginUnicorn: () => import_eslint_plugin_unicorn.default,
|
|
80
79
|
pluginUnoCSS: () => import_eslint_plugin.default,
|
|
81
80
|
pluginVue: () => import_eslint_plugin_vue.default,
|
|
82
|
-
pluginYaml: () =>
|
|
81
|
+
pluginYaml: () => import_eslint_plugin_yml.default,
|
|
82
|
+
presetAll: () => presetAll,
|
|
83
|
+
presetBasic: () => presetBasic,
|
|
84
|
+
presetCommon: () => presetCommon,
|
|
85
|
+
presetJavaScript: () => presetJavaScript,
|
|
86
|
+
presetJsonc: () => presetJsonc,
|
|
87
|
+
presetLanguageExtensions: () => presetLanguageExtensions,
|
|
83
88
|
prettier: () => prettier,
|
|
84
89
|
sortPackageJson: () => sortPackageJson,
|
|
85
90
|
sortTsConfig: () => sortTsConfig,
|
|
91
|
+
tseslint: () => import_typescript_eslint.default,
|
|
86
92
|
typescript: () => typescript,
|
|
93
|
+
typescriptCore: () => typescriptCore,
|
|
87
94
|
unicorn: () => unicorn,
|
|
88
95
|
unocss: () => unocss,
|
|
89
96
|
vue: () => vue,
|
|
@@ -91,7 +98,13 @@ __export(src_exports, {
|
|
|
91
98
|
});
|
|
92
99
|
module.exports = __toCommonJS(src_exports);
|
|
93
100
|
|
|
94
|
-
// src/
|
|
101
|
+
// src/env.ts
|
|
102
|
+
var import_local_pkg = require("local-pkg");
|
|
103
|
+
var hasTypeScript = (0, import_local_pkg.isPackageExists)("typescript");
|
|
104
|
+
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");
|
|
105
|
+
var hasUnoCSS = (0, import_local_pkg.isPackageExists)("unocss") || (0, import_local_pkg.isPackageExists)("@unocss/webpack") || (0, import_local_pkg.isPackageExists)("@unocss/nuxt");
|
|
106
|
+
|
|
107
|
+
// src/globs.ts
|
|
95
108
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
96
109
|
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
97
110
|
var GLOB_JS = "**/*.?([cm])js";
|
|
@@ -137,19 +150,30 @@ var GLOB_EXCLUDE = [
|
|
|
137
150
|
"**/__snapshots__",
|
|
138
151
|
"**/auto-import?(s).d.ts",
|
|
139
152
|
"**/components.d.ts",
|
|
140
|
-
"**/output",
|
|
141
153
|
"**/coverage",
|
|
154
|
+
"**/fixtures",
|
|
155
|
+
"**/output",
|
|
156
|
+
"**/public",
|
|
157
|
+
"**/static",
|
|
142
158
|
"**/temp",
|
|
143
159
|
"**/cache",
|
|
144
|
-
"**/fixtures",
|
|
145
160
|
"**/.vitepress/cache",
|
|
161
|
+
"**/.eslintcache",
|
|
162
|
+
"**/.stylelintcache",
|
|
163
|
+
"**/.vite-inspect",
|
|
146
164
|
"**/.nuxt",
|
|
147
165
|
"**/.output",
|
|
166
|
+
"**/.tsup",
|
|
148
167
|
"**/.nitro",
|
|
149
168
|
"**/.vercel",
|
|
150
169
|
"**/.changeset",
|
|
151
170
|
"**/.npmrc",
|
|
152
|
-
"**/.yarnrc"
|
|
171
|
+
"**/.yarnrc",
|
|
172
|
+
// Force lint
|
|
173
|
+
"!.github",
|
|
174
|
+
"!.vitepress",
|
|
175
|
+
"!.vuepress",
|
|
176
|
+
"!.vscode"
|
|
153
177
|
];
|
|
154
178
|
|
|
155
179
|
// src/presets.ts
|
|
@@ -157,7 +181,7 @@ var import_eslint_define_config15 = require("eslint-define-config");
|
|
|
157
181
|
|
|
158
182
|
// src/configs/vue.ts
|
|
159
183
|
var import_node_process = __toESM(require("process"), 1);
|
|
160
|
-
var
|
|
184
|
+
var import_local_pkg2 = require("local-pkg");
|
|
161
185
|
var import_eslint_define_config2 = require("eslint-define-config");
|
|
162
186
|
|
|
163
187
|
// src/plugins.ts
|
|
@@ -168,68 +192,68 @@ var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
|
168
192
|
var import_eslint_plugin_prettier = __toESM(require("eslint-plugin-prettier"), 1);
|
|
169
193
|
var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1);
|
|
170
194
|
var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
|
|
171
|
-
var
|
|
172
|
-
var
|
|
195
|
+
var import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
|
|
196
|
+
var import_eslint_plugin_yml = __toESM(require("eslint-plugin-yml"), 1);
|
|
173
197
|
var pluginJsonc = __toESM(require("eslint-plugin-jsonc"), 1);
|
|
174
|
-
var
|
|
198
|
+
var import_eslint_plugin_import_x = __toESM(require("eslint-plugin-import-x"), 1);
|
|
175
199
|
var parserYaml = __toESM(require("yaml-eslint-parser"), 1);
|
|
176
200
|
var parserVue = __toESM(require("vue-eslint-parser"), 1);
|
|
177
201
|
var parserJsonc = __toESM(require("jsonc-eslint-parser"), 1);
|
|
178
|
-
|
|
202
|
+
// @__NO_SIDE_EFFECTS__
|
|
203
|
+
function interopDefault(m) {
|
|
204
|
+
return m.default || m;
|
|
205
|
+
}
|
|
179
206
|
|
|
180
207
|
// src/configs/typescript.ts
|
|
181
208
|
var import_eslint_define_config = require("eslint-define-config");
|
|
182
|
-
var
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
plugins: {
|
|
192
|
-
"@typescript-eslint": import_eslint_plugin2.default
|
|
193
|
-
},
|
|
194
|
-
rules: {
|
|
195
|
-
...import_eslint_plugin2.default.configs.recommended.rules,
|
|
196
|
-
...import_eslint_plugin2.default.configs.stylistic.rules,
|
|
197
|
-
"@typescript-eslint/no-unused-vars": "error",
|
|
198
|
-
"@typescript-eslint/no-redeclare": "error",
|
|
199
|
-
"@typescript-eslint/consistent-type-imports": [
|
|
200
|
-
"error",
|
|
201
|
-
{
|
|
202
|
-
prefer: "type-imports",
|
|
203
|
-
fixStyle: "separate-type-imports",
|
|
204
|
-
disallowTypeAnnotations: false
|
|
205
|
-
}
|
|
206
|
-
],
|
|
207
|
-
"@typescript-eslint/consistent-type-assertions": [
|
|
208
|
-
"error",
|
|
209
|
-
{
|
|
210
|
-
assertionStyle: "as",
|
|
211
|
-
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
212
|
-
}
|
|
213
|
-
],
|
|
214
|
-
"@typescript-eslint/prefer-as-const": "warn",
|
|
215
|
-
"@typescript-eslint/ban-types": "off",
|
|
216
|
-
"@typescript-eslint/camelcase": "off",
|
|
217
|
-
"@typescript-eslint/no-namespace": "off",
|
|
218
|
-
"@typescript-eslint/ban-ts-ignore": "off",
|
|
219
|
-
"@typescript-eslint/ban-ts-comment": "off",
|
|
220
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
221
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
222
|
-
"@typescript-eslint/naming-convention": "off",
|
|
223
|
-
"@typescript-eslint/no-empty-interface": "off",
|
|
224
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
225
|
-
"@typescript-eslint/triple-slash-reference": "off",
|
|
226
|
-
"@typescript-eslint/no-parameter-properties": "off",
|
|
227
|
-
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
228
|
-
"@typescript-eslint/explicit-function-return-type": "off",
|
|
229
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
230
|
-
"@typescript-eslint/consistent-indexed-object-style": "off"
|
|
209
|
+
var typescriptCore = import_typescript_eslint.default.config({
|
|
210
|
+
extends: [...import_typescript_eslint.default.configs.recommended],
|
|
211
|
+
files: [GLOB_TS, GLOB_TSX],
|
|
212
|
+
languageOptions: {
|
|
213
|
+
parser: import_typescript_eslint.default.parser,
|
|
214
|
+
parserOptions: {
|
|
215
|
+
sourceType: "module"
|
|
231
216
|
}
|
|
232
217
|
},
|
|
218
|
+
rules: {
|
|
219
|
+
"@typescript-eslint/no-unused-vars": "error",
|
|
220
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
221
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
222
|
+
"error",
|
|
223
|
+
{
|
|
224
|
+
prefer: "type-imports",
|
|
225
|
+
fixStyle: "separate-type-imports",
|
|
226
|
+
disallowTypeAnnotations: false
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
230
|
+
"error",
|
|
231
|
+
{
|
|
232
|
+
assertionStyle: "as",
|
|
233
|
+
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
234
|
+
}
|
|
235
|
+
],
|
|
236
|
+
"@typescript-eslint/prefer-as-const": "warn",
|
|
237
|
+
"@typescript-eslint/ban-types": "off",
|
|
238
|
+
"@typescript-eslint/camelcase": "off",
|
|
239
|
+
"@typescript-eslint/no-namespace": "off",
|
|
240
|
+
"@typescript-eslint/ban-ts-ignore": "off",
|
|
241
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
242
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
243
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
244
|
+
"@typescript-eslint/naming-convention": "off",
|
|
245
|
+
"@typescript-eslint/no-empty-interface": "off",
|
|
246
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
247
|
+
"@typescript-eslint/triple-slash-reference": "off",
|
|
248
|
+
"@typescript-eslint/no-parameter-properties": "off",
|
|
249
|
+
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
250
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
251
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
252
|
+
"@typescript-eslint/consistent-indexed-object-style": "off"
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
var typescript = (0, import_eslint_define_config.defineFlatConfig)([
|
|
256
|
+
...typescriptCore,
|
|
233
257
|
{
|
|
234
258
|
files: ["**/*.d.ts"],
|
|
235
259
|
rules: {
|
|
@@ -245,7 +269,7 @@ var typescript = (0, import_eslint_define_config.defineFlatConfig)([
|
|
|
245
269
|
}
|
|
246
270
|
},
|
|
247
271
|
{
|
|
248
|
-
files: [
|
|
272
|
+
files: [GLOB_JS, "**/*.cjs"],
|
|
249
273
|
rules: {
|
|
250
274
|
"@typescript-eslint/no-var-requires": "off"
|
|
251
275
|
}
|
|
@@ -254,26 +278,35 @@ var typescript = (0, import_eslint_define_config.defineFlatConfig)([
|
|
|
254
278
|
|
|
255
279
|
// src/configs/vue.ts
|
|
256
280
|
function getVueVersion() {
|
|
257
|
-
const pkg = (0,
|
|
281
|
+
const pkg = (0, import_local_pkg2.getPackageInfoSync)("vue", { paths: [import_node_process.default.cwd()] });
|
|
258
282
|
if (pkg && typeof pkg.version === "string" && !Number.isNaN(+pkg.version[0])) {
|
|
259
283
|
return +pkg.version[0];
|
|
260
284
|
}
|
|
261
285
|
return 3;
|
|
262
286
|
}
|
|
263
287
|
var isVue3 = getVueVersion() === 3;
|
|
264
|
-
var vueBaseRules = {};
|
|
265
288
|
var vue2Rules = {
|
|
266
|
-
...
|
|
289
|
+
...import_eslint_plugin_vue.default.configs.base.rules,
|
|
290
|
+
...import_eslint_plugin_vue.default.configs.essential.rules,
|
|
291
|
+
...import_eslint_plugin_vue.default.configs["strongly-recommended"].rules,
|
|
292
|
+
...import_eslint_plugin_vue.default.configs.recommended.rules
|
|
267
293
|
};
|
|
268
294
|
var vue3Rules = {
|
|
269
|
-
...
|
|
295
|
+
...import_eslint_plugin_vue.default.configs.base.rules,
|
|
296
|
+
...import_eslint_plugin_vue.default.configs["vue3-essential"].rules,
|
|
297
|
+
...import_eslint_plugin_vue.default.configs["vue3-strongly-recommended"].rules,
|
|
298
|
+
...import_eslint_plugin_vue.default.configs["vue3-recommended"].rules
|
|
270
299
|
};
|
|
271
300
|
var vue = (0, import_eslint_define_config2.defineFlatConfig)([
|
|
301
|
+
...import_typescript_eslint.default.config({
|
|
302
|
+
files: [GLOB_VUE],
|
|
303
|
+
extends: typescriptCore
|
|
304
|
+
}),
|
|
272
305
|
{
|
|
273
306
|
files: [GLOB_VUE],
|
|
274
307
|
plugins: {
|
|
275
308
|
vue: import_eslint_plugin_vue.default,
|
|
276
|
-
"@typescript-eslint":
|
|
309
|
+
"@typescript-eslint": import_typescript_eslint.default.plugin
|
|
277
310
|
},
|
|
278
311
|
languageOptions: {
|
|
279
312
|
parser: parserVue,
|
|
@@ -288,14 +321,220 @@ var vue = (0, import_eslint_define_config2.defineFlatConfig)([
|
|
|
288
321
|
},
|
|
289
322
|
processor: import_eslint_plugin_vue.default.processors[".vue"],
|
|
290
323
|
rules: {
|
|
291
|
-
...
|
|
324
|
+
...isVue3 ? vue3Rules : vue2Rules,
|
|
325
|
+
// OFF
|
|
326
|
+
"vue/no-v-html": "off",
|
|
327
|
+
"vue/require-prop-types": "off",
|
|
328
|
+
"vue/require-default-prop": "off",
|
|
329
|
+
"vue/multi-word-component-names": "off",
|
|
330
|
+
"vue/no-setup-props-reactivity-loss": "off",
|
|
331
|
+
"vue/html-self-closing": [
|
|
332
|
+
"error",
|
|
333
|
+
{
|
|
334
|
+
html: {
|
|
335
|
+
void: "always",
|
|
336
|
+
normal: "always",
|
|
337
|
+
component: "always"
|
|
338
|
+
},
|
|
339
|
+
svg: "always",
|
|
340
|
+
math: "always"
|
|
341
|
+
}
|
|
342
|
+
],
|
|
343
|
+
"vue/block-tag-newline": [
|
|
344
|
+
"error",
|
|
345
|
+
{
|
|
346
|
+
singleline: "always",
|
|
347
|
+
multiline: "always"
|
|
348
|
+
}
|
|
349
|
+
],
|
|
350
|
+
"vue/component-name-in-template-casing": [
|
|
351
|
+
"error",
|
|
352
|
+
"PascalCase",
|
|
353
|
+
{
|
|
354
|
+
// Force auto-import components to be PascalCase
|
|
355
|
+
registeredComponentsOnly: false,
|
|
356
|
+
ignores: ["slot", "component"]
|
|
357
|
+
}
|
|
358
|
+
],
|
|
359
|
+
"vue/component-options-name-casing": ["error", "PascalCase"],
|
|
360
|
+
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
361
|
+
"vue/define-macros-order": [
|
|
362
|
+
"error",
|
|
363
|
+
{
|
|
364
|
+
order: ["defineProps", "defineEmits", "defineOptions", "defineSlots"]
|
|
365
|
+
}
|
|
366
|
+
],
|
|
367
|
+
"vue/html-comment-content-spacing": [
|
|
368
|
+
"error",
|
|
369
|
+
"always",
|
|
370
|
+
{
|
|
371
|
+
exceptions: ["-"]
|
|
372
|
+
}
|
|
373
|
+
],
|
|
374
|
+
"vue/array-bracket-spacing": ["error", "never"],
|
|
375
|
+
"vue/arrow-spacing": ["error", { before: true, after: true }],
|
|
376
|
+
"vue/block-spacing": ["error", "always"],
|
|
377
|
+
"vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
|
|
378
|
+
"vue/comma-dangle": ["error", "always-multiline"],
|
|
379
|
+
"vue/comma-spacing": ["error", { before: false, after: true }],
|
|
380
|
+
"vue/comma-style": ["error", "last"],
|
|
381
|
+
"vue/dot-location": ["error", "property"],
|
|
382
|
+
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
383
|
+
"vue/eqeqeq": ["error", "smart"],
|
|
384
|
+
"vue/key-spacing": ["error", { beforeColon: false, afterColon: true }],
|
|
385
|
+
"vue/keyword-spacing": ["error", { before: true, after: true }],
|
|
386
|
+
"vue/no-empty-pattern": "error",
|
|
387
|
+
"vue/no-loss-of-precision": "error",
|
|
388
|
+
"vue/no-irregular-whitespace": "error",
|
|
389
|
+
"vue/no-use-v-else-with-v-for": "error",
|
|
390
|
+
"vue/require-typed-object-prop": "error",
|
|
391
|
+
"vue/no-extra-parens": ["error", "functions"],
|
|
392
|
+
"vue/no-restricted-syntax": [
|
|
393
|
+
"error",
|
|
394
|
+
"DebuggerStatement",
|
|
395
|
+
"LabeledStatement",
|
|
396
|
+
"WithStatement"
|
|
397
|
+
],
|
|
398
|
+
"vue/no-sparse-arrays": "error",
|
|
399
|
+
"vue/no-deprecated-model-definition": [
|
|
400
|
+
"error",
|
|
401
|
+
{
|
|
402
|
+
allowVue3Compat: true
|
|
403
|
+
}
|
|
404
|
+
],
|
|
405
|
+
"vue/object-curly-newline": [
|
|
406
|
+
"error",
|
|
407
|
+
{
|
|
408
|
+
multiline: true,
|
|
409
|
+
consistent: true
|
|
410
|
+
}
|
|
411
|
+
],
|
|
412
|
+
"vue/no-static-inline-styles": [
|
|
413
|
+
"error",
|
|
414
|
+
{
|
|
415
|
+
allowBinding: true
|
|
416
|
+
}
|
|
417
|
+
],
|
|
418
|
+
"vue/object-curly-spacing": ["error", "always"],
|
|
419
|
+
"vue/object-property-newline": [
|
|
420
|
+
"error",
|
|
421
|
+
{
|
|
422
|
+
allowMultiplePropertiesPerLine: true
|
|
423
|
+
}
|
|
424
|
+
],
|
|
425
|
+
"vue/object-shorthand": [
|
|
426
|
+
"error",
|
|
427
|
+
"always",
|
|
428
|
+
{
|
|
429
|
+
ignoreConstructors: false,
|
|
430
|
+
avoidQuotes: true
|
|
431
|
+
}
|
|
432
|
+
],
|
|
433
|
+
"vue/operator-linebreak": ["error", "before"],
|
|
434
|
+
"vue/prefer-template": "error",
|
|
435
|
+
"vue/prop-name-casing": ["error", "camelCase"],
|
|
436
|
+
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
437
|
+
"vue/space-in-parens": ["error", "never"],
|
|
438
|
+
"vue/space-infix-ops": "error",
|
|
439
|
+
"vue/space-unary-ops": [
|
|
440
|
+
"error",
|
|
441
|
+
{
|
|
442
|
+
words: true,
|
|
443
|
+
nonwords: false
|
|
444
|
+
}
|
|
445
|
+
],
|
|
446
|
+
"vue/template-curly-spacing": "error",
|
|
447
|
+
"vue/block-order": [
|
|
448
|
+
"error",
|
|
449
|
+
{
|
|
450
|
+
order: ["script", "template", "style"]
|
|
451
|
+
}
|
|
452
|
+
],
|
|
453
|
+
"vue/attributes-order": [
|
|
454
|
+
"error",
|
|
455
|
+
{
|
|
456
|
+
order: [
|
|
457
|
+
"EVENTS",
|
|
458
|
+
// `@click="functionCall"`, `v-on="event"`
|
|
459
|
+
"TWO_WAY_BINDING",
|
|
460
|
+
// `v-model`
|
|
461
|
+
"OTHER_DIRECTIVES",
|
|
462
|
+
// `v-custom-directive`
|
|
463
|
+
"LIST_RENDERING",
|
|
464
|
+
// `v-for item in items`
|
|
465
|
+
"CONDITIONALS",
|
|
466
|
+
// `v-if`, `v-show`, `v-cloak`
|
|
467
|
+
"CONTENT",
|
|
468
|
+
// `v-text`, `v-html`
|
|
469
|
+
"SLOT",
|
|
470
|
+
// `v-slot`, `slot`
|
|
471
|
+
"UNIQUE",
|
|
472
|
+
// `ref`, `key`
|
|
473
|
+
"DEFINITION",
|
|
474
|
+
// `is`, `v-is`
|
|
475
|
+
"ATTR_DYNAMIC",
|
|
476
|
+
// `v-bind:prop="foo"`, `:prop="foo"`
|
|
477
|
+
// `OTHER_ATTR`, // `custom-prop="foo"`, `:prop="foo"`, `disabled`
|
|
478
|
+
"RENDER_MODIFIERS",
|
|
479
|
+
// `v-once`, `v-pre`
|
|
480
|
+
"GLOBAL",
|
|
481
|
+
// `id`
|
|
482
|
+
"ATTR_STATIC",
|
|
483
|
+
// `prop="foo", `static attributes
|
|
484
|
+
"ATTR_SHORTHAND_BOOL"
|
|
485
|
+
// `disabled`, prop shorthand
|
|
486
|
+
],
|
|
487
|
+
alphabetical: false
|
|
488
|
+
}
|
|
489
|
+
],
|
|
490
|
+
"vue/order-in-components": [
|
|
491
|
+
"error",
|
|
492
|
+
{
|
|
493
|
+
order: [
|
|
494
|
+
"el",
|
|
495
|
+
"name",
|
|
496
|
+
"key",
|
|
497
|
+
"parent",
|
|
498
|
+
"functional",
|
|
499
|
+
["provide", "inject"],
|
|
500
|
+
["delimiters", "comments"],
|
|
501
|
+
["components", "directives", "filters"],
|
|
502
|
+
"extends",
|
|
503
|
+
"mixins",
|
|
504
|
+
"layout",
|
|
505
|
+
"middleware",
|
|
506
|
+
"validate",
|
|
507
|
+
"scrollToTop",
|
|
508
|
+
"transition",
|
|
509
|
+
"loading",
|
|
510
|
+
"inheritAttrs",
|
|
511
|
+
"model",
|
|
512
|
+
["props", "propsData"],
|
|
513
|
+
"emits",
|
|
514
|
+
"setup",
|
|
515
|
+
"asyncData",
|
|
516
|
+
"computed",
|
|
517
|
+
"data",
|
|
518
|
+
"fetch",
|
|
519
|
+
"head",
|
|
520
|
+
"methods",
|
|
521
|
+
["template", "render"],
|
|
522
|
+
"watch",
|
|
523
|
+
"watchQuery",
|
|
524
|
+
"LIFECYCLE_HOOKS",
|
|
525
|
+
"renderError",
|
|
526
|
+
"ROUTER_GUARDS"
|
|
527
|
+
]
|
|
528
|
+
}
|
|
529
|
+
],
|
|
530
|
+
"vue/max-attributes-per-line": [
|
|
531
|
+
"error",
|
|
532
|
+
{
|
|
533
|
+
singleline: 1,
|
|
534
|
+
multiline: 1
|
|
535
|
+
}
|
|
536
|
+
]
|
|
292
537
|
}
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
plugins: {
|
|
296
|
-
vue: import_eslint_plugin_vue.default
|
|
297
|
-
},
|
|
298
|
-
rules: isVue3 ? vue3Rules : vue2Rules
|
|
299
538
|
}
|
|
300
539
|
]);
|
|
301
540
|
|
|
@@ -308,11 +547,11 @@ var yml = (0, import_eslint_define_config3.defineFlatConfig)([
|
|
|
308
547
|
parser: parserYaml
|
|
309
548
|
},
|
|
310
549
|
plugins: {
|
|
311
|
-
yml:
|
|
550
|
+
yml: import_eslint_plugin_yml.default
|
|
312
551
|
},
|
|
313
552
|
rules: {
|
|
314
|
-
...
|
|
315
|
-
...
|
|
553
|
+
...import_eslint_plugin_yml.default.configs.standard.rules,
|
|
554
|
+
...import_eslint_plugin_yml.default.configs.prettier.rules,
|
|
316
555
|
"yml/no-empty-mapping-value": "off",
|
|
317
556
|
"yml/quotes": ["error", { avoidEscape: false, prefer: "single" }]
|
|
318
557
|
}
|
|
@@ -583,7 +822,7 @@ var import_eslint_define_config7 = require("eslint-define-config");
|
|
|
583
822
|
var imports = (0, import_eslint_define_config7.defineFlatConfig)([
|
|
584
823
|
{
|
|
585
824
|
plugins: {
|
|
586
|
-
import:
|
|
825
|
+
import: import_eslint_plugin_import_x.default
|
|
587
826
|
},
|
|
588
827
|
settings: {
|
|
589
828
|
"import/resolver": {
|
|
@@ -729,42 +968,28 @@ var prettier = (0, import_eslint_define_config10.defineFlatConfig)([
|
|
|
729
968
|
// src/configs/markdown.ts
|
|
730
969
|
var import_eslint_define_config11 = require("eslint-define-config");
|
|
731
970
|
var markdown = (0, import_eslint_define_config11.defineFlatConfig)([
|
|
732
|
-
|
|
733
|
-
files: [GLOB_MARKDOWN],
|
|
734
|
-
plugins: {
|
|
735
|
-
markdown: import_eslint_plugin_markdown.default
|
|
736
|
-
},
|
|
737
|
-
processor: "markdown/markdown"
|
|
738
|
-
},
|
|
971
|
+
...import_eslint_plugin_markdown.default.configs.recommended,
|
|
739
972
|
{
|
|
740
973
|
files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
|
|
741
|
-
languageOptions: {
|
|
742
|
-
parserOptions: {
|
|
743
|
-
ecmaFeatures: {
|
|
744
|
-
impliedStrict: true
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
},
|
|
748
|
-
plugins: {
|
|
749
|
-
"@typescript-eslint": import_eslint_plugin2.default
|
|
750
|
-
},
|
|
751
974
|
rules: {
|
|
752
|
-
...import_eslint_plugin_markdown.default.configs["recommended-legacy"].overrides[1].rules,
|
|
753
975
|
"no-undef": "off",
|
|
754
976
|
"no-alert": "off",
|
|
755
977
|
"no-console": "off",
|
|
756
978
|
"no-unused-vars": "off",
|
|
757
979
|
"no-unused-expressions": "off",
|
|
758
980
|
"no-restricted-imports": "off",
|
|
981
|
+
"node/prefer-global/buffer": "off",
|
|
982
|
+
"node/prefer-global/process": "off",
|
|
759
983
|
"import/no-unresolved": "off",
|
|
984
|
+
"unused-imports/no-unused-imports": "off",
|
|
985
|
+
"unused-imports/no-unused-vars": "off",
|
|
760
986
|
"@typescript-eslint/comma-dangle": "off",
|
|
761
987
|
"@typescript-eslint/no-redeclare": "off",
|
|
988
|
+
"@typescript-eslint/no-namespace": "off",
|
|
762
989
|
"@typescript-eslint/no-unused-vars": "off",
|
|
763
990
|
"@typescript-eslint/no-var-requires": "off",
|
|
764
991
|
"@typescript-eslint/no-extraneous-class": "off",
|
|
765
|
-
"@typescript-eslint/no-use-before-define": "off"
|
|
766
|
-
"unused-imports/no-unused-imports": "off",
|
|
767
|
-
"unused-imports/no-unused-vars": "off"
|
|
992
|
+
"@typescript-eslint/no-use-before-define": "off"
|
|
768
993
|
}
|
|
769
994
|
}
|
|
770
995
|
]);
|
|
@@ -1171,34 +1396,39 @@ var ignores = (0, import_eslint_define_config14.defineFlatConfig)([
|
|
|
1171
1396
|
]);
|
|
1172
1397
|
|
|
1173
1398
|
// src/presets.ts
|
|
1174
|
-
var
|
|
1399
|
+
var presetJavaScript = [
|
|
1175
1400
|
...ignores,
|
|
1176
1401
|
...javascript,
|
|
1177
1402
|
...jsx,
|
|
1178
1403
|
...node,
|
|
1179
|
-
...typescript,
|
|
1180
1404
|
...imports,
|
|
1181
1405
|
...unicorn,
|
|
1182
1406
|
...comments
|
|
1183
|
-
]
|
|
1184
|
-
var
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
const configs = (0, import_eslint_define_config15.defineFlatConfig)([...
|
|
1407
|
+
];
|
|
1408
|
+
var presetBasic = [...presetJavaScript, ...typescript];
|
|
1409
|
+
var presetJsonc = [...jsonc, ...sortPackageJson, ...sortTsConfig];
|
|
1410
|
+
var presetLanguageExtensions = [...presetJsonc, ...yml, ...markdown];
|
|
1411
|
+
var presetCommon = [...presetBasic, ...presetLanguageExtensions, ...prettier];
|
|
1412
|
+
var presetAll = [...presetCommon, ...vue, ...unocss];
|
|
1413
|
+
function ntnyq(config = [], {
|
|
1414
|
+
vue: enableVue = hasVue,
|
|
1415
|
+
unocss: enableUnoCSS = hasUnoCSS,
|
|
1416
|
+
prettier: enablePrettier = true,
|
|
1417
|
+
markdown: enableMarkdown = true
|
|
1418
|
+
} = {}) {
|
|
1419
|
+
const configs = (0, import_eslint_define_config15.defineFlatConfig)([...presetBasic, ...yml, ...presetJsonc]);
|
|
1196
1420
|
if (enableVue) {
|
|
1197
1421
|
configs.push(...vue);
|
|
1198
1422
|
}
|
|
1199
1423
|
if (enableUnoCSS) {
|
|
1200
1424
|
configs.push(...unocss);
|
|
1201
1425
|
}
|
|
1426
|
+
if (enablePrettier) {
|
|
1427
|
+
configs.push(...prettier);
|
|
1428
|
+
}
|
|
1429
|
+
if (enableMarkdown) {
|
|
1430
|
+
configs.push(...markdown);
|
|
1431
|
+
}
|
|
1202
1432
|
if (Object.keys(config).length > 0) {
|
|
1203
1433
|
configs.push(...Array.isArray(config) ? config : [config]);
|
|
1204
1434
|
}
|
|
@@ -1228,13 +1458,14 @@ function ntnyq(config = [], { vue: enableVue = false, unocss: enableUnoCSS = fal
|
|
|
1228
1458
|
GLOB_TSX,
|
|
1229
1459
|
GLOB_VUE,
|
|
1230
1460
|
GLOB_YAML,
|
|
1231
|
-
all,
|
|
1232
|
-
basic,
|
|
1233
1461
|
comments,
|
|
1234
|
-
common,
|
|
1235
1462
|
getVueVersion,
|
|
1463
|
+
hasTypeScript,
|
|
1464
|
+
hasUnoCSS,
|
|
1465
|
+
hasVue,
|
|
1236
1466
|
ignores,
|
|
1237
1467
|
imports,
|
|
1468
|
+
interopDefault,
|
|
1238
1469
|
javascript,
|
|
1239
1470
|
jsonc,
|
|
1240
1471
|
jsx,
|
|
@@ -1242,7 +1473,6 @@ function ntnyq(config = [], { vue: enableVue = false, unocss: enableUnoCSS = fal
|
|
|
1242
1473
|
node,
|
|
1243
1474
|
ntnyq,
|
|
1244
1475
|
parserJsonc,
|
|
1245
|
-
parserTs,
|
|
1246
1476
|
parserVue,
|
|
1247
1477
|
parserYaml,
|
|
1248
1478
|
pluginComments,
|
|
@@ -1251,15 +1481,22 @@ function ntnyq(config = [], { vue: enableVue = false, unocss: enableUnoCSS = fal
|
|
|
1251
1481
|
pluginMarkdown,
|
|
1252
1482
|
pluginNode,
|
|
1253
1483
|
pluginPrettier,
|
|
1254
|
-
pluginTs,
|
|
1255
1484
|
pluginUnicorn,
|
|
1256
1485
|
pluginUnoCSS,
|
|
1257
1486
|
pluginVue,
|
|
1258
1487
|
pluginYaml,
|
|
1488
|
+
presetAll,
|
|
1489
|
+
presetBasic,
|
|
1490
|
+
presetCommon,
|
|
1491
|
+
presetJavaScript,
|
|
1492
|
+
presetJsonc,
|
|
1493
|
+
presetLanguageExtensions,
|
|
1259
1494
|
prettier,
|
|
1260
1495
|
sortPackageJson,
|
|
1261
1496
|
sortTsConfig,
|
|
1497
|
+
tseslint,
|
|
1262
1498
|
typescript,
|
|
1499
|
+
typescriptCore,
|
|
1263
1500
|
unicorn,
|
|
1264
1501
|
unocss,
|
|
1265
1502
|
vue,
|