@ntnyq/eslint-config 4.0.0-beta.9 → 4.0.1
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/README.md +40 -8
- package/dist/{index.d.ts → index.d.mts} +469 -255
- package/dist/{index.js → index.mjs} +517 -554
- package/package.json +42 -47
|
@@ -1,19 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
2
|
+
import { mergeProcessors, processorPassThrough } from 'eslint-merge-processors';
|
|
3
|
+
export { mergeProcessors, processorPassThrough } from 'eslint-merge-processors';
|
|
4
|
+
import { plugin, parser, configs } from 'typescript-eslint';
|
|
5
|
+
export { configs as configsTypeScript, parser as parserTypeScript, plugin as pluginTypeScript } from 'typescript-eslint';
|
|
6
|
+
import * as parserVue from 'vue-eslint-parser';
|
|
7
|
+
export { parserVue };
|
|
8
|
+
import * as parserToml from 'toml-eslint-parser';
|
|
9
|
+
export { parserToml };
|
|
10
|
+
import * as parserYaml from 'yaml-eslint-parser';
|
|
11
|
+
export { parserYaml };
|
|
12
|
+
import * as parserJsonc from 'jsonc-eslint-parser';
|
|
13
|
+
export { parserJsonc };
|
|
14
|
+
import * as pluginDepend from 'eslint-plugin-depend';
|
|
15
|
+
export { pluginDepend };
|
|
16
|
+
import * as pluginRegexp from 'eslint-plugin-regexp';
|
|
17
|
+
export { pluginRegexp };
|
|
18
|
+
import pluginNode from 'eslint-plugin-n';
|
|
19
|
+
export { default as pluginNode } from 'eslint-plugin-n';
|
|
20
|
+
import pluginVue from 'eslint-plugin-vue';
|
|
21
|
+
export { default as pluginVue } from 'eslint-plugin-vue';
|
|
22
|
+
import pluginYml from 'eslint-plugin-yml';
|
|
23
|
+
export { default as pluginYml } from 'eslint-plugin-yml';
|
|
24
|
+
import pluginPnpm from 'eslint-plugin-pnpm';
|
|
25
|
+
export { default as pluginPnpm } from 'eslint-plugin-pnpm';
|
|
26
|
+
import pluginSvgo from 'eslint-plugin-svgo';
|
|
27
|
+
export { default as pluginSvgo } from 'eslint-plugin-svgo';
|
|
28
|
+
import pluginToml from 'eslint-plugin-toml';
|
|
29
|
+
export { default as pluginToml } from 'eslint-plugin-toml';
|
|
30
|
+
import pluginMarkdown from '@eslint/markdown';
|
|
31
|
+
export { default as pluginMarkdown } from '@eslint/markdown';
|
|
32
|
+
import pluginAntfu from 'eslint-plugin-antfu';
|
|
33
|
+
export { default as pluginAntfu } from 'eslint-plugin-antfu';
|
|
34
|
+
import pluginJsdoc from 'eslint-plugin-jsdoc';
|
|
35
|
+
export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
|
|
36
|
+
import pluginJsonc from 'eslint-plugin-jsonc';
|
|
37
|
+
export { default as pluginJsonc } from 'eslint-plugin-jsonc';
|
|
38
|
+
import pluginNtnyq from 'eslint-plugin-ntnyq';
|
|
39
|
+
export { default as pluginNtnyq } from 'eslint-plugin-ntnyq';
|
|
40
|
+
import pluginPinia from 'eslint-plugin-pinia';
|
|
41
|
+
export { default as pluginPinia } from 'eslint-plugin-pinia';
|
|
42
|
+
import pluginUnoCSS from '@unocss/eslint-plugin';
|
|
43
|
+
export { default as pluginUnoCSS } from '@unocss/eslint-plugin';
|
|
44
|
+
import pluginVitest from '@vitest/eslint-plugin';
|
|
45
|
+
export { default as pluginVitest } from '@vitest/eslint-plugin';
|
|
46
|
+
import pluginUnicorn from 'eslint-plugin-unicorn';
|
|
47
|
+
export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
48
|
+
import pluginImportX from 'eslint-plugin-import-x';
|
|
49
|
+
export { default as pluginImportX } from 'eslint-plugin-import-x';
|
|
50
|
+
import pluginPrettier from 'eslint-plugin-prettier';
|
|
51
|
+
export { default as pluginPrettier } from 'eslint-plugin-prettier';
|
|
52
|
+
import pluginDeMorgan from 'eslint-plugin-de-morgan';
|
|
53
|
+
export { default as pluginDeMorgan } from 'eslint-plugin-de-morgan';
|
|
54
|
+
import pluginNoOnlyTests from 'eslint-plugin-no-only-tests';
|
|
55
|
+
export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests';
|
|
56
|
+
import { createConfig } from 'eslint-plugin-github-action';
|
|
57
|
+
export { default as pluginGitHubAction } from 'eslint-plugin-github-action';
|
|
58
|
+
import pluginPerfectionist from 'eslint-plugin-perfectionist';
|
|
59
|
+
export { default as pluginPerfectionist } from 'eslint-plugin-perfectionist';
|
|
60
|
+
import pluginComments from '@eslint-community/eslint-plugin-eslint-comments';
|
|
61
|
+
export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments';
|
|
62
|
+
import processorVueBlocks from 'eslint-processor-vue-blocks';
|
|
63
|
+
export { default as processorVueBlocks } from 'eslint-processor-vue-blocks';
|
|
64
|
+
import { resolve } from 'node:path';
|
|
65
|
+
import process from 'node:process';
|
|
66
|
+
import { isPackageExists } from 'local-pkg';
|
|
67
|
+
import { fileURLToPath } from 'node:url';
|
|
68
|
+
import { defineCommand, builtinCommands } from 'eslint-plugin-command/commands';
|
|
69
|
+
import createCommandConfig from 'eslint-plugin-command/config';
|
|
70
|
+
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
|
|
71
|
+
import globals from 'globals';
|
|
72
|
+
import createGitIgnoreConfig from 'eslint-config-flat-gitignore';
|
|
73
|
+
import jsConfig from '@eslint/js';
|
|
3
74
|
|
|
4
|
-
|
|
5
|
-
import { mergeProcessors as mergeProcessors2 } from "eslint-merge-processors";
|
|
6
|
-
|
|
7
|
-
// src/eslint/configs.ts
|
|
8
|
-
import { configs } from "typescript-eslint";
|
|
9
|
-
|
|
10
|
-
// src/eslint/parsers.ts
|
|
11
|
-
import * as parserVue from "vue-eslint-parser";
|
|
12
|
-
import * as parserToml from "toml-eslint-parser";
|
|
13
|
-
import * as parserYaml from "yaml-eslint-parser";
|
|
14
|
-
import * as parserJsonc from "jsonc-eslint-parser";
|
|
15
|
-
import { parser } from "typescript-eslint";
|
|
16
|
-
var parserPlain = {
|
|
75
|
+
const parserPlain = {
|
|
17
76
|
meta: {
|
|
18
77
|
name: "plain-eslint-parser"
|
|
19
78
|
},
|
|
@@ -34,86 +93,56 @@ var parserPlain = {
|
|
|
34
93
|
})
|
|
35
94
|
};
|
|
36
95
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
import { plugin } from "typescript-eslint";
|
|
53
|
-
import { default as default14 } from "@unocss/eslint-plugin";
|
|
54
|
-
import { default as default15 } from "@vitest/eslint-plugin";
|
|
55
|
-
import { default as default16 } from "eslint-plugin-unicorn";
|
|
56
|
-
import { default as default17 } from "eslint-plugin-import-x";
|
|
57
|
-
import { default as default18 } from "eslint-plugin-prettier";
|
|
58
|
-
import { default as default19 } from "eslint-plugin-de-morgan";
|
|
59
|
-
import { default as default20 } from "eslint-plugin-no-only-tests";
|
|
60
|
-
import { default as default21 } from "eslint-plugin-github-action";
|
|
61
|
-
import { default as default22 } from "eslint-plugin-perfectionist";
|
|
62
|
-
import { default as default23 } from "eslint-plugin-unused-imports";
|
|
63
|
-
import { default as default24 } from "@eslint-community/eslint-plugin-eslint-comments";
|
|
64
|
-
|
|
65
|
-
// src/eslint/resolvers.ts
|
|
66
|
-
import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
|
|
67
|
-
var createNodeResolver = default17.createNodeResolver;
|
|
68
|
-
|
|
69
|
-
// src/eslint/processors.ts
|
|
70
|
-
import { default as default25 } from "eslint-processor-vue-blocks";
|
|
71
|
-
import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
72
|
-
|
|
73
|
-
// src/globs.ts
|
|
74
|
-
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
75
|
-
var GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;
|
|
76
|
-
var GLOB_JS = "**/*.?([cm])js";
|
|
77
|
-
var GLOB_JSX = `${GLOB_JS}x`;
|
|
78
|
-
var GLOB_JSX_ONLY = "**/*.jsx";
|
|
79
|
-
var GLOB_TS = "**/*.?([cm])ts";
|
|
80
|
-
var GLOB_TSX = `${GLOB_TS}x`;
|
|
81
|
-
var GLOB_TSX_ONLY = "**/*.tsx";
|
|
82
|
-
var GLOB_DTS = "**/*.d.?([cm])ts";
|
|
83
|
-
var GLOB_TYPES = [GLOB_DTS, `**/types/${GLOB_TS}`, `**/types.ts`];
|
|
84
|
-
var GLOB_TYPE_TEST = [
|
|
96
|
+
const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
97
|
+
const GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;
|
|
98
|
+
const GLOB_JS = "**/*.?([cm])js";
|
|
99
|
+
const GLOB_JSX = `${GLOB_JS}x`;
|
|
100
|
+
const GLOB_JSX_ONLY = "**/*.jsx";
|
|
101
|
+
const GLOB_TS = "**/*.?([cm])ts";
|
|
102
|
+
const GLOB_TSX = `${GLOB_TS}x`;
|
|
103
|
+
const GLOB_TSX_ONLY = "**/*.tsx";
|
|
104
|
+
const GLOB_DTS = "**/*.d.?([cm])ts";
|
|
105
|
+
const GLOB_TYPES = [
|
|
106
|
+
GLOB_DTS,
|
|
107
|
+
`**/types/${GLOB_TS}`,
|
|
108
|
+
`**/types.ts`
|
|
109
|
+
];
|
|
110
|
+
const GLOB_TYPE_TEST = [
|
|
85
111
|
`**/*.test-d.${GLOB_SRC_EXT}`,
|
|
86
112
|
`**/*.spec-d.${GLOB_SRC_EXT}`
|
|
87
113
|
];
|
|
88
|
-
|
|
114
|
+
const GLOB_TEST = [
|
|
89
115
|
`**/*.test.${GLOB_SRC_EXT}`,
|
|
90
116
|
`**/*.spec.${GLOB_SRC_EXT}`,
|
|
91
117
|
`**/*.bench.${GLOB_SRC_EXT}`,
|
|
92
118
|
`**/*.benchmark.${GLOB_SRC_EXT}`,
|
|
93
119
|
...GLOB_TYPE_TEST
|
|
94
120
|
];
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
121
|
+
const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
122
|
+
const GLOB_CSS = "**/*.css";
|
|
123
|
+
const GLOB_LESS = "**/*.less";
|
|
124
|
+
const GLOB_SCSS = "**/*.scss";
|
|
125
|
+
const GLOB_POSTCSS = "**/*.{p,post}css";
|
|
126
|
+
const GLOB_JSON = "**/*.json";
|
|
127
|
+
const GLOB_JSON5 = "**/*.json5";
|
|
128
|
+
const GLOB_JSONC = "**/*.jsonc";
|
|
129
|
+
const GLOB_PACKAGE_JSON = "**/package.json";
|
|
130
|
+
const GLOB_TSCONFIG_JSON = [
|
|
131
|
+
"**/tsconfig.json",
|
|
132
|
+
"**/tsconfig.*.json"
|
|
133
|
+
];
|
|
134
|
+
const GLOB_SVG = "**/*.svg";
|
|
135
|
+
const GLOB_VUE = "**/*.vue";
|
|
136
|
+
const GLOB_YAML = "**/*.y?(a)ml";
|
|
137
|
+
const GLOB_TOML = "**/*.toml";
|
|
138
|
+
const GLOB_HTML = "**/*.htm?(l)";
|
|
139
|
+
const GLOB_ASTRO = "**/*.astro";
|
|
140
|
+
const GLOB_ASTRO_TS = "**/*.astro/*.ts";
|
|
141
|
+
const GLOB_SVELTE = "**/*.svelte";
|
|
142
|
+
const GLOB_MARKDOWN = "**/*.md";
|
|
143
|
+
const GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
144
|
+
const GLOB_MARKDOWN_NESTED = `${GLOB_MARKDOWN}/*.md`;
|
|
145
|
+
const GLOB_ALL_SRC = [
|
|
117
146
|
GLOB_SRC,
|
|
118
147
|
GLOB_STYLE,
|
|
119
148
|
GLOB_JSON,
|
|
@@ -124,18 +153,18 @@ var GLOB_ALL_SRC = [
|
|
|
124
153
|
GLOB_HTML,
|
|
125
154
|
GLOB_MARKDOWN
|
|
126
155
|
];
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
156
|
+
const GLOB_PINIA_STORE = `**/store?(s)/*.${GLOB_SRC_EXT}`;
|
|
157
|
+
const GLOB_GITHUB_ACTION = "**/.github/workflows/*.y?(a)ml";
|
|
158
|
+
const GLOB_NODE_MODULES = "**/node_modules/**";
|
|
159
|
+
const GLOB_DIST = "**/dist/**";
|
|
160
|
+
const GLOB_LOCKFILE = [
|
|
132
161
|
"**/package-lock.json",
|
|
133
162
|
"**/yarn.lock",
|
|
134
163
|
"**/pnpm-lock.yaml",
|
|
135
164
|
"**/bun.lock?(b)",
|
|
136
165
|
"**/deno.lock"
|
|
137
166
|
];
|
|
138
|
-
|
|
167
|
+
const GLOB_EXCLUDE = [
|
|
139
168
|
GLOB_NODE_MODULES,
|
|
140
169
|
GLOB_DIST,
|
|
141
170
|
...GLOB_LOCKFILE,
|
|
@@ -184,14 +213,13 @@ var GLOB_EXCLUDE = [
|
|
|
184
213
|
"**/src-tauri/target"
|
|
185
214
|
];
|
|
186
215
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
...
|
|
190
|
-
...
|
|
191
|
-
...
|
|
192
|
-
...default3.configs["vue3-recommended"].rules
|
|
216
|
+
const sharedRules = {
|
|
217
|
+
...pluginVue.configs.base.rules,
|
|
218
|
+
...pluginVue.configs.essential.rules,
|
|
219
|
+
...pluginVue.configs["strongly-recommended"].rules,
|
|
220
|
+
...pluginVue.configs.recommended.rules
|
|
193
221
|
};
|
|
194
|
-
|
|
222
|
+
const disabledRules$1 = {
|
|
195
223
|
"vue/multi-word-component-names": "off",
|
|
196
224
|
"vue/no-setup-props-reactivity-loss": "off",
|
|
197
225
|
"vue/no-v-html": "off",
|
|
@@ -199,7 +227,7 @@ var disabledRules = {
|
|
|
199
227
|
"vue/require-default-prop": "off",
|
|
200
228
|
"vue/require-prop-types": "off"
|
|
201
229
|
};
|
|
202
|
-
|
|
230
|
+
const extensionRules = {
|
|
203
231
|
"vue/array-bracket-spacing": ["error", "never"],
|
|
204
232
|
"vue/arrow-spacing": ["error", { after: true, before: true }],
|
|
205
233
|
"vue/block-spacing": ["error", "always"],
|
|
@@ -259,7 +287,7 @@ var extensionRules = {
|
|
|
259
287
|
],
|
|
260
288
|
"vue/template-curly-spacing": "error"
|
|
261
289
|
};
|
|
262
|
-
|
|
290
|
+
const unCategorizedRules = {
|
|
263
291
|
"vue/block-order": [
|
|
264
292
|
"error",
|
|
265
293
|
{
|
|
@@ -388,15 +416,18 @@ var unCategorizedRules = {
|
|
|
388
416
|
"vue/v-for-delimiter-style": ["error", "in"],
|
|
389
417
|
"vue/valid-define-options": "error"
|
|
390
418
|
};
|
|
391
|
-
|
|
392
|
-
const {
|
|
419
|
+
const configVue = (options = {}) => {
|
|
420
|
+
const {
|
|
421
|
+
files = [GLOB_VUE],
|
|
422
|
+
extraFileExtensions = []
|
|
423
|
+
} = options;
|
|
393
424
|
const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
|
|
394
425
|
function getVueProcessor() {
|
|
395
|
-
const processorVueSFC =
|
|
426
|
+
const processorVueSFC = pluginVue.processors[".vue"];
|
|
396
427
|
if (!sfcBlocks) return processorVueSFC;
|
|
397
|
-
return
|
|
428
|
+
return mergeProcessors([
|
|
398
429
|
processorVueSFC,
|
|
399
|
-
|
|
430
|
+
processorVueBlocks({
|
|
400
431
|
...sfcBlocks,
|
|
401
432
|
blocks: {
|
|
402
433
|
styles: true,
|
|
@@ -410,7 +441,7 @@ var configVue = (options = {}) => {
|
|
|
410
441
|
name: "ntnyq/vue/setup",
|
|
411
442
|
plugins: {
|
|
412
443
|
"@typescript-eslint": plugin,
|
|
413
|
-
vue:
|
|
444
|
+
vue: pluginVue
|
|
414
445
|
}
|
|
415
446
|
},
|
|
416
447
|
{
|
|
@@ -421,8 +452,8 @@ var configVue = (options = {}) => {
|
|
|
421
452
|
parser: parserVue,
|
|
422
453
|
parserOptions: {
|
|
423
454
|
ecmaVersion: "latest",
|
|
424
|
-
extraFileExtensions
|
|
425
|
-
parser,
|
|
455
|
+
extraFileExtensions,
|
|
456
|
+
parser: parser,
|
|
426
457
|
sourceType: "module",
|
|
427
458
|
ecmaFeatures: {
|
|
428
459
|
jsx: true
|
|
@@ -510,6 +541,8 @@ var configVue = (options = {}) => {
|
|
|
510
541
|
"inheritAttrs",
|
|
511
542
|
"model",
|
|
512
543
|
["props", "propsData"],
|
|
544
|
+
"slots",
|
|
545
|
+
"expose",
|
|
513
546
|
"emits",
|
|
514
547
|
"setup",
|
|
515
548
|
"asyncData",
|
|
@@ -529,7 +562,7 @@ var configVue = (options = {}) => {
|
|
|
529
562
|
],
|
|
530
563
|
"vue/prop-name-casing": ["error", "camelCase"],
|
|
531
564
|
"vue/this-in-template": ["error", "never"],
|
|
532
|
-
...disabledRules,
|
|
565
|
+
...disabledRules$1,
|
|
533
566
|
...extensionRules,
|
|
534
567
|
...unCategorizedRules,
|
|
535
568
|
// Overrides rules
|
|
@@ -539,22 +572,21 @@ var configVue = (options = {}) => {
|
|
|
539
572
|
];
|
|
540
573
|
};
|
|
541
574
|
|
|
542
|
-
|
|
543
|
-
var configYml = (options = {}) => {
|
|
575
|
+
const configYml = (options = {}) => {
|
|
544
576
|
const { files = [GLOB_YAML] } = options;
|
|
545
577
|
return [
|
|
546
578
|
{
|
|
547
579
|
name: "ntnyq/yml",
|
|
548
580
|
files,
|
|
549
581
|
plugins: {
|
|
550
|
-
yml:
|
|
582
|
+
yml: pluginYml
|
|
551
583
|
},
|
|
552
584
|
languageOptions: {
|
|
553
585
|
parser: parserYaml
|
|
554
586
|
},
|
|
555
587
|
rules: {
|
|
556
|
-
...
|
|
557
|
-
...
|
|
588
|
+
...pluginYml.configs.standard.rules,
|
|
589
|
+
...pluginYml.configs.prettier.rules,
|
|
558
590
|
"yml/no-empty-mapping-value": "off",
|
|
559
591
|
"yml/quotes": ["error", { avoidEscape: false, prefer: "single" }],
|
|
560
592
|
// Overrides rules
|
|
@@ -564,12 +596,11 @@ var configYml = (options = {}) => {
|
|
|
564
596
|
];
|
|
565
597
|
};
|
|
566
598
|
|
|
567
|
-
|
|
568
|
-
var configNode = (options = {}) => [
|
|
599
|
+
const configNode = (options = {}) => [
|
|
569
600
|
{
|
|
570
601
|
name: "ntnyq/node",
|
|
571
602
|
plugins: {
|
|
572
|
-
node:
|
|
603
|
+
node: pluginNode
|
|
573
604
|
},
|
|
574
605
|
rules: {
|
|
575
606
|
"node/handle-callback-err": ["error", "^(err|error)$"],
|
|
@@ -586,9 +617,35 @@ var configNode = (options = {}) => [
|
|
|
586
617
|
}
|
|
587
618
|
];
|
|
588
619
|
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
620
|
+
const configPnpm = (options = {}) => {
|
|
621
|
+
const { files = [GLOB_PACKAGE_JSON] } = options;
|
|
622
|
+
return [
|
|
623
|
+
{
|
|
624
|
+
name: "ntnyq/pnpm",
|
|
625
|
+
files,
|
|
626
|
+
plugins: {
|
|
627
|
+
pnpm: pluginPnpm
|
|
628
|
+
},
|
|
629
|
+
languageOptions: {
|
|
630
|
+
parser: parserJsonc
|
|
631
|
+
},
|
|
632
|
+
rules: {
|
|
633
|
+
"pnpm/enforce-catalog": [
|
|
634
|
+
"error",
|
|
635
|
+
{
|
|
636
|
+
autofix: true
|
|
637
|
+
}
|
|
638
|
+
],
|
|
639
|
+
"pnpm/valid-catalog": "error",
|
|
640
|
+
// Overrides rules
|
|
641
|
+
...options.overrides
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
];
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
const configSort = (options = {}) => {
|
|
648
|
+
const configs = [];
|
|
592
649
|
const {
|
|
593
650
|
additionalJsonFiles = [],
|
|
594
651
|
additionalYamlFiles = [],
|
|
@@ -598,7 +655,7 @@ var configSort = (options = {}) => {
|
|
|
598
655
|
tsconfig: enableSortTsconfig = true
|
|
599
656
|
} = options;
|
|
600
657
|
if (enableSortTsconfig) {
|
|
601
|
-
|
|
658
|
+
configs.push({
|
|
602
659
|
name: "ntnyq/sort/tsconfig",
|
|
603
660
|
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
604
661
|
rules: {
|
|
@@ -614,7 +671,13 @@ var configSort = (options = {}) => {
|
|
|
614
671
|
"include",
|
|
615
672
|
"exclude",
|
|
616
673
|
// vue.volar
|
|
617
|
-
"vueCompilerOptions"
|
|
674
|
+
"vueCompilerOptions",
|
|
675
|
+
// Unknown fields
|
|
676
|
+
{
|
|
677
|
+
order: {
|
|
678
|
+
type: "asc"
|
|
679
|
+
}
|
|
680
|
+
}
|
|
618
681
|
]
|
|
619
682
|
},
|
|
620
683
|
{
|
|
@@ -658,6 +721,8 @@ var configSort = (options = {}) => {
|
|
|
658
721
|
"resolveJsonModule",
|
|
659
722
|
"allowArbitraryExtensions",
|
|
660
723
|
"noResolve",
|
|
724
|
+
"erasableSyntaxOnly",
|
|
725
|
+
"libReplacement",
|
|
661
726
|
/* JavaScript Support */
|
|
662
727
|
"allowJs",
|
|
663
728
|
"checkJs",
|
|
@@ -687,6 +752,7 @@ var configSort = (options = {}) => {
|
|
|
687
752
|
"declarationDir",
|
|
688
753
|
"preserveValueImports",
|
|
689
754
|
/* Interop Constraints */
|
|
755
|
+
"isolatedDeclarations",
|
|
690
756
|
"isolatedModules",
|
|
691
757
|
"verbatimModuleSyntax",
|
|
692
758
|
"allowSyntheticDefaultImports",
|
|
@@ -715,15 +781,25 @@ var configSort = (options = {}) => {
|
|
|
715
781
|
"useUnknownInCatchVariables",
|
|
716
782
|
/* Completeness */
|
|
717
783
|
"skipDefaultLibCheck",
|
|
718
|
-
"skipLibCheck"
|
|
784
|
+
"skipLibCheck",
|
|
785
|
+
// Unknown fields
|
|
786
|
+
{
|
|
787
|
+
order: {
|
|
788
|
+
type: "asc"
|
|
789
|
+
}
|
|
790
|
+
}
|
|
719
791
|
]
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
order: { type: "asc" },
|
|
795
|
+
pathPattern: "^vueCompilerOptions$"
|
|
720
796
|
}
|
|
721
797
|
]
|
|
722
798
|
}
|
|
723
799
|
});
|
|
724
800
|
}
|
|
725
801
|
if (enableSortPackageJson) {
|
|
726
|
-
|
|
802
|
+
configs.push({
|
|
727
803
|
name: "ntnyq/sort/package-json",
|
|
728
804
|
files: ["**/package.json"],
|
|
729
805
|
rules: {
|
|
@@ -731,19 +807,7 @@ var configSort = (options = {}) => {
|
|
|
731
807
|
"error",
|
|
732
808
|
{
|
|
733
809
|
order: { type: "asc" },
|
|
734
|
-
pathPattern: "^files$"
|
|
735
|
-
},
|
|
736
|
-
{
|
|
737
|
-
order: { type: "asc" },
|
|
738
|
-
pathPattern: "^keywords$"
|
|
739
|
-
},
|
|
740
|
-
{
|
|
741
|
-
order: { type: "asc" },
|
|
742
|
-
pathPattern: "^activationEvents$"
|
|
743
|
-
},
|
|
744
|
-
{
|
|
745
|
-
order: { type: "asc" },
|
|
746
|
-
pathPattern: "^contributes.*$"
|
|
810
|
+
pathPattern: "^(?:files|keywords|activationEvents|contributes.*)$"
|
|
747
811
|
}
|
|
748
812
|
],
|
|
749
813
|
"jsonc/sort-keys": [
|
|
@@ -837,7 +901,13 @@ var configSort = (options = {}) => {
|
|
|
837
901
|
"prettier",
|
|
838
902
|
"nano-staged",
|
|
839
903
|
"lint-staged",
|
|
840
|
-
"eslintConfig"
|
|
904
|
+
"eslintConfig",
|
|
905
|
+
// Unknown fields
|
|
906
|
+
{
|
|
907
|
+
order: {
|
|
908
|
+
type: "asc"
|
|
909
|
+
}
|
|
910
|
+
}
|
|
841
911
|
]
|
|
842
912
|
},
|
|
843
913
|
{
|
|
@@ -856,6 +926,7 @@ var configSort = (options = {}) => {
|
|
|
856
926
|
"import",
|
|
857
927
|
"require",
|
|
858
928
|
"default",
|
|
929
|
+
// Unknown fields
|
|
859
930
|
{
|
|
860
931
|
order: {
|
|
861
932
|
type: "asc"
|
|
@@ -880,6 +951,7 @@ var configSort = (options = {}) => {
|
|
|
880
951
|
"import",
|
|
881
952
|
"require",
|
|
882
953
|
"default",
|
|
954
|
+
// Unknown fields
|
|
883
955
|
{
|
|
884
956
|
order: {
|
|
885
957
|
type: "asc"
|
|
@@ -905,7 +977,13 @@ var configSort = (options = {}) => {
|
|
|
905
977
|
"post-checkout",
|
|
906
978
|
"post-merge",
|
|
907
979
|
"pre-push",
|
|
908
|
-
"pre-auto-gc"
|
|
980
|
+
"pre-auto-gc",
|
|
981
|
+
// Unknown fields
|
|
982
|
+
{
|
|
983
|
+
order: {
|
|
984
|
+
type: "asc"
|
|
985
|
+
}
|
|
986
|
+
}
|
|
909
987
|
]
|
|
910
988
|
}
|
|
911
989
|
]
|
|
@@ -913,7 +991,7 @@ var configSort = (options = {}) => {
|
|
|
913
991
|
});
|
|
914
992
|
}
|
|
915
993
|
if (enableSortI18nLocale) {
|
|
916
|
-
|
|
994
|
+
configs.push(
|
|
917
995
|
{
|
|
918
996
|
name: "ntnyq/sort/i18n-locale/json",
|
|
919
997
|
files: ["**/{i18n,langs,locales}/*.json"],
|
|
@@ -943,37 +1021,96 @@ var configSort = (options = {}) => {
|
|
|
943
1021
|
);
|
|
944
1022
|
}
|
|
945
1023
|
if (enableSortPnpmWorkspace) {
|
|
946
|
-
|
|
1024
|
+
configs.push({
|
|
947
1025
|
name: "ntnyq/sort/pnpm-workspace",
|
|
948
1026
|
files: ["**/pnpm-workspace.yaml"],
|
|
949
1027
|
rules: {
|
|
950
1028
|
"yml/sort-keys": [
|
|
951
1029
|
"error",
|
|
1030
|
+
{
|
|
1031
|
+
pathPattern: "^$",
|
|
1032
|
+
order: [
|
|
1033
|
+
// legacy workspace content
|
|
1034
|
+
"packages",
|
|
1035
|
+
"catalog",
|
|
1036
|
+
"catalogs",
|
|
1037
|
+
// pnpm settings with common used fields first
|
|
1038
|
+
"allowedDeprecatedVersions",
|
|
1039
|
+
"overrides",
|
|
1040
|
+
"onlyBuiltDependencies",
|
|
1041
|
+
"patchedDependencies",
|
|
1042
|
+
"peerDependencyRules",
|
|
1043
|
+
// non common used fields
|
|
1044
|
+
"allowNonAppliedPatches",
|
|
1045
|
+
"auditConfig",
|
|
1046
|
+
"configDependencies",
|
|
1047
|
+
"executionEnv",
|
|
1048
|
+
"ignoredBuiltDependencies",
|
|
1049
|
+
"ignoredOptionalDependencies",
|
|
1050
|
+
"neverBuiltDependencies",
|
|
1051
|
+
"onlyBuiltDependenciesFile",
|
|
1052
|
+
"packageExtensions",
|
|
1053
|
+
"requiredScripts",
|
|
1054
|
+
"supportedArchitectures",
|
|
1055
|
+
"updateConfig",
|
|
1056
|
+
// Unknown fields
|
|
1057
|
+
{
|
|
1058
|
+
order: {
|
|
1059
|
+
type: "asc"
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
]
|
|
1063
|
+
},
|
|
952
1064
|
{
|
|
953
1065
|
order: { type: "asc" },
|
|
954
|
-
pathPattern: "
|
|
1066
|
+
pathPattern: "^(?:catalog|overrides|patchedDependencies|peerDependencyRules)$"
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
allowLineSeparatedGroups: true,
|
|
1070
|
+
order: { type: "asc" },
|
|
1071
|
+
pathPattern: "^catalogs$"
|
|
1072
|
+
}
|
|
1073
|
+
],
|
|
1074
|
+
"yml/sort-sequence-values": [
|
|
1075
|
+
"error",
|
|
1076
|
+
{
|
|
1077
|
+
order: [
|
|
1078
|
+
".",
|
|
1079
|
+
// Unknown fields
|
|
1080
|
+
{
|
|
1081
|
+
order: {
|
|
1082
|
+
type: "asc"
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
],
|
|
1086
|
+
pathPattern: "^(?:packages|onlyBuiltDependencies|peerDependencyRules.ignoreMissing)$"
|
|
955
1087
|
}
|
|
956
1088
|
]
|
|
957
1089
|
}
|
|
958
1090
|
});
|
|
959
1091
|
}
|
|
960
1092
|
if (additionalJsonFiles.length) {
|
|
961
|
-
|
|
1093
|
+
configs.push({
|
|
962
1094
|
name: "ntnyq/sort/additional-json",
|
|
963
1095
|
files: additionalJsonFiles,
|
|
964
1096
|
rules: {
|
|
965
1097
|
"jsonc/sort-keys": [
|
|
966
1098
|
"error",
|
|
967
1099
|
{
|
|
968
|
-
|
|
969
|
-
|
|
1100
|
+
pathPattern: ".*",
|
|
1101
|
+
order: [
|
|
1102
|
+
"$schema",
|
|
1103
|
+
{
|
|
1104
|
+
order: { type: "asc" }
|
|
1105
|
+
}
|
|
1106
|
+
]
|
|
970
1107
|
}
|
|
971
1108
|
]
|
|
972
1109
|
}
|
|
973
1110
|
});
|
|
974
1111
|
}
|
|
975
1112
|
if (additionalYamlFiles.length) {
|
|
976
|
-
|
|
1113
|
+
configs.push({
|
|
977
1114
|
name: "ntnyq/sort/additional-yaml",
|
|
978
1115
|
files: additionalYamlFiles,
|
|
979
1116
|
rules: {
|
|
@@ -987,11 +1124,10 @@ var configSort = (options = {}) => {
|
|
|
987
1124
|
}
|
|
988
1125
|
});
|
|
989
1126
|
}
|
|
990
|
-
return
|
|
1127
|
+
return configs;
|
|
991
1128
|
};
|
|
992
1129
|
|
|
993
|
-
|
|
994
|
-
var configSVGO = (options = {}) => {
|
|
1130
|
+
const configSVGO = (options = {}) => {
|
|
995
1131
|
const { files = [GLOB_SVG], ignores = [] } = options;
|
|
996
1132
|
return [
|
|
997
1133
|
{
|
|
@@ -999,7 +1135,7 @@ var configSVGO = (options = {}) => {
|
|
|
999
1135
|
files,
|
|
1000
1136
|
ignores,
|
|
1001
1137
|
plugins: {
|
|
1002
|
-
svgo:
|
|
1138
|
+
svgo: pluginSvgo
|
|
1003
1139
|
},
|
|
1004
1140
|
languageOptions: {
|
|
1005
1141
|
parser: parserPlain
|
|
@@ -1011,66 +1147,53 @@ var configSVGO = (options = {}) => {
|
|
|
1011
1147
|
];
|
|
1012
1148
|
};
|
|
1013
1149
|
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
var hasTypeScript = () => isPackageExists("typescript");
|
|
1021
|
-
var hasShadcnVue = () => isPackageExists("radix-vue") && isPackageExists("clsx");
|
|
1022
|
-
var hasUnoCSS = () => isPackageExists("unocss") || isPackageExists("@unocss/postcss") || isPackageExists("@unocss/webpack") || isPackageExists("@unocss/nuxt");
|
|
1023
|
-
var hasVue = () => isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("vuepress") || isPackageExists("@slidev/cli") || isPackageExists("vue", {
|
|
1150
|
+
const hasPinia = () => isPackageExists("pinia");
|
|
1151
|
+
const hasVitest = () => isPackageExists("vitest");
|
|
1152
|
+
const hasTypeScript = () => isPackageExists("typescript");
|
|
1153
|
+
const hasShadcnVue = () => (isPackageExists("radix-vue") || isPackageExists("reka-ui")) && isPackageExists("class-variance-authority") && isPackageExists("clsx");
|
|
1154
|
+
const hasUnoCSS = () => isPackageExists("unocss") || isPackageExists("@unocss/postcss") || isPackageExists("@unocss/webpack") || isPackageExists("@unocss/nuxt");
|
|
1155
|
+
const hasVue = () => isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("vuepress") || isPackageExists("@slidev/cli") || isPackageExists("vue", {
|
|
1024
1156
|
paths: [
|
|
1025
1157
|
resolve(process.cwd(), "playground"),
|
|
1026
1158
|
resolve(process.cwd(), "docs")
|
|
1027
1159
|
]
|
|
1028
1160
|
});
|
|
1029
1161
|
|
|
1030
|
-
// src/utils/toArray.ts
|
|
1031
|
-
function toArray(val) {
|
|
1032
|
-
val = val ?? [];
|
|
1033
|
-
return Array.isArray(val) ? val : [val];
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
// src/utils/resolveSubOptions.ts
|
|
1037
1162
|
function resolveSubOptions(options, key) {
|
|
1038
1163
|
return typeof options[key] === "boolean" ? {} : options[key] || {};
|
|
1039
1164
|
}
|
|
1040
1165
|
|
|
1041
|
-
// src/utils/getOverrides.ts
|
|
1042
1166
|
function getOverrides(options, key) {
|
|
1043
1167
|
const subOptions = resolveSubOptions(options, key);
|
|
1044
1168
|
return "overrides" in subOptions && subOptions.overrides ? subOptions.overrides : {};
|
|
1045
1169
|
}
|
|
1046
1170
|
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
const resolved = await Promise.all(configs2);
|
|
1171
|
+
async function combineConfigs(...configs) {
|
|
1172
|
+
const resolved = await Promise.all(configs);
|
|
1050
1173
|
return resolved.flat();
|
|
1051
1174
|
}
|
|
1052
1175
|
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1176
|
+
const CHECKED_RUNNER_PACKAGES = [
|
|
1177
|
+
"nano-staged",
|
|
1178
|
+
"lint-staged",
|
|
1179
|
+
"lefthook",
|
|
1180
|
+
"tsx"
|
|
1181
|
+
];
|
|
1182
|
+
function isInGitHooksOrRunBySpecifyPackages() {
|
|
1183
|
+
return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || CHECKED_RUNNER_PACKAGES.some(
|
|
1184
|
+
(packageName) => process.env.npm_lifecycle_script?.startsWith(packageName)
|
|
1185
|
+
));
|
|
1062
1186
|
}
|
|
1063
1187
|
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
var isCwdInScope = isPackageExists2("@ntnyq/eslint-config");
|
|
1188
|
+
const scopeUrl = fileURLToPath(new URL(".", import.meta.url));
|
|
1189
|
+
const isCwdInScope = isPackageExists("@ntnyq/eslint-config");
|
|
1067
1190
|
function isPackageInScope(name) {
|
|
1068
|
-
return
|
|
1191
|
+
return isPackageExists(name, {
|
|
1069
1192
|
paths: [scopeUrl]
|
|
1070
1193
|
});
|
|
1071
1194
|
}
|
|
1072
1195
|
async function ensurePackages(packages) {
|
|
1073
|
-
if (
|
|
1196
|
+
if (process.env.CI || !process.stdout.isTTY || isInGitHooksOrRunBySpecifyPackages() || !isCwdInScope) {
|
|
1074
1197
|
return;
|
|
1075
1198
|
}
|
|
1076
1199
|
const nonExistingPackages = packages.filter(
|
|
@@ -1079,13 +1202,13 @@ async function ensurePackages(packages) {
|
|
|
1079
1202
|
if (nonExistingPackages.length === 0) {
|
|
1080
1203
|
return;
|
|
1081
1204
|
}
|
|
1082
|
-
const { confirm } = await import(
|
|
1205
|
+
const { confirm } = await import('@clack/prompts');
|
|
1083
1206
|
const confirmInstall = await confirm({
|
|
1084
1207
|
message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`
|
|
1085
1208
|
});
|
|
1086
1209
|
if (confirmInstall) {
|
|
1087
1210
|
try {
|
|
1088
|
-
const { installPackage } = await import(
|
|
1211
|
+
const { installPackage } = await import('@antfu/install-pkg');
|
|
1089
1212
|
await installPackage(nonExistingPackages, { dev: true });
|
|
1090
1213
|
} catch (err) {
|
|
1091
1214
|
console.log(err);
|
|
@@ -1093,13 +1216,11 @@ async function ensurePackages(packages) {
|
|
|
1093
1216
|
}
|
|
1094
1217
|
}
|
|
1095
1218
|
|
|
1096
|
-
// src/utils/interopDefault.ts
|
|
1097
1219
|
async function interopDefault(mod) {
|
|
1098
1220
|
const resolved = await mod;
|
|
1099
1221
|
return resolved.default || resolved;
|
|
1100
1222
|
}
|
|
1101
1223
|
|
|
1102
|
-
// src/utils/mergePrettierOptions.ts
|
|
1103
1224
|
function mergePrettierOptions(options = {}, overrides = {}) {
|
|
1104
1225
|
const result = {
|
|
1105
1226
|
...options,
|
|
@@ -1114,18 +1235,17 @@ function mergePrettierOptions(options = {}, overrides = {}) {
|
|
|
1114
1235
|
return result;
|
|
1115
1236
|
}
|
|
1116
1237
|
|
|
1117
|
-
|
|
1118
|
-
var configTest = (options = {}) => {
|
|
1238
|
+
const configTest = (options = {}) => {
|
|
1119
1239
|
const {
|
|
1120
1240
|
// default test files
|
|
1121
1241
|
files = [...GLOB_TEST],
|
|
1122
1242
|
vitest: enableVitest = hasVitest()
|
|
1123
1243
|
} = options;
|
|
1124
|
-
const
|
|
1244
|
+
const configs = [
|
|
1125
1245
|
{
|
|
1126
1246
|
name: "ntnyq/test/setup",
|
|
1127
1247
|
plugins: {
|
|
1128
|
-
"no-only-tests":
|
|
1248
|
+
"no-only-tests": pluginNoOnlyTests
|
|
1129
1249
|
}
|
|
1130
1250
|
},
|
|
1131
1251
|
{
|
|
@@ -1141,11 +1261,11 @@ var configTest = (options = {}) => {
|
|
|
1141
1261
|
}
|
|
1142
1262
|
];
|
|
1143
1263
|
if (enableVitest) {
|
|
1144
|
-
|
|
1264
|
+
configs.push({
|
|
1145
1265
|
name: "ntnyq/test/vitest",
|
|
1146
1266
|
files,
|
|
1147
1267
|
plugins: {
|
|
1148
|
-
vitest:
|
|
1268
|
+
vitest: pluginVitest
|
|
1149
1269
|
},
|
|
1150
1270
|
settings: {
|
|
1151
1271
|
/**
|
|
@@ -1157,7 +1277,7 @@ var configTest = (options = {}) => {
|
|
|
1157
1277
|
// },
|
|
1158
1278
|
},
|
|
1159
1279
|
rules: {
|
|
1160
|
-
...
|
|
1280
|
+
...pluginVitest.configs.recommended.rules,
|
|
1161
1281
|
"vitest/expect-expect": [
|
|
1162
1282
|
"error",
|
|
1163
1283
|
{
|
|
@@ -1177,18 +1297,17 @@ var configTest = (options = {}) => {
|
|
|
1177
1297
|
}
|
|
1178
1298
|
});
|
|
1179
1299
|
}
|
|
1180
|
-
return
|
|
1300
|
+
return configs;
|
|
1181
1301
|
};
|
|
1182
1302
|
|
|
1183
|
-
|
|
1184
|
-
var configToml = (options = {}) => {
|
|
1303
|
+
const configToml = (options = {}) => {
|
|
1185
1304
|
const { files = [GLOB_TOML] } = options;
|
|
1186
1305
|
return [
|
|
1187
1306
|
{
|
|
1188
1307
|
name: "ntnyq/toml",
|
|
1189
1308
|
files,
|
|
1190
1309
|
plugins: {
|
|
1191
|
-
toml:
|
|
1310
|
+
toml: pluginToml
|
|
1192
1311
|
},
|
|
1193
1312
|
languageOptions: {
|
|
1194
1313
|
parser: parserToml
|
|
@@ -1220,12 +1339,11 @@ var configToml = (options = {}) => {
|
|
|
1220
1339
|
];
|
|
1221
1340
|
};
|
|
1222
1341
|
|
|
1223
|
-
|
|
1224
|
-
var configAntfu = (options = {}) => [
|
|
1342
|
+
const configAntfu = (options = {}) => [
|
|
1225
1343
|
{
|
|
1226
1344
|
name: "ntnyq/antfu",
|
|
1227
1345
|
plugins: {
|
|
1228
|
-
antfu:
|
|
1346
|
+
antfu: pluginAntfu
|
|
1229
1347
|
},
|
|
1230
1348
|
rules: {
|
|
1231
1349
|
// required `object-curly-newline` to be disabled
|
|
@@ -1240,26 +1358,25 @@ var configAntfu = (options = {}) => [
|
|
|
1240
1358
|
}
|
|
1241
1359
|
];
|
|
1242
1360
|
|
|
1243
|
-
|
|
1244
|
-
var javscriptRules = {
|
|
1361
|
+
const javscriptRules = {
|
|
1245
1362
|
"jsdoc/no-types": "off",
|
|
1246
1363
|
"jsdoc/no-undefined-types": "error",
|
|
1247
1364
|
"jsdoc/require-param-type": "error",
|
|
1248
1365
|
"jsdoc/require-property-type": "error",
|
|
1249
1366
|
"jsdoc/require-returns-type": "error"
|
|
1250
1367
|
};
|
|
1251
|
-
|
|
1368
|
+
const typescriptRules = {
|
|
1252
1369
|
"jsdoc/no-undefined-types": "off",
|
|
1253
1370
|
"jsdoc/require-param-type": "off",
|
|
1254
1371
|
"jsdoc/require-property-type": "off",
|
|
1255
1372
|
"jsdoc/require-returns-type": "off",
|
|
1256
1373
|
"jsdoc/no-types": "error"
|
|
1257
1374
|
};
|
|
1258
|
-
|
|
1375
|
+
const configJsdoc = (options = {}) => [
|
|
1259
1376
|
{
|
|
1260
1377
|
name: "ntnyq/jsdoc",
|
|
1261
1378
|
plugins: {
|
|
1262
|
-
jsdoc:
|
|
1379
|
+
jsdoc: pluginJsdoc
|
|
1263
1380
|
},
|
|
1264
1381
|
rules: {
|
|
1265
1382
|
// Disabled rules
|
|
@@ -1332,21 +1449,20 @@ var configJsdoc = (options = {}) => [
|
|
|
1332
1449
|
}
|
|
1333
1450
|
];
|
|
1334
1451
|
|
|
1335
|
-
|
|
1336
|
-
var configJsonc = (options = {}) => {
|
|
1452
|
+
const configJsonc = (options = {}) => {
|
|
1337
1453
|
const { files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC] } = options;
|
|
1338
1454
|
return [
|
|
1339
1455
|
{
|
|
1340
1456
|
name: "ntnyq/jsonc",
|
|
1341
1457
|
files,
|
|
1342
1458
|
plugins: {
|
|
1343
|
-
jsonc:
|
|
1459
|
+
jsonc: pluginJsonc
|
|
1344
1460
|
},
|
|
1345
1461
|
languageOptions: {
|
|
1346
1462
|
parser: parserJsonc
|
|
1347
1463
|
},
|
|
1348
1464
|
rules: {
|
|
1349
|
-
...
|
|
1465
|
+
...pluginJsonc.configs["recommended-with-jsonc"].rules,
|
|
1350
1466
|
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
1351
1467
|
"jsonc/comma-dangle": ["error", "never"],
|
|
1352
1468
|
"jsonc/comma-style": ["error", "last"],
|
|
@@ -1380,12 +1496,11 @@ var configJsonc = (options = {}) => {
|
|
|
1380
1496
|
];
|
|
1381
1497
|
};
|
|
1382
1498
|
|
|
1383
|
-
|
|
1384
|
-
var configNtnyq = (options = {}) => [
|
|
1499
|
+
const configNtnyq = (options = {}) => [
|
|
1385
1500
|
{
|
|
1386
1501
|
name: "ntnyq/ntnyq",
|
|
1387
1502
|
plugins: {
|
|
1388
|
-
ntnyq:
|
|
1503
|
+
ntnyq: pluginNtnyq
|
|
1389
1504
|
},
|
|
1390
1505
|
rules: {
|
|
1391
1506
|
"ntnyq/no-duplicate-exports": "error",
|
|
@@ -1396,15 +1511,14 @@ var configNtnyq = (options = {}) => [
|
|
|
1396
1511
|
}
|
|
1397
1512
|
];
|
|
1398
1513
|
|
|
1399
|
-
|
|
1400
|
-
var configPinia = (options = {}) => {
|
|
1514
|
+
const configPinia = (options = {}) => {
|
|
1401
1515
|
const { files = [GLOB_PINIA_STORE] } = options;
|
|
1402
1516
|
return [
|
|
1403
1517
|
{
|
|
1404
1518
|
name: "ntnyq/pinia",
|
|
1405
1519
|
files,
|
|
1406
1520
|
plugins: {
|
|
1407
|
-
pinia:
|
|
1521
|
+
pinia: pluginPinia
|
|
1408
1522
|
},
|
|
1409
1523
|
rules: {
|
|
1410
1524
|
"pinia/never-export-initialized-store": "error",
|
|
@@ -1427,14 +1541,13 @@ var configPinia = (options = {}) => {
|
|
|
1427
1541
|
];
|
|
1428
1542
|
};
|
|
1429
1543
|
|
|
1430
|
-
|
|
1431
|
-
var configDepend = (options = {}) => {
|
|
1544
|
+
const configDepend = (options = {}) => {
|
|
1432
1545
|
const {
|
|
1433
1546
|
files = [GLOB_SRC],
|
|
1434
1547
|
// check package.json file
|
|
1435
1548
|
packageJson: enableCheckPackageJson = true
|
|
1436
1549
|
} = options;
|
|
1437
|
-
const
|
|
1550
|
+
const configs = [
|
|
1438
1551
|
{
|
|
1439
1552
|
name: "ntnyq/depend",
|
|
1440
1553
|
files,
|
|
@@ -1449,7 +1562,7 @@ var configDepend = (options = {}) => {
|
|
|
1449
1562
|
}
|
|
1450
1563
|
];
|
|
1451
1564
|
if (enableCheckPackageJson) {
|
|
1452
|
-
|
|
1565
|
+
configs.push({
|
|
1453
1566
|
name: "ntnyq/depend/package-json",
|
|
1454
1567
|
files: [GLOB_PACKAGE_JSON],
|
|
1455
1568
|
plugins: {
|
|
@@ -1465,11 +1578,10 @@ var configDepend = (options = {}) => {
|
|
|
1465
1578
|
}
|
|
1466
1579
|
});
|
|
1467
1580
|
}
|
|
1468
|
-
return
|
|
1581
|
+
return configs;
|
|
1469
1582
|
};
|
|
1470
1583
|
|
|
1471
|
-
|
|
1472
|
-
var PRETTIER_DEFAULT_OPTIONS = {
|
|
1584
|
+
const PRETTIER_DEFAULT_OPTIONS = {
|
|
1473
1585
|
arrowParens: "avoid",
|
|
1474
1586
|
bracketSameLine: false,
|
|
1475
1587
|
bracketSpacing: true,
|
|
@@ -1496,25 +1608,24 @@ var PRETTIER_DEFAULT_OPTIONS = {
|
|
|
1496
1608
|
vueIndentScriptAndStyle: false
|
|
1497
1609
|
};
|
|
1498
1610
|
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
// fallbackSort: { order: 'asc', type: 'alphabetical' },
|
|
1611
|
+
const PERFECTIONIST_COMMON_RULE_OPTIONS = {
|
|
1612
|
+
fallbackSort: { order: "asc", type: "alphabetical" },
|
|
1502
1613
|
ignoreCase: true,
|
|
1503
1614
|
order: "asc",
|
|
1504
1615
|
type: "alphabetical"
|
|
1505
1616
|
};
|
|
1506
|
-
|
|
1617
|
+
const PERFECTIONIST_EXTRA_RULE_OPTIONS = {
|
|
1507
1618
|
newlinesBetween: "ignore",
|
|
1508
1619
|
partitionByComment: ["@pg", "@perfectionist-group"]
|
|
1509
1620
|
};
|
|
1510
|
-
|
|
1621
|
+
const PERFECTIONIST_SORT_OBJECTS_GROUPS = [
|
|
1511
1622
|
"property",
|
|
1512
1623
|
"multiline-property",
|
|
1513
1624
|
"method",
|
|
1514
1625
|
"multiline-method",
|
|
1515
1626
|
"unknown"
|
|
1516
1627
|
];
|
|
1517
|
-
|
|
1628
|
+
const PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS = [
|
|
1518
1629
|
"required-property",
|
|
1519
1630
|
"optional-property",
|
|
1520
1631
|
"required-method",
|
|
@@ -1527,7 +1638,7 @@ var PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS = [
|
|
|
1527
1638
|
"index-signature",
|
|
1528
1639
|
"multiline-index-signature"
|
|
1529
1640
|
];
|
|
1530
|
-
|
|
1641
|
+
const PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS = [
|
|
1531
1642
|
/**
|
|
1532
1643
|
* eg. 'foobar', 24, false
|
|
1533
1644
|
*/
|
|
@@ -1577,7 +1688,7 @@ var PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS = [
|
|
|
1577
1688
|
*/
|
|
1578
1689
|
"nullish"
|
|
1579
1690
|
];
|
|
1580
|
-
|
|
1691
|
+
const PERFECTIONIST_SORT_IMPORTS_GROUPS = [
|
|
1581
1692
|
// Side effect style imports (e.g. 'normalize.css')
|
|
1582
1693
|
"side-effect-style",
|
|
1583
1694
|
// Styles (e.g. *.{css,scss,less})
|
|
@@ -1613,10 +1724,11 @@ var PERFECTIONIST_SORT_IMPORTS_GROUPS = [
|
|
|
1613
1724
|
*/
|
|
1614
1725
|
"unknown"
|
|
1615
1726
|
];
|
|
1616
|
-
|
|
1727
|
+
const PERFECTIONIST_SORT_CLASSES_GROUPS = ["unknown"];
|
|
1617
1728
|
|
|
1618
|
-
|
|
1619
|
-
|
|
1729
|
+
const configFormat = async (options = {}) => {
|
|
1730
|
+
await ensurePackages(["eslint-plugin-format"]);
|
|
1731
|
+
const pluginFormat = await interopDefault(import('eslint-plugin-format'));
|
|
1620
1732
|
const {
|
|
1621
1733
|
css: enableCSS = true,
|
|
1622
1734
|
html: enableHTML = true,
|
|
@@ -1627,16 +1739,16 @@ var configFormat = (options = {}) => {
|
|
|
1627
1739
|
...PRETTIER_DEFAULT_OPTIONS,
|
|
1628
1740
|
...prettierOptions
|
|
1629
1741
|
};
|
|
1630
|
-
const
|
|
1742
|
+
const configs = [
|
|
1631
1743
|
{
|
|
1632
1744
|
name: "ntnyq/format/setup",
|
|
1633
1745
|
plugins: {
|
|
1634
|
-
format:
|
|
1746
|
+
format: pluginFormat
|
|
1635
1747
|
}
|
|
1636
1748
|
}
|
|
1637
1749
|
];
|
|
1638
1750
|
if (enableCSS) {
|
|
1639
|
-
|
|
1751
|
+
configs.push(
|
|
1640
1752
|
{
|
|
1641
1753
|
name: "ntnyq/format/css",
|
|
1642
1754
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
@@ -1685,7 +1797,7 @@ var configFormat = (options = {}) => {
|
|
|
1685
1797
|
);
|
|
1686
1798
|
}
|
|
1687
1799
|
if (enableHTML) {
|
|
1688
|
-
|
|
1800
|
+
configs.push({
|
|
1689
1801
|
name: "ntnyq/format/html",
|
|
1690
1802
|
files: [GLOB_HTML],
|
|
1691
1803
|
languageOptions: {
|
|
@@ -1701,19 +1813,18 @@ var configFormat = (options = {}) => {
|
|
|
1701
1813
|
}
|
|
1702
1814
|
});
|
|
1703
1815
|
}
|
|
1704
|
-
return
|
|
1816
|
+
return configs;
|
|
1705
1817
|
};
|
|
1706
1818
|
|
|
1707
|
-
|
|
1708
|
-
var configRegexp = (options = {}) => {
|
|
1819
|
+
const configRegexp = (options = {}) => {
|
|
1709
1820
|
const recommendedConfig = pluginRegexp.configs["flat/recommended"];
|
|
1710
|
-
const
|
|
1821
|
+
const recommendedRules = {
|
|
1711
1822
|
...recommendedConfig.rules
|
|
1712
1823
|
};
|
|
1713
1824
|
if (options.severity === "warn") {
|
|
1714
|
-
for (const key in
|
|
1715
|
-
if (
|
|
1716
|
-
|
|
1825
|
+
for (const key in recommendedRules) {
|
|
1826
|
+
if (recommendedRules[key] === "error") {
|
|
1827
|
+
recommendedRules[key] = "warn";
|
|
1717
1828
|
}
|
|
1718
1829
|
}
|
|
1719
1830
|
}
|
|
@@ -1722,7 +1833,7 @@ var configRegexp = (options = {}) => {
|
|
|
1722
1833
|
...recommendedConfig,
|
|
1723
1834
|
name: "ntnyq/regexp",
|
|
1724
1835
|
rules: {
|
|
1725
|
-
...
|
|
1836
|
+
...recommendedRules,
|
|
1726
1837
|
// Overrides rules
|
|
1727
1838
|
...options.overrides
|
|
1728
1839
|
}
|
|
@@ -1730,12 +1841,11 @@ var configRegexp = (options = {}) => {
|
|
|
1730
1841
|
];
|
|
1731
1842
|
};
|
|
1732
1843
|
|
|
1733
|
-
|
|
1734
|
-
var configUnoCSS = (options = {}) => [
|
|
1844
|
+
const configUnoCSS = (options = {}) => [
|
|
1735
1845
|
{
|
|
1736
1846
|
name: "ntnyq/unocss",
|
|
1737
1847
|
plugins: {
|
|
1738
|
-
unocss:
|
|
1848
|
+
unocss: pluginUnoCSS
|
|
1739
1849
|
},
|
|
1740
1850
|
rules: {
|
|
1741
1851
|
"unocss/order-attributify": options.attributify ? "error" : "off",
|
|
@@ -1746,13 +1856,7 @@ var configUnoCSS = (options = {}) => [
|
|
|
1746
1856
|
}
|
|
1747
1857
|
];
|
|
1748
1858
|
|
|
1749
|
-
|
|
1750
|
-
import { builtinCommands } from "eslint-plugin-command/commands";
|
|
1751
|
-
import createCommandConfig from "eslint-plugin-command/config";
|
|
1752
|
-
|
|
1753
|
-
// src/commands/regexper.ts
|
|
1754
|
-
import { defineCommand } from "eslint-plugin-command/commands";
|
|
1755
|
-
var regexper = defineCommand({
|
|
1859
|
+
const regexper = defineCommand({
|
|
1756
1860
|
name: "regexper",
|
|
1757
1861
|
// @regexper https://regexper.com/#%2F(%5Cb%7C%5Cs%7C%5E)(%40regexper)(%5Cs%5CS%2B)%3F(%5Cb%7C%5Cs%7C%24)%2F
|
|
1758
1862
|
match: /(\b|\s|^)(@regexper)(\s\S+)?(\b|\s|$)/,
|
|
@@ -1795,11 +1899,9 @@ var regexper = defineCommand({
|
|
|
1795
1899
|
}
|
|
1796
1900
|
});
|
|
1797
1901
|
|
|
1798
|
-
|
|
1799
|
-
var commands = [regexper];
|
|
1902
|
+
const commands = [regexper];
|
|
1800
1903
|
|
|
1801
|
-
|
|
1802
|
-
var configCommand = (options = {}) => [
|
|
1904
|
+
const configCommand = (options = {}) => [
|
|
1803
1905
|
{
|
|
1804
1906
|
...createCommandConfig({
|
|
1805
1907
|
...options,
|
|
@@ -1816,8 +1918,7 @@ var configCommand = (options = {}) => [
|
|
|
1816
1918
|
}
|
|
1817
1919
|
];
|
|
1818
1920
|
|
|
1819
|
-
|
|
1820
|
-
var configIgnores = (customIgnores = []) => [
|
|
1921
|
+
const configIgnores = (customIgnores = []) => [
|
|
1821
1922
|
{
|
|
1822
1923
|
name: "ntnyq/ignores",
|
|
1823
1924
|
ignores: [
|
|
@@ -1828,8 +1929,7 @@ var configIgnores = (customIgnores = []) => [
|
|
|
1828
1929
|
}
|
|
1829
1930
|
];
|
|
1830
1931
|
|
|
1831
|
-
|
|
1832
|
-
var configImportX = (options = {}) => {
|
|
1932
|
+
const configImportX = (options = {}) => {
|
|
1833
1933
|
const {
|
|
1834
1934
|
// use typescript resolve if possible
|
|
1835
1935
|
preferTypeScriptResolver = true,
|
|
@@ -1839,7 +1939,7 @@ var configImportX = (options = {}) => {
|
|
|
1839
1939
|
{
|
|
1840
1940
|
name: "ntnyq/import-x",
|
|
1841
1941
|
plugins: {
|
|
1842
|
-
"import-x":
|
|
1942
|
+
"import-x": pluginImportX
|
|
1843
1943
|
},
|
|
1844
1944
|
settings: {
|
|
1845
1945
|
"import-x/resolver-next": [
|
|
@@ -1853,7 +1953,7 @@ var configImportX = (options = {}) => {
|
|
|
1853
1953
|
".json",
|
|
1854
1954
|
".node"
|
|
1855
1955
|
]
|
|
1856
|
-
}) : createNodeResolver({
|
|
1956
|
+
}) : pluginImportX.createNodeResolver({
|
|
1857
1957
|
extensions: [".js", ".mjs", ".ts", ".mts", ".d.ts", ".json"]
|
|
1858
1958
|
})
|
|
1859
1959
|
]
|
|
@@ -1882,8 +1982,7 @@ var configImportX = (options = {}) => {
|
|
|
1882
1982
|
];
|
|
1883
1983
|
};
|
|
1884
1984
|
|
|
1885
|
-
|
|
1886
|
-
var disabledRules2 = {
|
|
1985
|
+
const disabledRules = {
|
|
1887
1986
|
"unicorn/better-regex": "off",
|
|
1888
1987
|
"unicorn/explicit-length-check": "off",
|
|
1889
1988
|
"unicorn/no-array-callback-reference": "off",
|
|
@@ -1893,11 +1992,11 @@ var disabledRules2 = {
|
|
|
1893
1992
|
"unicorn/prefer-global-this": "off",
|
|
1894
1993
|
"unicorn/prefer-top-level-await": "off"
|
|
1895
1994
|
};
|
|
1896
|
-
|
|
1995
|
+
const configUnicorn = (options = {}) => [
|
|
1897
1996
|
{
|
|
1898
1997
|
name: "ntnyq/unicorn",
|
|
1899
1998
|
plugins: {
|
|
1900
|
-
unicorn:
|
|
1999
|
+
unicorn: pluginUnicorn
|
|
1901
2000
|
},
|
|
1902
2001
|
rules: {
|
|
1903
2002
|
"unicorn/consistent-assert": "error",
|
|
@@ -1989,43 +2088,38 @@ var configUnicorn = (options = {}) => [
|
|
|
1989
2088
|
*/
|
|
1990
2089
|
"unicorn/prefer-set-has": "error",
|
|
1991
2090
|
"unicorn/prefer-set-size": "error",
|
|
1992
|
-
...
|
|
2091
|
+
...disabledRules,
|
|
1993
2092
|
// Overrides rules
|
|
1994
2093
|
...options.overrides
|
|
1995
2094
|
}
|
|
1996
2095
|
}
|
|
1997
2096
|
];
|
|
1998
2097
|
|
|
1999
|
-
|
|
2000
|
-
var configDeMorgan = (options = {}) => [
|
|
2098
|
+
const configDeMorgan = (options = {}) => [
|
|
2001
2099
|
{
|
|
2002
|
-
...
|
|
2100
|
+
...pluginDeMorgan.configs.recommended,
|
|
2003
2101
|
name: "ntnyq/de-morgan",
|
|
2004
2102
|
rules: {
|
|
2005
|
-
...
|
|
2103
|
+
...pluginDeMorgan.configs.recommended.rules,
|
|
2006
2104
|
// Overrides rules
|
|
2007
2105
|
...options.overrides
|
|
2008
2106
|
}
|
|
2009
2107
|
}
|
|
2010
2108
|
];
|
|
2011
2109
|
|
|
2012
|
-
|
|
2013
|
-
var configMarkdown = (options = {}) => {
|
|
2110
|
+
const configMarkdown = (options = {}) => {
|
|
2014
2111
|
const {
|
|
2015
2112
|
/**
|
|
2016
2113
|
* code block files
|
|
2017
2114
|
*/
|
|
2018
2115
|
files = [GLOB_MARKDOWN_CODE],
|
|
2019
|
-
|
|
2020
|
-
* other extensions
|
|
2021
|
-
*/
|
|
2022
|
-
extensions = []
|
|
2116
|
+
extraFileExtensions = []
|
|
2023
2117
|
} = options;
|
|
2024
|
-
const
|
|
2118
|
+
const configs$1 = [
|
|
2025
2119
|
/**
|
|
2026
2120
|
* extracting code blocks to be linted individually
|
|
2027
2121
|
*/
|
|
2028
|
-
...
|
|
2122
|
+
...pluginMarkdown.configs.processor.map((config) => ({
|
|
2029
2123
|
...config,
|
|
2030
2124
|
name: `ntnyq/${config.name}`
|
|
2031
2125
|
})),
|
|
@@ -2037,7 +2131,7 @@ var configMarkdown = (options = {}) => {
|
|
|
2037
2131
|
files,
|
|
2038
2132
|
ignores: [GLOB_MARKDOWN_NESTED],
|
|
2039
2133
|
processor: mergeProcessors([
|
|
2040
|
-
|
|
2134
|
+
pluginMarkdown.processors.markdown,
|
|
2041
2135
|
// Just pass through processor
|
|
2042
2136
|
processorPassThrough
|
|
2043
2137
|
])
|
|
@@ -2054,7 +2148,7 @@ var configMarkdown = (options = {}) => {
|
|
|
2054
2148
|
files: [
|
|
2055
2149
|
...files,
|
|
2056
2150
|
// more nested extensions to disable
|
|
2057
|
-
...
|
|
2151
|
+
...extraFileExtensions.map((ext) => `${GLOB_MARKDOWN}/**/*${ext}`)
|
|
2058
2152
|
],
|
|
2059
2153
|
languageOptions: {
|
|
2060
2154
|
parserOptions: {
|
|
@@ -2067,7 +2161,6 @@ var configMarkdown = (options = {}) => {
|
|
|
2067
2161
|
}
|
|
2068
2162
|
},
|
|
2069
2163
|
rules: {
|
|
2070
|
-
"@typescript-eslint/comma-dangle": "off",
|
|
2071
2164
|
"@typescript-eslint/consistent-type-imports": "off",
|
|
2072
2165
|
"@typescript-eslint/no-extraneous-class": "off",
|
|
2073
2166
|
"@typescript-eslint/no-namespace": "off",
|
|
@@ -2094,11 +2187,10 @@ var configMarkdown = (options = {}) => {
|
|
|
2094
2187
|
}
|
|
2095
2188
|
}
|
|
2096
2189
|
];
|
|
2097
|
-
return
|
|
2190
|
+
return configs$1;
|
|
2098
2191
|
};
|
|
2099
2192
|
|
|
2100
|
-
|
|
2101
|
-
var configPrettier = (options = {}) => {
|
|
2193
|
+
const configPrettier = (options = {}) => {
|
|
2102
2194
|
const {
|
|
2103
2195
|
disabledFiles = [GLOB_SVG, GLOB_TOML, GLOB_ASTRO, GLOB_SVELTE],
|
|
2104
2196
|
// User defined disabled files
|
|
@@ -2108,7 +2200,7 @@ var configPrettier = (options = {}) => {
|
|
|
2108
2200
|
{
|
|
2109
2201
|
name: "ntnyq/prettier",
|
|
2110
2202
|
plugins: {
|
|
2111
|
-
prettier:
|
|
2203
|
+
prettier: pluginPrettier
|
|
2112
2204
|
},
|
|
2113
2205
|
rules: {
|
|
2114
2206
|
"vue/array-bracket-newline": "off",
|
|
@@ -2148,7 +2240,7 @@ var configPrettier = (options = {}) => {
|
|
|
2148
2240
|
"vue/space-infix-ops": "off",
|
|
2149
2241
|
"vue/space-unary-ops": "off",
|
|
2150
2242
|
"vue/template-curly-spacing": "off",
|
|
2151
|
-
...
|
|
2243
|
+
...pluginPrettier.configs.recommended.rules,
|
|
2152
2244
|
"prettier/prettier": options.severity || "warn",
|
|
2153
2245
|
// Overrides rules
|
|
2154
2246
|
...options.overrides
|
|
@@ -2161,7 +2253,7 @@ var configPrettier = (options = {}) => {
|
|
|
2161
2253
|
name: "ntnyq/prettier/disabled",
|
|
2162
2254
|
files: [...disabledFiles, ...userDisabledFiles],
|
|
2163
2255
|
plugins: {
|
|
2164
|
-
prettier:
|
|
2256
|
+
prettier: pluginPrettier
|
|
2165
2257
|
},
|
|
2166
2258
|
rules: {
|
|
2167
2259
|
"prettier/prettier": "off"
|
|
@@ -2170,14 +2262,12 @@ var configPrettier = (options = {}) => {
|
|
|
2170
2262
|
];
|
|
2171
2263
|
};
|
|
2172
2264
|
|
|
2173
|
-
|
|
2174
|
-
import globals from "globals";
|
|
2175
|
-
var configSpecials = (options = {}) => {
|
|
2265
|
+
const configSpecials = (options = {}) => {
|
|
2176
2266
|
const {
|
|
2177
2267
|
// Enable shadcn-vue support
|
|
2178
2268
|
shadcnVue: enableShadcnVue = hasShadcnVue()
|
|
2179
2269
|
} = options;
|
|
2180
|
-
const
|
|
2270
|
+
const configs = [
|
|
2181
2271
|
{
|
|
2182
2272
|
name: "ntnyq/specials/scripts",
|
|
2183
2273
|
files: [`**/scripts/${GLOB_SRC}`],
|
|
@@ -2232,8 +2322,8 @@ var configSpecials = (options = {}) => {
|
|
|
2232
2322
|
name: "ntnyq/specials/config-file",
|
|
2233
2323
|
files: [`**/*.config*.${GLOB_SRC_EXT}`],
|
|
2234
2324
|
plugins: {
|
|
2235
|
-
"import-x":
|
|
2236
|
-
perfectionist:
|
|
2325
|
+
"import-x": pluginImportX,
|
|
2326
|
+
perfectionist: pluginPerfectionist
|
|
2237
2327
|
},
|
|
2238
2328
|
rules: {
|
|
2239
2329
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
@@ -2253,7 +2343,7 @@ var configSpecials = (options = {}) => {
|
|
|
2253
2343
|
];
|
|
2254
2344
|
if (enableShadcnVue) {
|
|
2255
2345
|
const shadcnOptions = resolveSubOptions(options, "shadcnVue");
|
|
2256
|
-
|
|
2346
|
+
configs.push({
|
|
2257
2347
|
name: "ntnyq/specials/shadcn-vue",
|
|
2258
2348
|
files: shadcnOptions.files || [
|
|
2259
2349
|
"**/components/ui/**/*.ts",
|
|
@@ -2264,20 +2354,20 @@ var configSpecials = (options = {}) => {
|
|
|
2264
2354
|
"@typescript-eslint/no-unused-vars": "off",
|
|
2265
2355
|
"import-x/consistent-type-specifier-style": "off",
|
|
2266
2356
|
"vue/define-emits-declaration": "off",
|
|
2357
|
+
"vue/html-button-has-type": "off",
|
|
2358
|
+
"vue/no-duplicate-attr-inheritance": "off",
|
|
2267
2359
|
// Overrides rules
|
|
2268
2360
|
...shadcnOptions.overridesRules
|
|
2269
2361
|
}
|
|
2270
2362
|
});
|
|
2271
2363
|
}
|
|
2272
2364
|
if (options.specialCaseConfigs) {
|
|
2273
|
-
|
|
2365
|
+
configs.push(...options.specialCaseConfigs);
|
|
2274
2366
|
}
|
|
2275
|
-
return
|
|
2367
|
+
return configs;
|
|
2276
2368
|
};
|
|
2277
2369
|
|
|
2278
|
-
|
|
2279
|
-
import createGitIgnoreConfig from "eslint-config-flat-gitignore";
|
|
2280
|
-
var configGitIgnore = (options = {}) => {
|
|
2370
|
+
const configGitIgnore = (options = {}) => {
|
|
2281
2371
|
options.strict ??= false;
|
|
2282
2372
|
return [
|
|
2283
2373
|
{
|
|
@@ -2287,10 +2377,7 @@ var configGitIgnore = (options = {}) => {
|
|
|
2287
2377
|
];
|
|
2288
2378
|
};
|
|
2289
2379
|
|
|
2290
|
-
|
|
2291
|
-
import jsConfig from "@eslint/js";
|
|
2292
|
-
import globals2 from "globals";
|
|
2293
|
-
var strictRules = {
|
|
2380
|
+
const strictRules = {
|
|
2294
2381
|
complexity: ["error", { max: 30 }],
|
|
2295
2382
|
"max-depth": ["error", { max: 5 }],
|
|
2296
2383
|
"max-lines": [
|
|
@@ -2312,7 +2399,7 @@ var strictRules = {
|
|
|
2312
2399
|
"max-nested-callbacks": ["error", { max: 10 }],
|
|
2313
2400
|
"max-params": ["error", { max: 5 }]
|
|
2314
2401
|
};
|
|
2315
|
-
|
|
2402
|
+
const configJavaScript = (options = {}) => [
|
|
2316
2403
|
{
|
|
2317
2404
|
...jsConfig.configs.recommended,
|
|
2318
2405
|
name: "ntnyq/js/recommended"
|
|
@@ -2322,9 +2409,9 @@ var configJavaScript = (options = {}) => [
|
|
|
2322
2409
|
languageOptions: {
|
|
2323
2410
|
sourceType: "module",
|
|
2324
2411
|
globals: {
|
|
2325
|
-
...
|
|
2326
|
-
...
|
|
2327
|
-
...
|
|
2412
|
+
...globals.browser,
|
|
2413
|
+
...globals.es2021,
|
|
2414
|
+
...globals.node
|
|
2328
2415
|
}
|
|
2329
2416
|
},
|
|
2330
2417
|
rules: {
|
|
@@ -2510,7 +2597,7 @@ var configJavaScript = (options = {}) => [
|
|
|
2510
2597
|
}
|
|
2511
2598
|
}
|
|
2512
2599
|
];
|
|
2513
|
-
|
|
2600
|
+
const configJSX = () => [
|
|
2514
2601
|
{
|
|
2515
2602
|
name: "ntnyq/jsx",
|
|
2516
2603
|
files: [GLOB_JSX_ONLY],
|
|
@@ -2524,9 +2611,7 @@ var configJSX = () => [
|
|
|
2524
2611
|
}
|
|
2525
2612
|
];
|
|
2526
2613
|
|
|
2527
|
-
|
|
2528
|
-
import process4 from "node:process";
|
|
2529
|
-
var typeAwareRules = {
|
|
2614
|
+
const typeAwareRules = {
|
|
2530
2615
|
// too strict
|
|
2531
2616
|
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
2532
2617
|
"dot-notation": "off",
|
|
@@ -2558,16 +2643,17 @@ var typeAwareRules = {
|
|
|
2558
2643
|
"@typescript-eslint/triple-slash-reference": "error",
|
|
2559
2644
|
"@typescript-eslint/unbound-method": "error"
|
|
2560
2645
|
};
|
|
2561
|
-
|
|
2646
|
+
const recommendedRules = configs.recommended.reduce(
|
|
2562
2647
|
(rules, config) => {
|
|
2563
2648
|
return { ...rules, ...config.rules || {} };
|
|
2564
2649
|
},
|
|
2565
2650
|
{}
|
|
2566
2651
|
);
|
|
2567
|
-
|
|
2652
|
+
const configTypeScript = (options = {}) => {
|
|
2568
2653
|
const enableTypeAwareLint = !!options?.tsconfigPath;
|
|
2569
2654
|
const {
|
|
2570
|
-
|
|
2655
|
+
allowDefaultProject = [],
|
|
2656
|
+
extraFileExtensions = [],
|
|
2571
2657
|
filesTypeAware = [GLOB_TS, GLOB_TSX],
|
|
2572
2658
|
ignoresTypeAware = [GLOB_ASTRO, `${GLOB_MARKDOWN}/**`],
|
|
2573
2659
|
overridesTypeAwareRules = {},
|
|
@@ -2576,17 +2662,17 @@ var configTypeScript = (options = {}) => {
|
|
|
2576
2662
|
const files = options.files ?? [
|
|
2577
2663
|
GLOB_TS,
|
|
2578
2664
|
GLOB_TSX,
|
|
2579
|
-
// Enable typescript in these
|
|
2580
|
-
...
|
|
2665
|
+
// Enable typescript in these files
|
|
2666
|
+
...extraFileExtensions.map((ext) => `**/*${ext}`)
|
|
2581
2667
|
];
|
|
2582
2668
|
function createParserConfig(enableTypeAware = false, files2 = [], ignores = []) {
|
|
2583
2669
|
const typescriptParserOptions = {
|
|
2584
|
-
extraFileExtensions
|
|
2670
|
+
extraFileExtensions,
|
|
2585
2671
|
sourceType: "module",
|
|
2586
2672
|
...enableTypeAware ? {
|
|
2587
|
-
tsconfigRootDir:
|
|
2673
|
+
tsconfigRootDir: process.cwd(),
|
|
2588
2674
|
projectService: {
|
|
2589
|
-
allowDefaultProject: ["./*.js"],
|
|
2675
|
+
allowDefaultProject: ["./*.js", ...allowDefaultProject],
|
|
2590
2676
|
defaultProject: options.tsconfigPath
|
|
2591
2677
|
}
|
|
2592
2678
|
} : {},
|
|
@@ -2597,7 +2683,7 @@ var configTypeScript = (options = {}) => {
|
|
|
2597
2683
|
files: files2,
|
|
2598
2684
|
ignores: [...ignores],
|
|
2599
2685
|
languageOptions: {
|
|
2600
|
-
parser,
|
|
2686
|
+
parser: parser,
|
|
2601
2687
|
parserOptions: typescriptParserOptions
|
|
2602
2688
|
}
|
|
2603
2689
|
};
|
|
@@ -2608,7 +2694,7 @@ var configTypeScript = (options = {}) => {
|
|
|
2608
2694
|
name: "ntnyq/ts/setup",
|
|
2609
2695
|
plugins: {
|
|
2610
2696
|
"@typescript-eslint": plugin,
|
|
2611
|
-
antfu:
|
|
2697
|
+
antfu: pluginAntfu
|
|
2612
2698
|
}
|
|
2613
2699
|
},
|
|
2614
2700
|
...enableTypeAwareLint ? [
|
|
@@ -2751,11 +2837,10 @@ var configTypeScript = (options = {}) => {
|
|
|
2751
2837
|
];
|
|
2752
2838
|
};
|
|
2753
2839
|
|
|
2754
|
-
|
|
2755
|
-
var configESLintPlugin = async (options = {}) => {
|
|
2840
|
+
const configESLintPlugin = async (options = {}) => {
|
|
2756
2841
|
await ensurePackages(["eslint-plugin-eslint-plugin"]);
|
|
2757
2842
|
const pluginESLintPlugin = await interopDefault(
|
|
2758
|
-
import(
|
|
2843
|
+
import('eslint-plugin-eslint-plugin')
|
|
2759
2844
|
);
|
|
2760
2845
|
return [
|
|
2761
2846
|
{
|
|
@@ -2772,9 +2857,7 @@ var configESLintPlugin = async (options = {}) => {
|
|
|
2772
2857
|
];
|
|
2773
2858
|
};
|
|
2774
2859
|
|
|
2775
|
-
|
|
2776
|
-
import { createConfig } from "eslint-plugin-github-action";
|
|
2777
|
-
var configGitHubAction = (options = {}) => {
|
|
2860
|
+
const configGitHubAction = (options = {}) => {
|
|
2778
2861
|
const {
|
|
2779
2862
|
files = [GLOB_GITHUB_ACTION],
|
|
2780
2863
|
rules = {},
|
|
@@ -2797,8 +2880,7 @@ var configGitHubAction = (options = {}) => {
|
|
|
2797
2880
|
];
|
|
2798
2881
|
};
|
|
2799
2882
|
|
|
2800
|
-
|
|
2801
|
-
var configPerfectionist = (options = {}) => {
|
|
2883
|
+
const configPerfectionist = (options = {}) => {
|
|
2802
2884
|
const {
|
|
2803
2885
|
partitionByComment = PERFECTIONIST_EXTRA_RULE_OPTIONS.partitionByComment,
|
|
2804
2886
|
sortConstants: enableSortConstants = true,
|
|
@@ -2854,7 +2936,7 @@ var configPerfectionist = (options = {}) => {
|
|
|
2854
2936
|
}
|
|
2855
2937
|
]
|
|
2856
2938
|
};
|
|
2857
|
-
const
|
|
2939
|
+
const sharedRules = {
|
|
2858
2940
|
"perfectionist/sort-enums": [
|
|
2859
2941
|
"error",
|
|
2860
2942
|
{
|
|
@@ -2968,16 +3050,16 @@ var configPerfectionist = (options = {}) => {
|
|
|
2968
3050
|
}
|
|
2969
3051
|
]
|
|
2970
3052
|
};
|
|
2971
|
-
const
|
|
3053
|
+
const configs = [
|
|
2972
3054
|
{
|
|
2973
3055
|
name: options.all ? "ntnyq/perfectionist/all" : "ntnyq/perfectionist/common",
|
|
2974
3056
|
plugins: {
|
|
2975
|
-
perfectionist:
|
|
3057
|
+
perfectionist: pluginPerfectionist
|
|
2976
3058
|
},
|
|
2977
3059
|
rules: {
|
|
2978
3060
|
...commonRules,
|
|
2979
3061
|
...options.all ? {
|
|
2980
|
-
...
|
|
3062
|
+
...sharedRules,
|
|
2981
3063
|
...sortEnumsRules,
|
|
2982
3064
|
...sortTypesRules,
|
|
2983
3065
|
...sortConstantsRules,
|
|
@@ -2989,17 +3071,17 @@ var configPerfectionist = (options = {}) => {
|
|
|
2989
3071
|
}
|
|
2990
3072
|
];
|
|
2991
3073
|
if (options.all) {
|
|
2992
|
-
return
|
|
3074
|
+
return configs;
|
|
2993
3075
|
}
|
|
2994
3076
|
if (enableSortEnums) {
|
|
2995
|
-
|
|
3077
|
+
configs.push({
|
|
2996
3078
|
name: "ntnyq/perfectionist/enums",
|
|
2997
3079
|
files: [`**/enums/${GLOB_SRC}`, `**/enums.${GLOB_SRC_EXT}`],
|
|
2998
3080
|
plugins: {
|
|
2999
|
-
perfectionist:
|
|
3081
|
+
perfectionist: pluginPerfectionist
|
|
3000
3082
|
},
|
|
3001
3083
|
rules: {
|
|
3002
|
-
...
|
|
3084
|
+
...sharedRules,
|
|
3003
3085
|
...sortEnumsRules,
|
|
3004
3086
|
// Overrides rules
|
|
3005
3087
|
...options.overridesEnumsRules
|
|
@@ -3007,14 +3089,14 @@ var configPerfectionist = (options = {}) => {
|
|
|
3007
3089
|
});
|
|
3008
3090
|
}
|
|
3009
3091
|
if (enableSortTypes) {
|
|
3010
|
-
|
|
3092
|
+
configs.push({
|
|
3011
3093
|
name: "ntnyq/perfectionist/types",
|
|
3012
3094
|
files: [...GLOB_TYPES],
|
|
3013
3095
|
plugins: {
|
|
3014
|
-
perfectionist:
|
|
3096
|
+
perfectionist: pluginPerfectionist
|
|
3015
3097
|
},
|
|
3016
3098
|
rules: {
|
|
3017
|
-
...
|
|
3099
|
+
...sharedRules,
|
|
3018
3100
|
...sortTypesRules,
|
|
3019
3101
|
// Overrides rules
|
|
3020
3102
|
...options.overridesTypesRules
|
|
@@ -3022,61 +3104,65 @@ var configPerfectionist = (options = {}) => {
|
|
|
3022
3104
|
});
|
|
3023
3105
|
}
|
|
3024
3106
|
if (enableSortConstants) {
|
|
3025
|
-
|
|
3107
|
+
configs.push({
|
|
3026
3108
|
name: "ntnyq/perfectionist/constants",
|
|
3027
3109
|
files: [`**/constants/${GLOB_SRC}`, `**/constants.${GLOB_SRC_EXT}`],
|
|
3028
3110
|
plugins: {
|
|
3029
|
-
perfectionist:
|
|
3111
|
+
perfectionist: pluginPerfectionist
|
|
3030
3112
|
},
|
|
3031
3113
|
rules: {
|
|
3032
|
-
...
|
|
3114
|
+
...sharedRules,
|
|
3033
3115
|
...sortConstantsRules,
|
|
3034
3116
|
// Overrides rules
|
|
3035
3117
|
...options.overridesConstantsRules
|
|
3036
3118
|
}
|
|
3037
3119
|
});
|
|
3038
3120
|
}
|
|
3039
|
-
return
|
|
3121
|
+
return configs;
|
|
3040
3122
|
};
|
|
3041
3123
|
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3124
|
+
const configUnusedImports = async (options = {}) => {
|
|
3125
|
+
await ensurePackages(["eslint-plugin-unused-imports"]);
|
|
3126
|
+
const pluginUnusedImports = await interopDefault(
|
|
3127
|
+
import('eslint-plugin-unused-imports')
|
|
3128
|
+
);
|
|
3129
|
+
return [
|
|
3130
|
+
{
|
|
3131
|
+
name: "ntnyq/unused-imports",
|
|
3132
|
+
plugins: {
|
|
3133
|
+
"unused-imports": pluginUnusedImports
|
|
3134
|
+
},
|
|
3135
|
+
rules: {
|
|
3136
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
3137
|
+
"unused-imports/no-unused-imports": "error",
|
|
3138
|
+
"unused-imports/no-unused-vars": [
|
|
3139
|
+
"error",
|
|
3140
|
+
{
|
|
3141
|
+
args: "after-used",
|
|
3142
|
+
argsIgnorePattern: "^_",
|
|
3143
|
+
caughtErrors: "all",
|
|
3144
|
+
caughtErrorsIgnorePattern: "^_",
|
|
3145
|
+
destructuredArrayIgnorePattern: "^_",
|
|
3146
|
+
ignoreRestSiblings: true,
|
|
3147
|
+
vars: "all",
|
|
3148
|
+
varsIgnorePattern: "^_"
|
|
3149
|
+
}
|
|
3150
|
+
],
|
|
3151
|
+
// Overrides rules
|
|
3152
|
+
...options.overrides
|
|
3153
|
+
}
|
|
3067
3154
|
}
|
|
3068
|
-
|
|
3069
|
-
|
|
3155
|
+
];
|
|
3156
|
+
};
|
|
3070
3157
|
|
|
3071
|
-
|
|
3072
|
-
var configESLintComments = (options = {}) => [
|
|
3158
|
+
const configESLintComments = (options = {}) => [
|
|
3073
3159
|
{
|
|
3074
3160
|
name: "ntnyq/eslint-comments",
|
|
3075
3161
|
plugins: {
|
|
3076
|
-
"@eslint-community/eslint-comments":
|
|
3162
|
+
"@eslint-community/eslint-comments": pluginComments
|
|
3077
3163
|
},
|
|
3078
3164
|
rules: {
|
|
3079
|
-
...
|
|
3165
|
+
...pluginComments.configs.recommended.rules,
|
|
3080
3166
|
"@eslint-community/eslint-comments/disable-enable-pair": [
|
|
3081
3167
|
"error",
|
|
3082
3168
|
{ allowWholeFile: true }
|
|
@@ -3087,13 +3173,12 @@ var configESLintComments = (options = {}) => [
|
|
|
3087
3173
|
}
|
|
3088
3174
|
];
|
|
3089
3175
|
|
|
3090
|
-
// src/core.ts
|
|
3091
3176
|
function defineESLintConfig(options = {}, ...userConfigs) {
|
|
3092
3177
|
const {
|
|
3093
3178
|
/**
|
|
3094
|
-
*
|
|
3179
|
+
* Shareable options
|
|
3095
3180
|
*/
|
|
3096
|
-
|
|
3181
|
+
shareable = {},
|
|
3097
3182
|
/**
|
|
3098
3183
|
* Conditional by deps
|
|
3099
3184
|
*/
|
|
@@ -3121,17 +3206,19 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3121
3206
|
githubAction: enableGitHubAction = true,
|
|
3122
3207
|
perfectionist: enablePerfectionist = true,
|
|
3123
3208
|
// disabled by default
|
|
3209
|
+
pnpm: enablePnpm = false,
|
|
3124
3210
|
svgo: enableSVGO = false,
|
|
3125
3211
|
eslintPlugin: enableESLintPlugin = false
|
|
3126
3212
|
} = options;
|
|
3127
|
-
const
|
|
3213
|
+
const configs = [];
|
|
3214
|
+
const { extraFileExtensions = [] } = shareable;
|
|
3128
3215
|
if (enableVue) {
|
|
3129
|
-
|
|
3216
|
+
extraFileExtensions.push(".vue");
|
|
3130
3217
|
}
|
|
3131
3218
|
if (enableGitIgnore) {
|
|
3132
|
-
|
|
3219
|
+
configs.push(configGitIgnore(resolveSubOptions(options, "gitignore")));
|
|
3133
3220
|
}
|
|
3134
|
-
|
|
3221
|
+
configs.push(
|
|
3135
3222
|
configIgnores(options.ignores),
|
|
3136
3223
|
configJSX(),
|
|
3137
3224
|
configNode({
|
|
@@ -3157,7 +3244,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3157
3244
|
})
|
|
3158
3245
|
);
|
|
3159
3246
|
if (enablePerfectionist) {
|
|
3160
|
-
|
|
3247
|
+
configs.push(
|
|
3161
3248
|
configPerfectionist({
|
|
3162
3249
|
...resolveSubOptions(options, "perfectionist"),
|
|
3163
3250
|
overrides: getOverrides(options, "perfectionist")
|
|
@@ -3165,14 +3252,14 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3165
3252
|
);
|
|
3166
3253
|
}
|
|
3167
3254
|
if (enableUnicorn) {
|
|
3168
|
-
|
|
3255
|
+
configs.push(
|
|
3169
3256
|
configUnicorn({
|
|
3170
3257
|
overrides: getOverrides(options, "unicorn")
|
|
3171
3258
|
})
|
|
3172
3259
|
);
|
|
3173
3260
|
}
|
|
3174
3261
|
if (enablePinia) {
|
|
3175
|
-
|
|
3262
|
+
configs.push(
|
|
3176
3263
|
configPinia({
|
|
3177
3264
|
...resolveSubOptions(options, "pinia"),
|
|
3178
3265
|
overrides: getOverrides(options, "pinia")
|
|
@@ -3180,14 +3267,14 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3180
3267
|
);
|
|
3181
3268
|
}
|
|
3182
3269
|
if (enableDeMorgan) {
|
|
3183
|
-
|
|
3270
|
+
configs.push(
|
|
3184
3271
|
configDeMorgan({
|
|
3185
3272
|
overrides: getOverrides(options, "deMorgan")
|
|
3186
3273
|
})
|
|
3187
3274
|
);
|
|
3188
3275
|
}
|
|
3189
3276
|
if (enableRegexp) {
|
|
3190
|
-
|
|
3277
|
+
configs.push(
|
|
3191
3278
|
configRegexp({
|
|
3192
3279
|
...resolveSubOptions(options, "regexp"),
|
|
3193
3280
|
overrides: getOverrides(options, "regexp")
|
|
@@ -3195,25 +3282,25 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3195
3282
|
);
|
|
3196
3283
|
}
|
|
3197
3284
|
if (enableTypeScript) {
|
|
3198
|
-
|
|
3285
|
+
configs.push(
|
|
3199
3286
|
configTypeScript({
|
|
3200
3287
|
...resolveSubOptions(options, "typescript"),
|
|
3201
|
-
|
|
3202
|
-
|
|
3288
|
+
overrides: getOverrides(options, "typescript"),
|
|
3289
|
+
extraFileExtensions
|
|
3203
3290
|
})
|
|
3204
3291
|
);
|
|
3205
3292
|
}
|
|
3206
3293
|
if (enableVue) {
|
|
3207
|
-
|
|
3294
|
+
configs.push(
|
|
3208
3295
|
configVue({
|
|
3209
3296
|
...resolveSubOptions(options, "vue"),
|
|
3210
|
-
|
|
3211
|
-
|
|
3297
|
+
overrides: getOverrides(options, "vue"),
|
|
3298
|
+
extraFileExtensions
|
|
3212
3299
|
})
|
|
3213
3300
|
);
|
|
3214
3301
|
}
|
|
3215
3302
|
if (enableYML) {
|
|
3216
|
-
|
|
3303
|
+
configs.push(
|
|
3217
3304
|
configYml({
|
|
3218
3305
|
...resolveSubOptions(options, "yml"),
|
|
3219
3306
|
overrides: getOverrides(options, "yml")
|
|
@@ -3221,7 +3308,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3221
3308
|
);
|
|
3222
3309
|
}
|
|
3223
3310
|
if (enableTOML) {
|
|
3224
|
-
|
|
3311
|
+
configs.push(
|
|
3225
3312
|
configToml({
|
|
3226
3313
|
...resolveSubOptions(options, "toml"),
|
|
3227
3314
|
overrides: getOverrides(options, "toml")
|
|
@@ -3229,7 +3316,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3229
3316
|
);
|
|
3230
3317
|
}
|
|
3231
3318
|
if (enableJSONC) {
|
|
3232
|
-
|
|
3319
|
+
configs.push(
|
|
3233
3320
|
configJsonc({
|
|
3234
3321
|
...resolveSubOptions(options, "jsonc"),
|
|
3235
3322
|
overrides: getOverrides(options, "jsonc")
|
|
@@ -3237,10 +3324,10 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3237
3324
|
);
|
|
3238
3325
|
}
|
|
3239
3326
|
if (enableSort) {
|
|
3240
|
-
|
|
3327
|
+
configs.push(configSort(resolveSubOptions(options, "sort")));
|
|
3241
3328
|
}
|
|
3242
3329
|
if (enableTest) {
|
|
3243
|
-
|
|
3330
|
+
configs.push(
|
|
3244
3331
|
configTest({
|
|
3245
3332
|
...resolveSubOptions(options, "test"),
|
|
3246
3333
|
overrides: getOverrides(options, "test")
|
|
@@ -3248,30 +3335,30 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3248
3335
|
);
|
|
3249
3336
|
}
|
|
3250
3337
|
if (enableUnoCSS) {
|
|
3251
|
-
|
|
3338
|
+
configs.push(
|
|
3252
3339
|
configUnoCSS({
|
|
3253
3340
|
overrides: getOverrides(options, "unocss")
|
|
3254
3341
|
})
|
|
3255
3342
|
);
|
|
3256
3343
|
}
|
|
3257
3344
|
if (enableMarkdown) {
|
|
3258
|
-
|
|
3345
|
+
configs.push(
|
|
3259
3346
|
configMarkdown({
|
|
3260
3347
|
...resolveSubOptions(options, "markdown"),
|
|
3261
|
-
|
|
3262
|
-
|
|
3348
|
+
overrides: getOverrides(options, "markdown"),
|
|
3349
|
+
extraFileExtensions
|
|
3263
3350
|
})
|
|
3264
3351
|
);
|
|
3265
3352
|
}
|
|
3266
3353
|
if (enableAntfu) {
|
|
3267
|
-
|
|
3354
|
+
configs.push(
|
|
3268
3355
|
configAntfu({
|
|
3269
3356
|
overrides: getOverrides(options, "antfu")
|
|
3270
3357
|
})
|
|
3271
3358
|
);
|
|
3272
3359
|
}
|
|
3273
3360
|
if (enableDepend) {
|
|
3274
|
-
|
|
3361
|
+
configs.push(
|
|
3275
3362
|
configDepend({
|
|
3276
3363
|
...resolveSubOptions(options, "depend"),
|
|
3277
3364
|
overrides: getOverrides(options, "depend")
|
|
@@ -3279,175 +3366,51 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3279
3366
|
);
|
|
3280
3367
|
}
|
|
3281
3368
|
if (enableNtnyq) {
|
|
3282
|
-
|
|
3369
|
+
configs.push(
|
|
3283
3370
|
configNtnyq({
|
|
3284
3371
|
overrides: getOverrides(options, "ntnyq")
|
|
3285
3372
|
})
|
|
3286
3373
|
);
|
|
3287
3374
|
}
|
|
3288
3375
|
if (enableGitHubAction) {
|
|
3289
|
-
|
|
3376
|
+
configs.push(
|
|
3290
3377
|
configGitHubAction({
|
|
3291
3378
|
overrides: getOverrides(options, "githubAction")
|
|
3292
3379
|
})
|
|
3293
3380
|
);
|
|
3294
3381
|
}
|
|
3295
3382
|
if (enableESLintPlugin) {
|
|
3296
|
-
|
|
3383
|
+
configs.push(
|
|
3297
3384
|
configESLintPlugin({
|
|
3298
3385
|
overrides: getOverrides(options, "eslintPlugin")
|
|
3299
3386
|
})
|
|
3300
3387
|
);
|
|
3301
3388
|
}
|
|
3389
|
+
if (enablePnpm) {
|
|
3390
|
+
configs.push(
|
|
3391
|
+
configPnpm({
|
|
3392
|
+
...resolveSubOptions(options, "pnpm"),
|
|
3393
|
+
overrides: getOverrides(options, "pnpm")
|
|
3394
|
+
})
|
|
3395
|
+
);
|
|
3396
|
+
}
|
|
3302
3397
|
if (enableSVGO) {
|
|
3303
|
-
|
|
3398
|
+
configs.push(configSVGO(resolveSubOptions(options, "svgo")));
|
|
3304
3399
|
}
|
|
3305
|
-
const specialsConfigs = configSpecials(
|
|
3400
|
+
const specialsConfigs = configSpecials(
|
|
3401
|
+
resolveSubOptions(options, "specials")
|
|
3402
|
+
);
|
|
3306
3403
|
const prettierConfigs = enablePrettier ? configPrettier({
|
|
3307
3404
|
...resolveSubOptions(options, "prettier"),
|
|
3308
3405
|
overrides: getOverrides(options, "prettier")
|
|
3309
3406
|
}) : [];
|
|
3310
3407
|
const composer = new FlatConfigComposer(
|
|
3311
|
-
...
|
|
3408
|
+
...configs,
|
|
3312
3409
|
...userConfigs,
|
|
3313
3410
|
...specialsConfigs,
|
|
3314
3411
|
...prettierConfigs
|
|
3315
3412
|
);
|
|
3316
3413
|
return composer;
|
|
3317
3414
|
}
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
GLOB_ASTRO,
|
|
3321
|
-
GLOB_ASTRO_TS,
|
|
3322
|
-
GLOB_CSS,
|
|
3323
|
-
GLOB_DIST,
|
|
3324
|
-
GLOB_DTS,
|
|
3325
|
-
GLOB_EXCLUDE,
|
|
3326
|
-
GLOB_GITHUB_ACTION,
|
|
3327
|
-
GLOB_HTML,
|
|
3328
|
-
GLOB_JS,
|
|
3329
|
-
GLOB_JSON,
|
|
3330
|
-
GLOB_JSON5,
|
|
3331
|
-
GLOB_JSONC,
|
|
3332
|
-
GLOB_JSX,
|
|
3333
|
-
GLOB_JSX_ONLY,
|
|
3334
|
-
GLOB_LESS,
|
|
3335
|
-
GLOB_LOCKFILE,
|
|
3336
|
-
GLOB_MARKDOWN,
|
|
3337
|
-
GLOB_MARKDOWN_CODE,
|
|
3338
|
-
GLOB_MARKDOWN_NESTED,
|
|
3339
|
-
GLOB_NODE_MODULES,
|
|
3340
|
-
GLOB_PACKAGE_JSON,
|
|
3341
|
-
GLOB_PINIA_STORE,
|
|
3342
|
-
GLOB_POSTCSS,
|
|
3343
|
-
GLOB_SCSS,
|
|
3344
|
-
GLOB_SRC,
|
|
3345
|
-
GLOB_SRC_EXT,
|
|
3346
|
-
GLOB_STYLE,
|
|
3347
|
-
GLOB_SVELTE,
|
|
3348
|
-
GLOB_SVG,
|
|
3349
|
-
GLOB_TEST,
|
|
3350
|
-
GLOB_TOML,
|
|
3351
|
-
GLOB_TS,
|
|
3352
|
-
GLOB_TSCONFIG_JSON,
|
|
3353
|
-
GLOB_TSX,
|
|
3354
|
-
GLOB_TSX_ONLY,
|
|
3355
|
-
GLOB_TYPES,
|
|
3356
|
-
GLOB_TYPE_TEST,
|
|
3357
|
-
GLOB_VUE,
|
|
3358
|
-
GLOB_YAML,
|
|
3359
|
-
PERFECTIONIST_COMMON_RULE_OPTIONS,
|
|
3360
|
-
PERFECTIONIST_EXTRA_RULE_OPTIONS,
|
|
3361
|
-
PERFECTIONIST_SORT_CLASSES_GROUPS,
|
|
3362
|
-
PERFECTIONIST_SORT_IMPORTS_GROUPS,
|
|
3363
|
-
PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS,
|
|
3364
|
-
PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS,
|
|
3365
|
-
PERFECTIONIST_SORT_OBJECTS_GROUPS,
|
|
3366
|
-
PRETTIER_DEFAULT_OPTIONS,
|
|
3367
|
-
combineConfigs,
|
|
3368
|
-
configAntfu,
|
|
3369
|
-
configCommand,
|
|
3370
|
-
configDeMorgan,
|
|
3371
|
-
configDepend,
|
|
3372
|
-
configESLintComments,
|
|
3373
|
-
configESLintPlugin,
|
|
3374
|
-
configFormat,
|
|
3375
|
-
configGitHubAction,
|
|
3376
|
-
configGitIgnore,
|
|
3377
|
-
configIgnores,
|
|
3378
|
-
configImportX,
|
|
3379
|
-
configJSX,
|
|
3380
|
-
configJavaScript,
|
|
3381
|
-
configJsdoc,
|
|
3382
|
-
configJsonc,
|
|
3383
|
-
configMarkdown,
|
|
3384
|
-
configNode,
|
|
3385
|
-
configNtnyq,
|
|
3386
|
-
configPerfectionist,
|
|
3387
|
-
configPinia,
|
|
3388
|
-
configPrettier,
|
|
3389
|
-
configRegexp,
|
|
3390
|
-
configSVGO,
|
|
3391
|
-
configSort,
|
|
3392
|
-
configSpecials,
|
|
3393
|
-
configTest,
|
|
3394
|
-
configToml,
|
|
3395
|
-
configTypeScript,
|
|
3396
|
-
configUnicorn,
|
|
3397
|
-
configUnoCSS,
|
|
3398
|
-
configUnusedImports,
|
|
3399
|
-
configVue,
|
|
3400
|
-
configYml,
|
|
3401
|
-
configs as configsTypeScript,
|
|
3402
|
-
createNodeResolver,
|
|
3403
|
-
createTypeScriptImportResolver,
|
|
3404
|
-
defineESLintConfig,
|
|
3405
|
-
ensurePackages,
|
|
3406
|
-
getOverrides,
|
|
3407
|
-
hasPinia,
|
|
3408
|
-
hasShadcnVue,
|
|
3409
|
-
hasTypeScript,
|
|
3410
|
-
hasUnoCSS,
|
|
3411
|
-
hasVitest,
|
|
3412
|
-
hasVue,
|
|
3413
|
-
interopDefault,
|
|
3414
|
-
isInGitHooksOrRunByNanoStagedOrRunByTSX,
|
|
3415
|
-
mergePrettierOptions,
|
|
3416
|
-
mergeProcessors,
|
|
3417
|
-
parserJsonc,
|
|
3418
|
-
parserPlain,
|
|
3419
|
-
parserToml,
|
|
3420
|
-
parser as parserTypeScript,
|
|
3421
|
-
parserVue,
|
|
3422
|
-
parserYaml,
|
|
3423
|
-
default8 as pluginAntfu,
|
|
3424
|
-
default24 as pluginComments,
|
|
3425
|
-
default19 as pluginDeMorgan,
|
|
3426
|
-
pluginDepend,
|
|
3427
|
-
default13 as pluginFormat,
|
|
3428
|
-
default21 as pluginGitHubAction,
|
|
3429
|
-
default17 as pluginImportX,
|
|
3430
|
-
default9 as pluginJsdoc,
|
|
3431
|
-
default10 as pluginJsonc,
|
|
3432
|
-
default7 as pluginMarkdown,
|
|
3433
|
-
default20 as pluginNoOnlyTests,
|
|
3434
|
-
default2 as pluginNode,
|
|
3435
|
-
default12 as pluginNtnyq,
|
|
3436
|
-
default22 as pluginPerfectionist,
|
|
3437
|
-
default11 as pluginPinia,
|
|
3438
|
-
default18 as pluginPrettier,
|
|
3439
|
-
pluginRegexp,
|
|
3440
|
-
default5 as pluginSvgo,
|
|
3441
|
-
default6 as pluginToml,
|
|
3442
|
-
plugin as pluginTypeScript,
|
|
3443
|
-
default16 as pluginUnicorn,
|
|
3444
|
-
default14 as pluginUnoCSS,
|
|
3445
|
-
default23 as pluginUnusedImports,
|
|
3446
|
-
default15 as pluginVitest,
|
|
3447
|
-
default3 as pluginVue,
|
|
3448
|
-
default4 as pluginYml,
|
|
3449
|
-
processorPassThrough,
|
|
3450
|
-
default25 as processorVueBlocks,
|
|
3451
|
-
resolveSubOptions,
|
|
3452
|
-
toArray
|
|
3453
|
-
};
|
|
3415
|
+
|
|
3416
|
+
export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_GITHUB_ACTION, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_JSX_ONLY, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_PACKAGE_JSON, GLOB_PINIA_STORE, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG_JSON, GLOB_TSX, GLOB_TSX_ONLY, GLOB_TYPES, GLOB_TYPE_TEST, GLOB_VUE, GLOB_YAML, PERFECTIONIST_COMMON_RULE_OPTIONS, PERFECTIONIST_EXTRA_RULE_OPTIONS, PERFECTIONIST_SORT_CLASSES_GROUPS, PERFECTIONIST_SORT_IMPORTS_GROUPS, PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS, PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS, PERFECTIONIST_SORT_OBJECTS_GROUPS, PRETTIER_DEFAULT_OPTIONS, combineConfigs, configAntfu, configCommand, configDeMorgan, configDepend, configESLintComments, configESLintPlugin, configFormat, configGitHubAction, configGitIgnore, configIgnores, configImportX, configJSX, configJavaScript, configJsdoc, configJsonc, configMarkdown, configNode, configNtnyq, configPerfectionist, configPinia, configPnpm, configPrettier, configRegexp, configSVGO, configSort, configSpecials, configTest, configToml, configTypeScript, configUnicorn, configUnoCSS, configUnusedImports, configVue, configYml, defineESLintConfig, ensurePackages, getOverrides, hasPinia, hasShadcnVue, hasTypeScript, hasUnoCSS, hasVitest, hasVue, interopDefault, isInGitHooksOrRunBySpecifyPackages, mergePrettierOptions, parserPlain, resolveSubOptions };
|