@ntnyq/eslint-config 2.0.0-beta.26 → 2.0.0-beta.27
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 +325 -102
- package/dist/index.d.cts +18 -10
- package/dist/index.d.ts +18 -10
- package/dist/index.js +318 -98
- package/package.json +6 -7
package/dist/index.cjs
CHANGED
|
@@ -57,8 +57,11 @@ __export(src_exports, {
|
|
|
57
57
|
comments: () => comments,
|
|
58
58
|
common: () => common,
|
|
59
59
|
getVueVersion: () => getVueVersion,
|
|
60
|
+
hasTypeScript: () => hasTypeScript,
|
|
61
|
+
hasVue: () => hasVue,
|
|
60
62
|
ignores: () => ignores,
|
|
61
63
|
imports: () => imports,
|
|
64
|
+
interopDefault: () => interopDefault,
|
|
62
65
|
javascript: () => javascript,
|
|
63
66
|
jsonc: () => jsonc,
|
|
64
67
|
jsx: () => jsx,
|
|
@@ -66,24 +69,24 @@ __export(src_exports, {
|
|
|
66
69
|
node: () => node,
|
|
67
70
|
ntnyq: () => ntnyq,
|
|
68
71
|
parserJsonc: () => parserJsonc,
|
|
69
|
-
parserTs: () => parserTs,
|
|
70
72
|
parserVue: () => parserVue,
|
|
71
73
|
parserYaml: () => parserYaml,
|
|
72
74
|
pluginComments: () => import_eslint_plugin_eslint_comments.default,
|
|
73
|
-
pluginImport: () =>
|
|
75
|
+
pluginImport: () => import_eslint_plugin_import_x.default,
|
|
74
76
|
pluginJsonc: () => pluginJsonc,
|
|
75
77
|
pluginMarkdown: () => import_eslint_plugin_markdown.default,
|
|
76
78
|
pluginNode: () => import_eslint_plugin_n.default,
|
|
77
79
|
pluginPrettier: () => import_eslint_plugin_prettier.default,
|
|
78
|
-
pluginTs: () => import_eslint_plugin2.default,
|
|
79
80
|
pluginUnicorn: () => import_eslint_plugin_unicorn.default,
|
|
80
81
|
pluginUnoCSS: () => import_eslint_plugin.default,
|
|
81
82
|
pluginVue: () => import_eslint_plugin_vue.default,
|
|
82
|
-
pluginYaml: () =>
|
|
83
|
+
pluginYaml: () => import_eslint_plugin_yml.default,
|
|
83
84
|
prettier: () => prettier,
|
|
84
85
|
sortPackageJson: () => sortPackageJson,
|
|
85
86
|
sortTsConfig: () => sortTsConfig,
|
|
87
|
+
tseslint: () => import_typescript_eslint.default,
|
|
86
88
|
typescript: () => typescript,
|
|
89
|
+
typescriptCore: () => typescriptCore,
|
|
87
90
|
unicorn: () => unicorn,
|
|
88
91
|
unocss: () => unocss,
|
|
89
92
|
vue: () => vue,
|
|
@@ -91,7 +94,12 @@ __export(src_exports, {
|
|
|
91
94
|
});
|
|
92
95
|
module.exports = __toCommonJS(src_exports);
|
|
93
96
|
|
|
94
|
-
// src/
|
|
97
|
+
// src/env.ts
|
|
98
|
+
var import_local_pkg = require("local-pkg");
|
|
99
|
+
var hasTypeScript = (0, import_local_pkg.isPackageExists)("typescript");
|
|
100
|
+
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");
|
|
101
|
+
|
|
102
|
+
// src/globs.ts
|
|
95
103
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
96
104
|
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
97
105
|
var GLOB_JS = "**/*.?([cm])js";
|
|
@@ -137,19 +145,30 @@ var GLOB_EXCLUDE = [
|
|
|
137
145
|
"**/__snapshots__",
|
|
138
146
|
"**/auto-import?(s).d.ts",
|
|
139
147
|
"**/components.d.ts",
|
|
140
|
-
"**/output",
|
|
141
148
|
"**/coverage",
|
|
149
|
+
"**/fixtures",
|
|
150
|
+
"**/output",
|
|
151
|
+
"**/public",
|
|
152
|
+
"**/static",
|
|
142
153
|
"**/temp",
|
|
143
154
|
"**/cache",
|
|
144
|
-
"**/fixtures",
|
|
145
155
|
"**/.vitepress/cache",
|
|
156
|
+
"**/.eslintcache",
|
|
157
|
+
"**/.stylelintcache",
|
|
158
|
+
"**/.vite-inspect",
|
|
146
159
|
"**/.nuxt",
|
|
147
160
|
"**/.output",
|
|
161
|
+
"**/.tsup",
|
|
148
162
|
"**/.nitro",
|
|
149
163
|
"**/.vercel",
|
|
150
164
|
"**/.changeset",
|
|
151
165
|
"**/.npmrc",
|
|
152
|
-
"**/.yarnrc"
|
|
166
|
+
"**/.yarnrc",
|
|
167
|
+
// Force lint
|
|
168
|
+
"!.github",
|
|
169
|
+
"!.vitepress",
|
|
170
|
+
"!.vuepress",
|
|
171
|
+
"!.vscode"
|
|
153
172
|
];
|
|
154
173
|
|
|
155
174
|
// src/presets.ts
|
|
@@ -157,7 +176,7 @@ var import_eslint_define_config15 = require("eslint-define-config");
|
|
|
157
176
|
|
|
158
177
|
// src/configs/vue.ts
|
|
159
178
|
var import_node_process = __toESM(require("process"), 1);
|
|
160
|
-
var
|
|
179
|
+
var import_local_pkg2 = require("local-pkg");
|
|
161
180
|
var import_eslint_define_config2 = require("eslint-define-config");
|
|
162
181
|
|
|
163
182
|
// src/plugins.ts
|
|
@@ -168,68 +187,68 @@ var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
|
168
187
|
var import_eslint_plugin_prettier = __toESM(require("eslint-plugin-prettier"), 1);
|
|
169
188
|
var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1);
|
|
170
189
|
var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
|
|
171
|
-
var
|
|
172
|
-
var
|
|
190
|
+
var import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
|
|
191
|
+
var import_eslint_plugin_yml = __toESM(require("eslint-plugin-yml"), 1);
|
|
173
192
|
var pluginJsonc = __toESM(require("eslint-plugin-jsonc"), 1);
|
|
174
|
-
var
|
|
193
|
+
var import_eslint_plugin_import_x = __toESM(require("eslint-plugin-import-x"), 1);
|
|
175
194
|
var parserYaml = __toESM(require("yaml-eslint-parser"), 1);
|
|
176
195
|
var parserVue = __toESM(require("vue-eslint-parser"), 1);
|
|
177
196
|
var parserJsonc = __toESM(require("jsonc-eslint-parser"), 1);
|
|
178
|
-
|
|
197
|
+
// @__NO_SIDE_EFFECTS__
|
|
198
|
+
function interopDefault(m) {
|
|
199
|
+
return m.default || m;
|
|
200
|
+
}
|
|
179
201
|
|
|
180
202
|
// src/configs/typescript.ts
|
|
181
203
|
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"
|
|
204
|
+
var typescriptCore = import_typescript_eslint.default.config({
|
|
205
|
+
extends: [...import_typescript_eslint.default.configs.recommended],
|
|
206
|
+
files: [GLOB_TS, GLOB_TSX],
|
|
207
|
+
languageOptions: {
|
|
208
|
+
parser: import_typescript_eslint.default.parser,
|
|
209
|
+
parserOptions: {
|
|
210
|
+
sourceType: "module"
|
|
231
211
|
}
|
|
232
212
|
},
|
|
213
|
+
rules: {
|
|
214
|
+
"@typescript-eslint/no-unused-vars": "error",
|
|
215
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
216
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
217
|
+
"error",
|
|
218
|
+
{
|
|
219
|
+
prefer: "type-imports",
|
|
220
|
+
fixStyle: "separate-type-imports",
|
|
221
|
+
disallowTypeAnnotations: false
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
225
|
+
"error",
|
|
226
|
+
{
|
|
227
|
+
assertionStyle: "as",
|
|
228
|
+
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
"@typescript-eslint/prefer-as-const": "warn",
|
|
232
|
+
"@typescript-eslint/ban-types": "off",
|
|
233
|
+
"@typescript-eslint/camelcase": "off",
|
|
234
|
+
"@typescript-eslint/no-namespace": "off",
|
|
235
|
+
"@typescript-eslint/ban-ts-ignore": "off",
|
|
236
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
237
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
238
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
239
|
+
"@typescript-eslint/naming-convention": "off",
|
|
240
|
+
"@typescript-eslint/no-empty-interface": "off",
|
|
241
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
242
|
+
"@typescript-eslint/triple-slash-reference": "off",
|
|
243
|
+
"@typescript-eslint/no-parameter-properties": "off",
|
|
244
|
+
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
245
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
246
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
247
|
+
"@typescript-eslint/consistent-indexed-object-style": "off"
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
var typescript = (0, import_eslint_define_config.defineFlatConfig)([
|
|
251
|
+
...typescriptCore,
|
|
233
252
|
{
|
|
234
253
|
files: ["**/*.d.ts"],
|
|
235
254
|
rules: {
|
|
@@ -245,7 +264,7 @@ var typescript = (0, import_eslint_define_config.defineFlatConfig)([
|
|
|
245
264
|
}
|
|
246
265
|
},
|
|
247
266
|
{
|
|
248
|
-
files: [
|
|
267
|
+
files: [GLOB_JS, "**/*.cjs"],
|
|
249
268
|
rules: {
|
|
250
269
|
"@typescript-eslint/no-var-requires": "off"
|
|
251
270
|
}
|
|
@@ -254,26 +273,35 @@ var typescript = (0, import_eslint_define_config.defineFlatConfig)([
|
|
|
254
273
|
|
|
255
274
|
// src/configs/vue.ts
|
|
256
275
|
function getVueVersion() {
|
|
257
|
-
const pkg = (0,
|
|
276
|
+
const pkg = (0, import_local_pkg2.getPackageInfoSync)("vue", { paths: [import_node_process.default.cwd()] });
|
|
258
277
|
if (pkg && typeof pkg.version === "string" && !Number.isNaN(+pkg.version[0])) {
|
|
259
278
|
return +pkg.version[0];
|
|
260
279
|
}
|
|
261
280
|
return 3;
|
|
262
281
|
}
|
|
263
282
|
var isVue3 = getVueVersion() === 3;
|
|
264
|
-
var vueBaseRules = {};
|
|
265
283
|
var vue2Rules = {
|
|
266
|
-
...
|
|
284
|
+
...import_eslint_plugin_vue.default.configs.base.rules,
|
|
285
|
+
...import_eslint_plugin_vue.default.configs.essential.rules,
|
|
286
|
+
...import_eslint_plugin_vue.default.configs["strongly-recommended"].rules,
|
|
287
|
+
...import_eslint_plugin_vue.default.configs.recommended.rules
|
|
267
288
|
};
|
|
268
289
|
var vue3Rules = {
|
|
269
|
-
...
|
|
290
|
+
...import_eslint_plugin_vue.default.configs.base.rules,
|
|
291
|
+
...import_eslint_plugin_vue.default.configs["vue3-essential"].rules,
|
|
292
|
+
...import_eslint_plugin_vue.default.configs["vue3-strongly-recommended"].rules,
|
|
293
|
+
...import_eslint_plugin_vue.default.configs["vue3-recommended"].rules
|
|
270
294
|
};
|
|
271
295
|
var vue = (0, import_eslint_define_config2.defineFlatConfig)([
|
|
296
|
+
...import_typescript_eslint.default.config({
|
|
297
|
+
files: [GLOB_VUE],
|
|
298
|
+
extends: typescriptCore
|
|
299
|
+
}),
|
|
272
300
|
{
|
|
273
301
|
files: [GLOB_VUE],
|
|
274
302
|
plugins: {
|
|
275
303
|
vue: import_eslint_plugin_vue.default,
|
|
276
|
-
"@typescript-eslint":
|
|
304
|
+
"@typescript-eslint": import_typescript_eslint.default.plugin
|
|
277
305
|
},
|
|
278
306
|
languageOptions: {
|
|
279
307
|
parser: parserVue,
|
|
@@ -288,14 +316,220 @@ var vue = (0, import_eslint_define_config2.defineFlatConfig)([
|
|
|
288
316
|
},
|
|
289
317
|
processor: import_eslint_plugin_vue.default.processors[".vue"],
|
|
290
318
|
rules: {
|
|
291
|
-
...
|
|
319
|
+
...isVue3 ? vue3Rules : vue2Rules,
|
|
320
|
+
// OFF
|
|
321
|
+
"vue/no-v-html": "off",
|
|
322
|
+
"vue/require-prop-types": "off",
|
|
323
|
+
"vue/require-default-prop": "off",
|
|
324
|
+
"vue/multi-word-component-names": "off",
|
|
325
|
+
"vue/no-setup-props-reactivity-loss": "off",
|
|
326
|
+
"vue/html-self-closing": [
|
|
327
|
+
"error",
|
|
328
|
+
{
|
|
329
|
+
html: {
|
|
330
|
+
void: "always",
|
|
331
|
+
normal: "always",
|
|
332
|
+
component: "always"
|
|
333
|
+
},
|
|
334
|
+
svg: "always",
|
|
335
|
+
math: "always"
|
|
336
|
+
}
|
|
337
|
+
],
|
|
338
|
+
"vue/block-tag-newline": [
|
|
339
|
+
"error",
|
|
340
|
+
{
|
|
341
|
+
singleline: "always",
|
|
342
|
+
multiline: "always"
|
|
343
|
+
}
|
|
344
|
+
],
|
|
345
|
+
"vue/component-name-in-template-casing": [
|
|
346
|
+
"error",
|
|
347
|
+
"PascalCase",
|
|
348
|
+
{
|
|
349
|
+
// Force auto-import components to be PascalCase
|
|
350
|
+
registeredComponentsOnly: false,
|
|
351
|
+
ignores: ["slot", "component"]
|
|
352
|
+
}
|
|
353
|
+
],
|
|
354
|
+
"vue/component-options-name-casing": ["error", "PascalCase"],
|
|
355
|
+
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
356
|
+
"vue/define-macros-order": [
|
|
357
|
+
"error",
|
|
358
|
+
{
|
|
359
|
+
order: ["defineProps", "defineEmits", "defineOptions", "defineSlots"]
|
|
360
|
+
}
|
|
361
|
+
],
|
|
362
|
+
"vue/html-comment-content-spacing": [
|
|
363
|
+
"error",
|
|
364
|
+
"always",
|
|
365
|
+
{
|
|
366
|
+
exceptions: ["-"]
|
|
367
|
+
}
|
|
368
|
+
],
|
|
369
|
+
"vue/array-bracket-spacing": ["error", "never"],
|
|
370
|
+
"vue/arrow-spacing": ["error", { before: true, after: true }],
|
|
371
|
+
"vue/block-spacing": ["error", "always"],
|
|
372
|
+
"vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
|
|
373
|
+
"vue/comma-dangle": ["error", "always-multiline"],
|
|
374
|
+
"vue/comma-spacing": ["error", { before: false, after: true }],
|
|
375
|
+
"vue/comma-style": ["error", "last"],
|
|
376
|
+
"vue/dot-location": ["error", "property"],
|
|
377
|
+
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
378
|
+
"vue/eqeqeq": ["error", "smart"],
|
|
379
|
+
"vue/key-spacing": ["error", { beforeColon: false, afterColon: true }],
|
|
380
|
+
"vue/keyword-spacing": ["error", { before: true, after: true }],
|
|
381
|
+
"vue/no-empty-pattern": "error",
|
|
382
|
+
"vue/no-loss-of-precision": "error",
|
|
383
|
+
"vue/no-irregular-whitespace": "error",
|
|
384
|
+
"vue/no-use-v-else-with-v-for": "error",
|
|
385
|
+
"vue/require-typed-object-prop": "error",
|
|
386
|
+
"vue/no-extra-parens": ["error", "functions"],
|
|
387
|
+
"vue/no-restricted-syntax": [
|
|
388
|
+
"error",
|
|
389
|
+
"DebuggerStatement",
|
|
390
|
+
"LabeledStatement",
|
|
391
|
+
"WithStatement"
|
|
392
|
+
],
|
|
393
|
+
"vue/no-sparse-arrays": "error",
|
|
394
|
+
"vue/no-deprecated-model-definition": [
|
|
395
|
+
"error",
|
|
396
|
+
{
|
|
397
|
+
allowVue3Compat: true
|
|
398
|
+
}
|
|
399
|
+
],
|
|
400
|
+
"vue/object-curly-newline": [
|
|
401
|
+
"error",
|
|
402
|
+
{
|
|
403
|
+
multiline: true,
|
|
404
|
+
consistent: true
|
|
405
|
+
}
|
|
406
|
+
],
|
|
407
|
+
"vue/no-static-inline-styles": [
|
|
408
|
+
"error",
|
|
409
|
+
{
|
|
410
|
+
allowBinding: true
|
|
411
|
+
}
|
|
412
|
+
],
|
|
413
|
+
"vue/object-curly-spacing": ["error", "always"],
|
|
414
|
+
"vue/object-property-newline": [
|
|
415
|
+
"error",
|
|
416
|
+
{
|
|
417
|
+
allowMultiplePropertiesPerLine: true
|
|
418
|
+
}
|
|
419
|
+
],
|
|
420
|
+
"vue/object-shorthand": [
|
|
421
|
+
"error",
|
|
422
|
+
"always",
|
|
423
|
+
{
|
|
424
|
+
ignoreConstructors: false,
|
|
425
|
+
avoidQuotes: true
|
|
426
|
+
}
|
|
427
|
+
],
|
|
428
|
+
"vue/operator-linebreak": ["error", "before"],
|
|
429
|
+
"vue/prefer-template": "error",
|
|
430
|
+
"vue/prop-name-casing": ["error", "camelCase"],
|
|
431
|
+
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
432
|
+
"vue/space-in-parens": ["error", "never"],
|
|
433
|
+
"vue/space-infix-ops": "error",
|
|
434
|
+
"vue/space-unary-ops": [
|
|
435
|
+
"error",
|
|
436
|
+
{
|
|
437
|
+
words: true,
|
|
438
|
+
nonwords: false
|
|
439
|
+
}
|
|
440
|
+
],
|
|
441
|
+
"vue/template-curly-spacing": "error",
|
|
442
|
+
"vue/block-order": [
|
|
443
|
+
"error",
|
|
444
|
+
{
|
|
445
|
+
order: ["script", "template", "style"]
|
|
446
|
+
}
|
|
447
|
+
],
|
|
448
|
+
"vue/attributes-order": [
|
|
449
|
+
"error",
|
|
450
|
+
{
|
|
451
|
+
order: [
|
|
452
|
+
"EVENTS",
|
|
453
|
+
// `@click="functionCall"`, `v-on="event"`
|
|
454
|
+
"TWO_WAY_BINDING",
|
|
455
|
+
// `v-model`
|
|
456
|
+
"OTHER_DIRECTIVES",
|
|
457
|
+
// `v-custom-directive`
|
|
458
|
+
"LIST_RENDERING",
|
|
459
|
+
// `v-for item in items`
|
|
460
|
+
"CONDITIONALS",
|
|
461
|
+
// `v-if`, `v-show`, `v-cloak`
|
|
462
|
+
"CONTENT",
|
|
463
|
+
// `v-text`, `v-html`
|
|
464
|
+
"SLOT",
|
|
465
|
+
// `v-slot`, `slot`
|
|
466
|
+
"UNIQUE",
|
|
467
|
+
// `ref`, `key`
|
|
468
|
+
"DEFINITION",
|
|
469
|
+
// `is`, `v-is`
|
|
470
|
+
"ATTR_DYNAMIC",
|
|
471
|
+
// `v-bind:prop="foo"`, `:prop="foo"`
|
|
472
|
+
// `OTHER_ATTR`, // `custom-prop="foo"`, `:prop="foo"`, `disabled`
|
|
473
|
+
"RENDER_MODIFIERS",
|
|
474
|
+
// `v-once`, `v-pre`
|
|
475
|
+
"GLOBAL",
|
|
476
|
+
// `id`
|
|
477
|
+
"ATTR_STATIC",
|
|
478
|
+
// `prop="foo", `static attributes
|
|
479
|
+
"ATTR_SHORTHAND_BOOL"
|
|
480
|
+
// `disabled`, prop shorthand
|
|
481
|
+
],
|
|
482
|
+
alphabetical: false
|
|
483
|
+
}
|
|
484
|
+
],
|
|
485
|
+
"vue/order-in-components": [
|
|
486
|
+
"error",
|
|
487
|
+
{
|
|
488
|
+
order: [
|
|
489
|
+
"el",
|
|
490
|
+
"name",
|
|
491
|
+
"key",
|
|
492
|
+
"parent",
|
|
493
|
+
"functional",
|
|
494
|
+
["provide", "inject"],
|
|
495
|
+
["delimiters", "comments"],
|
|
496
|
+
["components", "directives", "filters"],
|
|
497
|
+
"extends",
|
|
498
|
+
"mixins",
|
|
499
|
+
"layout",
|
|
500
|
+
"middleware",
|
|
501
|
+
"validate",
|
|
502
|
+
"scrollToTop",
|
|
503
|
+
"transition",
|
|
504
|
+
"loading",
|
|
505
|
+
"inheritAttrs",
|
|
506
|
+
"model",
|
|
507
|
+
["props", "propsData"],
|
|
508
|
+
"emits",
|
|
509
|
+
"setup",
|
|
510
|
+
"asyncData",
|
|
511
|
+
"computed",
|
|
512
|
+
"data",
|
|
513
|
+
"fetch",
|
|
514
|
+
"head",
|
|
515
|
+
"methods",
|
|
516
|
+
["template", "render"],
|
|
517
|
+
"watch",
|
|
518
|
+
"watchQuery",
|
|
519
|
+
"LIFECYCLE_HOOKS",
|
|
520
|
+
"renderError",
|
|
521
|
+
"ROUTER_GUARDS"
|
|
522
|
+
]
|
|
523
|
+
}
|
|
524
|
+
],
|
|
525
|
+
"vue/max-attributes-per-line": [
|
|
526
|
+
"error",
|
|
527
|
+
{
|
|
528
|
+
singleline: 1,
|
|
529
|
+
multiline: 1
|
|
530
|
+
}
|
|
531
|
+
]
|
|
292
532
|
}
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
plugins: {
|
|
296
|
-
vue: import_eslint_plugin_vue.default
|
|
297
|
-
},
|
|
298
|
-
rules: isVue3 ? vue3Rules : vue2Rules
|
|
299
533
|
}
|
|
300
534
|
]);
|
|
301
535
|
|
|
@@ -308,11 +542,11 @@ var yml = (0, import_eslint_define_config3.defineFlatConfig)([
|
|
|
308
542
|
parser: parserYaml
|
|
309
543
|
},
|
|
310
544
|
plugins: {
|
|
311
|
-
yml:
|
|
545
|
+
yml: import_eslint_plugin_yml.default
|
|
312
546
|
},
|
|
313
547
|
rules: {
|
|
314
|
-
...
|
|
315
|
-
...
|
|
548
|
+
...import_eslint_plugin_yml.default.configs.standard.rules,
|
|
549
|
+
...import_eslint_plugin_yml.default.configs.prettier.rules,
|
|
316
550
|
"yml/no-empty-mapping-value": "off",
|
|
317
551
|
"yml/quotes": ["error", { avoidEscape: false, prefer: "single" }]
|
|
318
552
|
}
|
|
@@ -583,7 +817,7 @@ var import_eslint_define_config7 = require("eslint-define-config");
|
|
|
583
817
|
var imports = (0, import_eslint_define_config7.defineFlatConfig)([
|
|
584
818
|
{
|
|
585
819
|
plugins: {
|
|
586
|
-
import:
|
|
820
|
+
import: import_eslint_plugin_import_x.default
|
|
587
821
|
},
|
|
588
822
|
settings: {
|
|
589
823
|
"import/resolver": {
|
|
@@ -729,42 +963,28 @@ var prettier = (0, import_eslint_define_config10.defineFlatConfig)([
|
|
|
729
963
|
// src/configs/markdown.ts
|
|
730
964
|
var import_eslint_define_config11 = require("eslint-define-config");
|
|
731
965
|
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
|
-
},
|
|
966
|
+
...import_eslint_plugin_markdown.default.configs.recommended,
|
|
739
967
|
{
|
|
740
968
|
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
969
|
rules: {
|
|
752
|
-
...import_eslint_plugin_markdown.default.configs["recommended-legacy"].overrides[1].rules,
|
|
753
970
|
"no-undef": "off",
|
|
754
971
|
"no-alert": "off",
|
|
755
972
|
"no-console": "off",
|
|
756
973
|
"no-unused-vars": "off",
|
|
757
974
|
"no-unused-expressions": "off",
|
|
758
975
|
"no-restricted-imports": "off",
|
|
976
|
+
"node/prefer-global/buffer": "off",
|
|
977
|
+
"node/prefer-global/process": "off",
|
|
759
978
|
"import/no-unresolved": "off",
|
|
979
|
+
"unused-imports/no-unused-imports": "off",
|
|
980
|
+
"unused-imports/no-unused-vars": "off",
|
|
760
981
|
"@typescript-eslint/comma-dangle": "off",
|
|
761
982
|
"@typescript-eslint/no-redeclare": "off",
|
|
983
|
+
"@typescript-eslint/no-namespace": "off",
|
|
762
984
|
"@typescript-eslint/no-unused-vars": "off",
|
|
763
985
|
"@typescript-eslint/no-var-requires": "off",
|
|
764
986
|
"@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"
|
|
987
|
+
"@typescript-eslint/no-use-before-define": "off"
|
|
768
988
|
}
|
|
769
989
|
}
|
|
770
990
|
]);
|
|
@@ -1233,8 +1453,11 @@ function ntnyq(config = [], { vue: enableVue = false, unocss: enableUnoCSS = fal
|
|
|
1233
1453
|
comments,
|
|
1234
1454
|
common,
|
|
1235
1455
|
getVueVersion,
|
|
1456
|
+
hasTypeScript,
|
|
1457
|
+
hasVue,
|
|
1236
1458
|
ignores,
|
|
1237
1459
|
imports,
|
|
1460
|
+
interopDefault,
|
|
1238
1461
|
javascript,
|
|
1239
1462
|
jsonc,
|
|
1240
1463
|
jsx,
|
|
@@ -1242,7 +1465,6 @@ function ntnyq(config = [], { vue: enableVue = false, unocss: enableUnoCSS = fal
|
|
|
1242
1465
|
node,
|
|
1243
1466
|
ntnyq,
|
|
1244
1467
|
parserJsonc,
|
|
1245
|
-
parserTs,
|
|
1246
1468
|
parserVue,
|
|
1247
1469
|
parserYaml,
|
|
1248
1470
|
pluginComments,
|
|
@@ -1251,7 +1473,6 @@ function ntnyq(config = [], { vue: enableVue = false, unocss: enableUnoCSS = fal
|
|
|
1251
1473
|
pluginMarkdown,
|
|
1252
1474
|
pluginNode,
|
|
1253
1475
|
pluginPrettier,
|
|
1254
|
-
pluginTs,
|
|
1255
1476
|
pluginUnicorn,
|
|
1256
1477
|
pluginUnoCSS,
|
|
1257
1478
|
pluginVue,
|
|
@@ -1259,7 +1480,9 @@ function ntnyq(config = [], { vue: enableVue = false, unocss: enableUnoCSS = fal
|
|
|
1259
1480
|
prettier,
|
|
1260
1481
|
sortPackageJson,
|
|
1261
1482
|
sortTsConfig,
|
|
1483
|
+
tseslint,
|
|
1262
1484
|
typescript,
|
|
1485
|
+
typescriptCore,
|
|
1263
1486
|
unicorn,
|
|
1264
1487
|
unocss,
|
|
1265
1488
|
vue,
|
package/dist/index.d.cts
CHANGED
|
@@ -7,24 +7,23 @@ export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
|
7
7
|
export { default as pluginPrettier } from 'eslint-plugin-prettier';
|
|
8
8
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
9
9
|
export { default as pluginComments } from 'eslint-plugin-eslint-comments';
|
|
10
|
-
export { default as
|
|
11
|
-
import * as eslintPluginYml from 'eslint-plugin-yml';
|
|
12
|
-
export { eslintPluginYml as pluginYaml };
|
|
10
|
+
export { default as pluginYaml } from 'eslint-plugin-yml';
|
|
13
11
|
import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
|
|
14
12
|
export { eslintPluginJsonc as pluginJsonc };
|
|
15
|
-
|
|
16
|
-
export { eslintPluginImportX as pluginImport };
|
|
13
|
+
export { default as pluginImport } from 'eslint-plugin-import-x';
|
|
17
14
|
import * as yamlEslintParser from 'yaml-eslint-parser';
|
|
18
15
|
export { yamlEslintParser as parserYaml };
|
|
19
16
|
import * as vueEslintParser from 'vue-eslint-parser';
|
|
20
17
|
export { vueEslintParser as parserVue };
|
|
21
18
|
import * as jsoncEslintParser from 'jsonc-eslint-parser';
|
|
22
19
|
export { jsoncEslintParser as parserJsonc };
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
export { default as tseslint } from 'typescript-eslint';
|
|
21
|
+
|
|
22
|
+
declare const hasTypeScript: boolean;
|
|
23
|
+
declare const hasVue: boolean;
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
|
-
* @file
|
|
26
|
+
* @file globs constants
|
|
28
27
|
*/
|
|
29
28
|
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
30
29
|
declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
@@ -97,11 +96,20 @@ declare const comments: eslint_define_config.FlatESLintConfig[];
|
|
|
97
96
|
declare const javascript: eslint_define_config.FlatESLintConfig[];
|
|
98
97
|
declare const jsx: eslint_define_config.FlatESLintConfig[];
|
|
99
98
|
|
|
100
|
-
declare const
|
|
99
|
+
declare const typescriptCore: FlatESLintConfig[];
|
|
100
|
+
declare const typescript: FlatESLintConfig[];
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
103
|
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
|
|
104
104
|
*/
|
|
105
105
|
declare const ignores: eslint_define_config.FlatESLintConfig[];
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
/**
|
|
108
|
+
* @file plugins & parsers
|
|
109
|
+
*/
|
|
110
|
+
type InteropDefault<T> = T extends {
|
|
111
|
+
default: infer U;
|
|
112
|
+
} ? U : T;
|
|
113
|
+
declare function interopDefault<T>(m: T): InteropDefault<T>;
|
|
114
|
+
|
|
115
|
+
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropDefault, all, basic, comments, common, getVueVersion, hasTypeScript, hasVue, ignores, imports, interopDefault, javascript, jsonc, jsx, markdown, node, ntnyq, prettier, sortPackageJson, sortTsConfig, typescript, typescriptCore, unicorn, unocss, vue, yml };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,24 +7,23 @@ export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
|
7
7
|
export { default as pluginPrettier } from 'eslint-plugin-prettier';
|
|
8
8
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
9
9
|
export { default as pluginComments } from 'eslint-plugin-eslint-comments';
|
|
10
|
-
export { default as
|
|
11
|
-
import * as eslintPluginYml from 'eslint-plugin-yml';
|
|
12
|
-
export { eslintPluginYml as pluginYaml };
|
|
10
|
+
export { default as pluginYaml } from 'eslint-plugin-yml';
|
|
13
11
|
import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
|
|
14
12
|
export { eslintPluginJsonc as pluginJsonc };
|
|
15
|
-
|
|
16
|
-
export { eslintPluginImportX as pluginImport };
|
|
13
|
+
export { default as pluginImport } from 'eslint-plugin-import-x';
|
|
17
14
|
import * as yamlEslintParser from 'yaml-eslint-parser';
|
|
18
15
|
export { yamlEslintParser as parserYaml };
|
|
19
16
|
import * as vueEslintParser from 'vue-eslint-parser';
|
|
20
17
|
export { vueEslintParser as parserVue };
|
|
21
18
|
import * as jsoncEslintParser from 'jsonc-eslint-parser';
|
|
22
19
|
export { jsoncEslintParser as parserJsonc };
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
export { default as tseslint } from 'typescript-eslint';
|
|
21
|
+
|
|
22
|
+
declare const hasTypeScript: boolean;
|
|
23
|
+
declare const hasVue: boolean;
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
|
-
* @file
|
|
26
|
+
* @file globs constants
|
|
28
27
|
*/
|
|
29
28
|
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
30
29
|
declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
@@ -97,11 +96,20 @@ declare const comments: eslint_define_config.FlatESLintConfig[];
|
|
|
97
96
|
declare const javascript: eslint_define_config.FlatESLintConfig[];
|
|
98
97
|
declare const jsx: eslint_define_config.FlatESLintConfig[];
|
|
99
98
|
|
|
100
|
-
declare const
|
|
99
|
+
declare const typescriptCore: FlatESLintConfig[];
|
|
100
|
+
declare const typescript: FlatESLintConfig[];
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
103
|
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
|
|
104
104
|
*/
|
|
105
105
|
declare const ignores: eslint_define_config.FlatESLintConfig[];
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
/**
|
|
108
|
+
* @file plugins & parsers
|
|
109
|
+
*/
|
|
110
|
+
type InteropDefault<T> = T extends {
|
|
111
|
+
default: infer U;
|
|
112
|
+
} ? U : T;
|
|
113
|
+
declare function interopDefault<T>(m: T): InteropDefault<T>;
|
|
114
|
+
|
|
115
|
+
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropDefault, all, basic, comments, common, getVueVersion, hasTypeScript, hasVue, ignores, imports, interopDefault, javascript, jsonc, jsx, markdown, node, ntnyq, prettier, sortPackageJson, sortTsConfig, typescript, typescriptCore, unicorn, unocss, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/env.ts
|
|
2
|
+
import { isPackageExists } from "local-pkg";
|
|
3
|
+
var hasTypeScript = isPackageExists("typescript");
|
|
4
|
+
var hasVue = isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("@slidev/cli");
|
|
5
|
+
|
|
6
|
+
// src/globs.ts
|
|
2
7
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
3
8
|
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
4
9
|
var GLOB_JS = "**/*.?([cm])js";
|
|
@@ -44,19 +49,30 @@ var GLOB_EXCLUDE = [
|
|
|
44
49
|
"**/__snapshots__",
|
|
45
50
|
"**/auto-import?(s).d.ts",
|
|
46
51
|
"**/components.d.ts",
|
|
47
|
-
"**/output",
|
|
48
52
|
"**/coverage",
|
|
53
|
+
"**/fixtures",
|
|
54
|
+
"**/output",
|
|
55
|
+
"**/public",
|
|
56
|
+
"**/static",
|
|
49
57
|
"**/temp",
|
|
50
58
|
"**/cache",
|
|
51
|
-
"**/fixtures",
|
|
52
59
|
"**/.vitepress/cache",
|
|
60
|
+
"**/.eslintcache",
|
|
61
|
+
"**/.stylelintcache",
|
|
62
|
+
"**/.vite-inspect",
|
|
53
63
|
"**/.nuxt",
|
|
54
64
|
"**/.output",
|
|
65
|
+
"**/.tsup",
|
|
55
66
|
"**/.nitro",
|
|
56
67
|
"**/.vercel",
|
|
57
68
|
"**/.changeset",
|
|
58
69
|
"**/.npmrc",
|
|
59
|
-
"**/.yarnrc"
|
|
70
|
+
"**/.yarnrc",
|
|
71
|
+
// Force lint
|
|
72
|
+
"!.github",
|
|
73
|
+
"!.vitepress",
|
|
74
|
+
"!.vuepress",
|
|
75
|
+
"!.vscode"
|
|
60
76
|
];
|
|
61
77
|
|
|
62
78
|
// src/presets.ts
|
|
@@ -75,68 +91,68 @@ import { default as default5 } from "eslint-plugin-unicorn";
|
|
|
75
91
|
import { default as default6 } from "eslint-plugin-prettier";
|
|
76
92
|
import { default as default7 } from "eslint-plugin-markdown";
|
|
77
93
|
import { default as default8 } from "eslint-plugin-eslint-comments";
|
|
78
|
-
import
|
|
79
|
-
import
|
|
94
|
+
import tseslint from "typescript-eslint";
|
|
95
|
+
import { default as default9 } from "eslint-plugin-yml";
|
|
80
96
|
import * as pluginJsonc from "eslint-plugin-jsonc";
|
|
81
|
-
import
|
|
97
|
+
import { default as default10 } from "eslint-plugin-import-x";
|
|
82
98
|
import * as parserYaml from "yaml-eslint-parser";
|
|
83
99
|
import * as parserVue from "vue-eslint-parser";
|
|
84
100
|
import * as parserJsonc from "jsonc-eslint-parser";
|
|
85
|
-
|
|
101
|
+
// @__NO_SIDE_EFFECTS__
|
|
102
|
+
function interopDefault(m) {
|
|
103
|
+
return m.default || m;
|
|
104
|
+
}
|
|
86
105
|
|
|
87
106
|
// src/configs/typescript.ts
|
|
88
107
|
import { defineFlatConfig } from "eslint-define-config";
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
plugins: {
|
|
99
|
-
"@typescript-eslint": default9
|
|
100
|
-
},
|
|
101
|
-
rules: {
|
|
102
|
-
...default9.configs.recommended.rules,
|
|
103
|
-
...default9.configs.stylistic.rules,
|
|
104
|
-
"@typescript-eslint/no-unused-vars": "error",
|
|
105
|
-
"@typescript-eslint/no-redeclare": "error",
|
|
106
|
-
"@typescript-eslint/consistent-type-imports": [
|
|
107
|
-
"error",
|
|
108
|
-
{
|
|
109
|
-
prefer: "type-imports",
|
|
110
|
-
fixStyle: "separate-type-imports",
|
|
111
|
-
disallowTypeAnnotations: false
|
|
112
|
-
}
|
|
113
|
-
],
|
|
114
|
-
"@typescript-eslint/consistent-type-assertions": [
|
|
115
|
-
"error",
|
|
116
|
-
{
|
|
117
|
-
assertionStyle: "as",
|
|
118
|
-
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
119
|
-
}
|
|
120
|
-
],
|
|
121
|
-
"@typescript-eslint/prefer-as-const": "warn",
|
|
122
|
-
"@typescript-eslint/ban-types": "off",
|
|
123
|
-
"@typescript-eslint/camelcase": "off",
|
|
124
|
-
"@typescript-eslint/no-namespace": "off",
|
|
125
|
-
"@typescript-eslint/ban-ts-ignore": "off",
|
|
126
|
-
"@typescript-eslint/ban-ts-comment": "off",
|
|
127
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
128
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
129
|
-
"@typescript-eslint/naming-convention": "off",
|
|
130
|
-
"@typescript-eslint/no-empty-interface": "off",
|
|
131
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
132
|
-
"@typescript-eslint/triple-slash-reference": "off",
|
|
133
|
-
"@typescript-eslint/no-parameter-properties": "off",
|
|
134
|
-
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
135
|
-
"@typescript-eslint/explicit-function-return-type": "off",
|
|
136
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
137
|
-
"@typescript-eslint/consistent-indexed-object-style": "off"
|
|
108
|
+
var typescriptCore = tseslint.config({
|
|
109
|
+
extends: [...tseslint.configs.recommended],
|
|
110
|
+
files: [GLOB_TS, GLOB_TSX],
|
|
111
|
+
languageOptions: {
|
|
112
|
+
parser: tseslint.parser,
|
|
113
|
+
parserOptions: {
|
|
114
|
+
sourceType: "module"
|
|
138
115
|
}
|
|
139
116
|
},
|
|
117
|
+
rules: {
|
|
118
|
+
"@typescript-eslint/no-unused-vars": "error",
|
|
119
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
120
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
121
|
+
"error",
|
|
122
|
+
{
|
|
123
|
+
prefer: "type-imports",
|
|
124
|
+
fixStyle: "separate-type-imports",
|
|
125
|
+
disallowTypeAnnotations: false
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
129
|
+
"error",
|
|
130
|
+
{
|
|
131
|
+
assertionStyle: "as",
|
|
132
|
+
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"@typescript-eslint/prefer-as-const": "warn",
|
|
136
|
+
"@typescript-eslint/ban-types": "off",
|
|
137
|
+
"@typescript-eslint/camelcase": "off",
|
|
138
|
+
"@typescript-eslint/no-namespace": "off",
|
|
139
|
+
"@typescript-eslint/ban-ts-ignore": "off",
|
|
140
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
141
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
142
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
143
|
+
"@typescript-eslint/naming-convention": "off",
|
|
144
|
+
"@typescript-eslint/no-empty-interface": "off",
|
|
145
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
146
|
+
"@typescript-eslint/triple-slash-reference": "off",
|
|
147
|
+
"@typescript-eslint/no-parameter-properties": "off",
|
|
148
|
+
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
149
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
150
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
151
|
+
"@typescript-eslint/consistent-indexed-object-style": "off"
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
var typescript = defineFlatConfig([
|
|
155
|
+
...typescriptCore,
|
|
140
156
|
{
|
|
141
157
|
files: ["**/*.d.ts"],
|
|
142
158
|
rules: {
|
|
@@ -152,7 +168,7 @@ var typescript = defineFlatConfig([
|
|
|
152
168
|
}
|
|
153
169
|
},
|
|
154
170
|
{
|
|
155
|
-
files: [
|
|
171
|
+
files: [GLOB_JS, "**/*.cjs"],
|
|
156
172
|
rules: {
|
|
157
173
|
"@typescript-eslint/no-var-requires": "off"
|
|
158
174
|
}
|
|
@@ -168,19 +184,28 @@ function getVueVersion() {
|
|
|
168
184
|
return 3;
|
|
169
185
|
}
|
|
170
186
|
var isVue3 = getVueVersion() === 3;
|
|
171
|
-
var vueBaseRules = {};
|
|
172
187
|
var vue2Rules = {
|
|
173
|
-
...
|
|
188
|
+
...default3.configs.base.rules,
|
|
189
|
+
...default3.configs.essential.rules,
|
|
190
|
+
...default3.configs["strongly-recommended"].rules,
|
|
191
|
+
...default3.configs.recommended.rules
|
|
174
192
|
};
|
|
175
193
|
var vue3Rules = {
|
|
176
|
-
...
|
|
194
|
+
...default3.configs.base.rules,
|
|
195
|
+
...default3.configs["vue3-essential"].rules,
|
|
196
|
+
...default3.configs["vue3-strongly-recommended"].rules,
|
|
197
|
+
...default3.configs["vue3-recommended"].rules
|
|
177
198
|
};
|
|
178
199
|
var vue = defineFlatConfig2([
|
|
200
|
+
...tseslint.config({
|
|
201
|
+
files: [GLOB_VUE],
|
|
202
|
+
extends: typescriptCore
|
|
203
|
+
}),
|
|
179
204
|
{
|
|
180
205
|
files: [GLOB_VUE],
|
|
181
206
|
plugins: {
|
|
182
207
|
vue: default3,
|
|
183
|
-
"@typescript-eslint":
|
|
208
|
+
"@typescript-eslint": tseslint.plugin
|
|
184
209
|
},
|
|
185
210
|
languageOptions: {
|
|
186
211
|
parser: parserVue,
|
|
@@ -195,14 +220,220 @@ var vue = defineFlatConfig2([
|
|
|
195
220
|
},
|
|
196
221
|
processor: default3.processors[".vue"],
|
|
197
222
|
rules: {
|
|
198
|
-
...
|
|
223
|
+
...isVue3 ? vue3Rules : vue2Rules,
|
|
224
|
+
// OFF
|
|
225
|
+
"vue/no-v-html": "off",
|
|
226
|
+
"vue/require-prop-types": "off",
|
|
227
|
+
"vue/require-default-prop": "off",
|
|
228
|
+
"vue/multi-word-component-names": "off",
|
|
229
|
+
"vue/no-setup-props-reactivity-loss": "off",
|
|
230
|
+
"vue/html-self-closing": [
|
|
231
|
+
"error",
|
|
232
|
+
{
|
|
233
|
+
html: {
|
|
234
|
+
void: "always",
|
|
235
|
+
normal: "always",
|
|
236
|
+
component: "always"
|
|
237
|
+
},
|
|
238
|
+
svg: "always",
|
|
239
|
+
math: "always"
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
"vue/block-tag-newline": [
|
|
243
|
+
"error",
|
|
244
|
+
{
|
|
245
|
+
singleline: "always",
|
|
246
|
+
multiline: "always"
|
|
247
|
+
}
|
|
248
|
+
],
|
|
249
|
+
"vue/component-name-in-template-casing": [
|
|
250
|
+
"error",
|
|
251
|
+
"PascalCase",
|
|
252
|
+
{
|
|
253
|
+
// Force auto-import components to be PascalCase
|
|
254
|
+
registeredComponentsOnly: false,
|
|
255
|
+
ignores: ["slot", "component"]
|
|
256
|
+
}
|
|
257
|
+
],
|
|
258
|
+
"vue/component-options-name-casing": ["error", "PascalCase"],
|
|
259
|
+
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
260
|
+
"vue/define-macros-order": [
|
|
261
|
+
"error",
|
|
262
|
+
{
|
|
263
|
+
order: ["defineProps", "defineEmits", "defineOptions", "defineSlots"]
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
"vue/html-comment-content-spacing": [
|
|
267
|
+
"error",
|
|
268
|
+
"always",
|
|
269
|
+
{
|
|
270
|
+
exceptions: ["-"]
|
|
271
|
+
}
|
|
272
|
+
],
|
|
273
|
+
"vue/array-bracket-spacing": ["error", "never"],
|
|
274
|
+
"vue/arrow-spacing": ["error", { before: true, after: true }],
|
|
275
|
+
"vue/block-spacing": ["error", "always"],
|
|
276
|
+
"vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
|
|
277
|
+
"vue/comma-dangle": ["error", "always-multiline"],
|
|
278
|
+
"vue/comma-spacing": ["error", { before: false, after: true }],
|
|
279
|
+
"vue/comma-style": ["error", "last"],
|
|
280
|
+
"vue/dot-location": ["error", "property"],
|
|
281
|
+
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
282
|
+
"vue/eqeqeq": ["error", "smart"],
|
|
283
|
+
"vue/key-spacing": ["error", { beforeColon: false, afterColon: true }],
|
|
284
|
+
"vue/keyword-spacing": ["error", { before: true, after: true }],
|
|
285
|
+
"vue/no-empty-pattern": "error",
|
|
286
|
+
"vue/no-loss-of-precision": "error",
|
|
287
|
+
"vue/no-irregular-whitespace": "error",
|
|
288
|
+
"vue/no-use-v-else-with-v-for": "error",
|
|
289
|
+
"vue/require-typed-object-prop": "error",
|
|
290
|
+
"vue/no-extra-parens": ["error", "functions"],
|
|
291
|
+
"vue/no-restricted-syntax": [
|
|
292
|
+
"error",
|
|
293
|
+
"DebuggerStatement",
|
|
294
|
+
"LabeledStatement",
|
|
295
|
+
"WithStatement"
|
|
296
|
+
],
|
|
297
|
+
"vue/no-sparse-arrays": "error",
|
|
298
|
+
"vue/no-deprecated-model-definition": [
|
|
299
|
+
"error",
|
|
300
|
+
{
|
|
301
|
+
allowVue3Compat: true
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
"vue/object-curly-newline": [
|
|
305
|
+
"error",
|
|
306
|
+
{
|
|
307
|
+
multiline: true,
|
|
308
|
+
consistent: true
|
|
309
|
+
}
|
|
310
|
+
],
|
|
311
|
+
"vue/no-static-inline-styles": [
|
|
312
|
+
"error",
|
|
313
|
+
{
|
|
314
|
+
allowBinding: true
|
|
315
|
+
}
|
|
316
|
+
],
|
|
317
|
+
"vue/object-curly-spacing": ["error", "always"],
|
|
318
|
+
"vue/object-property-newline": [
|
|
319
|
+
"error",
|
|
320
|
+
{
|
|
321
|
+
allowMultiplePropertiesPerLine: true
|
|
322
|
+
}
|
|
323
|
+
],
|
|
324
|
+
"vue/object-shorthand": [
|
|
325
|
+
"error",
|
|
326
|
+
"always",
|
|
327
|
+
{
|
|
328
|
+
ignoreConstructors: false,
|
|
329
|
+
avoidQuotes: true
|
|
330
|
+
}
|
|
331
|
+
],
|
|
332
|
+
"vue/operator-linebreak": ["error", "before"],
|
|
333
|
+
"vue/prefer-template": "error",
|
|
334
|
+
"vue/prop-name-casing": ["error", "camelCase"],
|
|
335
|
+
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
336
|
+
"vue/space-in-parens": ["error", "never"],
|
|
337
|
+
"vue/space-infix-ops": "error",
|
|
338
|
+
"vue/space-unary-ops": [
|
|
339
|
+
"error",
|
|
340
|
+
{
|
|
341
|
+
words: true,
|
|
342
|
+
nonwords: false
|
|
343
|
+
}
|
|
344
|
+
],
|
|
345
|
+
"vue/template-curly-spacing": "error",
|
|
346
|
+
"vue/block-order": [
|
|
347
|
+
"error",
|
|
348
|
+
{
|
|
349
|
+
order: ["script", "template", "style"]
|
|
350
|
+
}
|
|
351
|
+
],
|
|
352
|
+
"vue/attributes-order": [
|
|
353
|
+
"error",
|
|
354
|
+
{
|
|
355
|
+
order: [
|
|
356
|
+
"EVENTS",
|
|
357
|
+
// `@click="functionCall"`, `v-on="event"`
|
|
358
|
+
"TWO_WAY_BINDING",
|
|
359
|
+
// `v-model`
|
|
360
|
+
"OTHER_DIRECTIVES",
|
|
361
|
+
// `v-custom-directive`
|
|
362
|
+
"LIST_RENDERING",
|
|
363
|
+
// `v-for item in items`
|
|
364
|
+
"CONDITIONALS",
|
|
365
|
+
// `v-if`, `v-show`, `v-cloak`
|
|
366
|
+
"CONTENT",
|
|
367
|
+
// `v-text`, `v-html`
|
|
368
|
+
"SLOT",
|
|
369
|
+
// `v-slot`, `slot`
|
|
370
|
+
"UNIQUE",
|
|
371
|
+
// `ref`, `key`
|
|
372
|
+
"DEFINITION",
|
|
373
|
+
// `is`, `v-is`
|
|
374
|
+
"ATTR_DYNAMIC",
|
|
375
|
+
// `v-bind:prop="foo"`, `:prop="foo"`
|
|
376
|
+
// `OTHER_ATTR`, // `custom-prop="foo"`, `:prop="foo"`, `disabled`
|
|
377
|
+
"RENDER_MODIFIERS",
|
|
378
|
+
// `v-once`, `v-pre`
|
|
379
|
+
"GLOBAL",
|
|
380
|
+
// `id`
|
|
381
|
+
"ATTR_STATIC",
|
|
382
|
+
// `prop="foo", `static attributes
|
|
383
|
+
"ATTR_SHORTHAND_BOOL"
|
|
384
|
+
// `disabled`, prop shorthand
|
|
385
|
+
],
|
|
386
|
+
alphabetical: false
|
|
387
|
+
}
|
|
388
|
+
],
|
|
389
|
+
"vue/order-in-components": [
|
|
390
|
+
"error",
|
|
391
|
+
{
|
|
392
|
+
order: [
|
|
393
|
+
"el",
|
|
394
|
+
"name",
|
|
395
|
+
"key",
|
|
396
|
+
"parent",
|
|
397
|
+
"functional",
|
|
398
|
+
["provide", "inject"],
|
|
399
|
+
["delimiters", "comments"],
|
|
400
|
+
["components", "directives", "filters"],
|
|
401
|
+
"extends",
|
|
402
|
+
"mixins",
|
|
403
|
+
"layout",
|
|
404
|
+
"middleware",
|
|
405
|
+
"validate",
|
|
406
|
+
"scrollToTop",
|
|
407
|
+
"transition",
|
|
408
|
+
"loading",
|
|
409
|
+
"inheritAttrs",
|
|
410
|
+
"model",
|
|
411
|
+
["props", "propsData"],
|
|
412
|
+
"emits",
|
|
413
|
+
"setup",
|
|
414
|
+
"asyncData",
|
|
415
|
+
"computed",
|
|
416
|
+
"data",
|
|
417
|
+
"fetch",
|
|
418
|
+
"head",
|
|
419
|
+
"methods",
|
|
420
|
+
["template", "render"],
|
|
421
|
+
"watch",
|
|
422
|
+
"watchQuery",
|
|
423
|
+
"LIFECYCLE_HOOKS",
|
|
424
|
+
"renderError",
|
|
425
|
+
"ROUTER_GUARDS"
|
|
426
|
+
]
|
|
427
|
+
}
|
|
428
|
+
],
|
|
429
|
+
"vue/max-attributes-per-line": [
|
|
430
|
+
"error",
|
|
431
|
+
{
|
|
432
|
+
singleline: 1,
|
|
433
|
+
multiline: 1
|
|
434
|
+
}
|
|
435
|
+
]
|
|
199
436
|
}
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
plugins: {
|
|
203
|
-
vue: default3
|
|
204
|
-
},
|
|
205
|
-
rules: isVue3 ? vue3Rules : vue2Rules
|
|
206
437
|
}
|
|
207
438
|
]);
|
|
208
439
|
|
|
@@ -215,11 +446,11 @@ var yml = defineFlatConfig3([
|
|
|
215
446
|
parser: parserYaml
|
|
216
447
|
},
|
|
217
448
|
plugins: {
|
|
218
|
-
yml:
|
|
449
|
+
yml: default9
|
|
219
450
|
},
|
|
220
451
|
rules: {
|
|
221
|
-
...
|
|
222
|
-
...
|
|
452
|
+
...default9.configs.standard.rules,
|
|
453
|
+
...default9.configs.prettier.rules,
|
|
223
454
|
"yml/no-empty-mapping-value": "off",
|
|
224
455
|
"yml/quotes": ["error", { avoidEscape: false, prefer: "single" }]
|
|
225
456
|
}
|
|
@@ -490,7 +721,7 @@ import { defineFlatConfig as defineFlatConfig7 } from "eslint-define-config";
|
|
|
490
721
|
var imports = defineFlatConfig7([
|
|
491
722
|
{
|
|
492
723
|
plugins: {
|
|
493
|
-
import:
|
|
724
|
+
import: default10
|
|
494
725
|
},
|
|
495
726
|
settings: {
|
|
496
727
|
"import/resolver": {
|
|
@@ -636,42 +867,28 @@ var prettier = defineFlatConfig10([
|
|
|
636
867
|
// src/configs/markdown.ts
|
|
637
868
|
import { defineFlatConfig as defineFlatConfig11 } from "eslint-define-config";
|
|
638
869
|
var markdown = defineFlatConfig11([
|
|
639
|
-
|
|
640
|
-
files: [GLOB_MARKDOWN],
|
|
641
|
-
plugins: {
|
|
642
|
-
markdown: default7
|
|
643
|
-
},
|
|
644
|
-
processor: "markdown/markdown"
|
|
645
|
-
},
|
|
870
|
+
...default7.configs.recommended,
|
|
646
871
|
{
|
|
647
872
|
files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
|
|
648
|
-
languageOptions: {
|
|
649
|
-
parserOptions: {
|
|
650
|
-
ecmaFeatures: {
|
|
651
|
-
impliedStrict: true
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
},
|
|
655
|
-
plugins: {
|
|
656
|
-
"@typescript-eslint": default9
|
|
657
|
-
},
|
|
658
873
|
rules: {
|
|
659
|
-
...default7.configs["recommended-legacy"].overrides[1].rules,
|
|
660
874
|
"no-undef": "off",
|
|
661
875
|
"no-alert": "off",
|
|
662
876
|
"no-console": "off",
|
|
663
877
|
"no-unused-vars": "off",
|
|
664
878
|
"no-unused-expressions": "off",
|
|
665
879
|
"no-restricted-imports": "off",
|
|
880
|
+
"node/prefer-global/buffer": "off",
|
|
881
|
+
"node/prefer-global/process": "off",
|
|
666
882
|
"import/no-unresolved": "off",
|
|
883
|
+
"unused-imports/no-unused-imports": "off",
|
|
884
|
+
"unused-imports/no-unused-vars": "off",
|
|
667
885
|
"@typescript-eslint/comma-dangle": "off",
|
|
668
886
|
"@typescript-eslint/no-redeclare": "off",
|
|
887
|
+
"@typescript-eslint/no-namespace": "off",
|
|
669
888
|
"@typescript-eslint/no-unused-vars": "off",
|
|
670
889
|
"@typescript-eslint/no-var-requires": "off",
|
|
671
890
|
"@typescript-eslint/no-extraneous-class": "off",
|
|
672
|
-
"@typescript-eslint/no-use-before-define": "off"
|
|
673
|
-
"unused-imports/no-unused-imports": "off",
|
|
674
|
-
"unused-imports/no-unused-vars": "off"
|
|
891
|
+
"@typescript-eslint/no-use-before-define": "off"
|
|
675
892
|
}
|
|
676
893
|
}
|
|
677
894
|
]);
|
|
@@ -1139,8 +1356,11 @@ export {
|
|
|
1139
1356
|
comments,
|
|
1140
1357
|
common,
|
|
1141
1358
|
getVueVersion,
|
|
1359
|
+
hasTypeScript,
|
|
1360
|
+
hasVue,
|
|
1142
1361
|
ignores,
|
|
1143
1362
|
imports,
|
|
1363
|
+
interopDefault,
|
|
1144
1364
|
javascript,
|
|
1145
1365
|
jsonc,
|
|
1146
1366
|
jsx,
|
|
@@ -1148,24 +1368,24 @@ export {
|
|
|
1148
1368
|
node,
|
|
1149
1369
|
ntnyq,
|
|
1150
1370
|
parserJsonc,
|
|
1151
|
-
parserTs,
|
|
1152
1371
|
parserVue,
|
|
1153
1372
|
parserYaml,
|
|
1154
1373
|
default8 as pluginComments,
|
|
1155
|
-
pluginImport,
|
|
1374
|
+
default10 as pluginImport,
|
|
1156
1375
|
pluginJsonc,
|
|
1157
1376
|
default7 as pluginMarkdown,
|
|
1158
1377
|
default2 as pluginNode,
|
|
1159
1378
|
default6 as pluginPrettier,
|
|
1160
|
-
default9 as pluginTs,
|
|
1161
1379
|
default5 as pluginUnicorn,
|
|
1162
1380
|
default4 as pluginUnoCSS,
|
|
1163
1381
|
default3 as pluginVue,
|
|
1164
|
-
pluginYaml,
|
|
1382
|
+
default9 as pluginYaml,
|
|
1165
1383
|
prettier,
|
|
1166
1384
|
sortPackageJson,
|
|
1167
1385
|
sortTsConfig,
|
|
1386
|
+
tseslint,
|
|
1168
1387
|
typescript,
|
|
1388
|
+
typescriptCore,
|
|
1169
1389
|
unicorn,
|
|
1170
1390
|
unocss,
|
|
1171
1391
|
vue,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.27",
|
|
5
5
|
"description": "ESLint flat config of ntnyq",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"eslint",
|
|
@@ -51,10 +51,8 @@
|
|
|
51
51
|
"eslint": "^8.57.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@eslint/js": "^9.
|
|
55
|
-
"@
|
|
56
|
-
"@typescript-eslint/parser": "^7.7.0",
|
|
57
|
-
"@unocss/eslint-plugin": "^0.59.3",
|
|
54
|
+
"@eslint/js": "^9.1.1",
|
|
55
|
+
"@unocss/eslint-plugin": "^0.59.4",
|
|
58
56
|
"eslint-config-prettier": "^9.1.0",
|
|
59
57
|
"eslint-define-config": "^2.1.0",
|
|
60
58
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
@@ -70,6 +68,7 @@
|
|
|
70
68
|
"jsonc-eslint-parser": "^2.4.0",
|
|
71
69
|
"local-pkg": "^0.5.0",
|
|
72
70
|
"prettier": "^3.2.5",
|
|
71
|
+
"typescript-eslint": "^7.7.1",
|
|
73
72
|
"vue-eslint-parser": "^9.4.2",
|
|
74
73
|
"yaml-eslint-parser": "^1.2.2"
|
|
75
74
|
},
|
|
@@ -77,10 +76,10 @@
|
|
|
77
76
|
"@ntnyq/prettier-config": "^1.21.2",
|
|
78
77
|
"@types/node": "^20.12.7",
|
|
79
78
|
"bumpp": "^9.4.0",
|
|
80
|
-
"eslint": "^9.
|
|
79
|
+
"eslint": "^9.1.1",
|
|
81
80
|
"husky": "^9.0.11",
|
|
82
81
|
"nano-staged": "^0.8.0",
|
|
83
|
-
"npm-run-
|
|
82
|
+
"npm-run-all2": "^6.1.2",
|
|
84
83
|
"rimraf": "^5.0.5",
|
|
85
84
|
"tsup": "^8.0.2",
|
|
86
85
|
"typescript": "^5.4.5"
|