@ntnyq/eslint-config 4.0.0-beta.8 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -9
- package/dist/{index.d.ts → index.d.mts} +476 -243
- package/dist/{index.js → index.mjs} +519 -552
- package/package.json +54 -49
|
@@ -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,22 +1021,76 @@ 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: {
|
|
@@ -973,7 +1105,7 @@ var configSort = (options = {}) => {
|
|
|
973
1105
|
});
|
|
974
1106
|
}
|
|
975
1107
|
if (additionalYamlFiles.length) {
|
|
976
|
-
|
|
1108
|
+
configs.push({
|
|
977
1109
|
name: "ntnyq/sort/additional-yaml",
|
|
978
1110
|
files: additionalYamlFiles,
|
|
979
1111
|
rules: {
|
|
@@ -987,11 +1119,10 @@ var configSort = (options = {}) => {
|
|
|
987
1119
|
}
|
|
988
1120
|
});
|
|
989
1121
|
}
|
|
990
|
-
return
|
|
1122
|
+
return configs;
|
|
991
1123
|
};
|
|
992
1124
|
|
|
993
|
-
|
|
994
|
-
var configSVGO = (options = {}) => {
|
|
1125
|
+
const configSVGO = (options = {}) => {
|
|
995
1126
|
const { files = [GLOB_SVG], ignores = [] } = options;
|
|
996
1127
|
return [
|
|
997
1128
|
{
|
|
@@ -999,7 +1130,7 @@ var configSVGO = (options = {}) => {
|
|
|
999
1130
|
files,
|
|
1000
1131
|
ignores,
|
|
1001
1132
|
plugins: {
|
|
1002
|
-
svgo:
|
|
1133
|
+
svgo: pluginSvgo
|
|
1003
1134
|
},
|
|
1004
1135
|
languageOptions: {
|
|
1005
1136
|
parser: parserPlain
|
|
@@ -1011,66 +1142,53 @@ var configSVGO = (options = {}) => {
|
|
|
1011
1142
|
];
|
|
1012
1143
|
};
|
|
1013
1144
|
|
|
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", {
|
|
1145
|
+
const hasPinia = () => isPackageExists("pinia");
|
|
1146
|
+
const hasVitest = () => isPackageExists("vitest");
|
|
1147
|
+
const hasTypeScript = () => isPackageExists("typescript");
|
|
1148
|
+
const hasShadcnVue = () => isPackageExists("radix-vue") && isPackageExists("clsx");
|
|
1149
|
+
const hasUnoCSS = () => isPackageExists("unocss") || isPackageExists("@unocss/postcss") || isPackageExists("@unocss/webpack") || isPackageExists("@unocss/nuxt");
|
|
1150
|
+
const hasVue = () => isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("vuepress") || isPackageExists("@slidev/cli") || isPackageExists("vue", {
|
|
1024
1151
|
paths: [
|
|
1025
1152
|
resolve(process.cwd(), "playground"),
|
|
1026
1153
|
resolve(process.cwd(), "docs")
|
|
1027
1154
|
]
|
|
1028
1155
|
});
|
|
1029
1156
|
|
|
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
1157
|
function resolveSubOptions(options, key) {
|
|
1038
1158
|
return typeof options[key] === "boolean" ? {} : options[key] || {};
|
|
1039
1159
|
}
|
|
1040
1160
|
|
|
1041
|
-
// src/utils/getOverrides.ts
|
|
1042
1161
|
function getOverrides(options, key) {
|
|
1043
1162
|
const subOptions = resolveSubOptions(options, key);
|
|
1044
1163
|
return "overrides" in subOptions && subOptions.overrides ? subOptions.overrides : {};
|
|
1045
1164
|
}
|
|
1046
1165
|
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
const resolved = await Promise.all(configs2);
|
|
1166
|
+
async function combineConfigs(...configs) {
|
|
1167
|
+
const resolved = await Promise.all(configs);
|
|
1050
1168
|
return resolved.flat();
|
|
1051
1169
|
}
|
|
1052
1170
|
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1171
|
+
const CHECKED_RUNNER_PACKAGES = [
|
|
1172
|
+
"nano-staged",
|
|
1173
|
+
"lint-staged",
|
|
1174
|
+
"lefthook",
|
|
1175
|
+
"tsx"
|
|
1176
|
+
];
|
|
1177
|
+
function isInGitHooksOrRunBySpecifyPackages() {
|
|
1178
|
+
return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || CHECKED_RUNNER_PACKAGES.some(
|
|
1179
|
+
(packageName) => process.env.npm_lifecycle_script?.startsWith(packageName)
|
|
1180
|
+
));
|
|
1062
1181
|
}
|
|
1063
1182
|
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
var isCwdInScope = isPackageExists2("@ntnyq/eslint-config");
|
|
1183
|
+
const scopeUrl = fileURLToPath(new URL(".", import.meta.url));
|
|
1184
|
+
const isCwdInScope = isPackageExists("@ntnyq/eslint-config");
|
|
1067
1185
|
function isPackageInScope(name) {
|
|
1068
|
-
return
|
|
1186
|
+
return isPackageExists(name, {
|
|
1069
1187
|
paths: [scopeUrl]
|
|
1070
1188
|
});
|
|
1071
1189
|
}
|
|
1072
1190
|
async function ensurePackages(packages) {
|
|
1073
|
-
if (
|
|
1191
|
+
if (process.env.CI || !process.stdout.isTTY || isInGitHooksOrRunBySpecifyPackages() || !isCwdInScope) {
|
|
1074
1192
|
return;
|
|
1075
1193
|
}
|
|
1076
1194
|
const nonExistingPackages = packages.filter(
|
|
@@ -1079,13 +1197,13 @@ async function ensurePackages(packages) {
|
|
|
1079
1197
|
if (nonExistingPackages.length === 0) {
|
|
1080
1198
|
return;
|
|
1081
1199
|
}
|
|
1082
|
-
const { confirm } = await import(
|
|
1200
|
+
const { confirm } = await import('@clack/prompts');
|
|
1083
1201
|
const confirmInstall = await confirm({
|
|
1084
1202
|
message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`
|
|
1085
1203
|
});
|
|
1086
1204
|
if (confirmInstall) {
|
|
1087
1205
|
try {
|
|
1088
|
-
const { installPackage } = await import(
|
|
1206
|
+
const { installPackage } = await import('@antfu/install-pkg');
|
|
1089
1207
|
await installPackage(nonExistingPackages, { dev: true });
|
|
1090
1208
|
} catch (err) {
|
|
1091
1209
|
console.log(err);
|
|
@@ -1093,13 +1211,11 @@ async function ensurePackages(packages) {
|
|
|
1093
1211
|
}
|
|
1094
1212
|
}
|
|
1095
1213
|
|
|
1096
|
-
// src/utils/interopDefault.ts
|
|
1097
1214
|
async function interopDefault(mod) {
|
|
1098
1215
|
const resolved = await mod;
|
|
1099
1216
|
return resolved.default || resolved;
|
|
1100
1217
|
}
|
|
1101
1218
|
|
|
1102
|
-
// src/utils/mergePrettierOptions.ts
|
|
1103
1219
|
function mergePrettierOptions(options = {}, overrides = {}) {
|
|
1104
1220
|
const result = {
|
|
1105
1221
|
...options,
|
|
@@ -1114,18 +1230,17 @@ function mergePrettierOptions(options = {}, overrides = {}) {
|
|
|
1114
1230
|
return result;
|
|
1115
1231
|
}
|
|
1116
1232
|
|
|
1117
|
-
|
|
1118
|
-
var configTest = (options = {}) => {
|
|
1233
|
+
const configTest = (options = {}) => {
|
|
1119
1234
|
const {
|
|
1120
1235
|
// default test files
|
|
1121
1236
|
files = [...GLOB_TEST],
|
|
1122
1237
|
vitest: enableVitest = hasVitest()
|
|
1123
1238
|
} = options;
|
|
1124
|
-
const
|
|
1239
|
+
const configs = [
|
|
1125
1240
|
{
|
|
1126
1241
|
name: "ntnyq/test/setup",
|
|
1127
1242
|
plugins: {
|
|
1128
|
-
"no-only-tests":
|
|
1243
|
+
"no-only-tests": pluginNoOnlyTests
|
|
1129
1244
|
}
|
|
1130
1245
|
},
|
|
1131
1246
|
{
|
|
@@ -1141,11 +1256,11 @@ var configTest = (options = {}) => {
|
|
|
1141
1256
|
}
|
|
1142
1257
|
];
|
|
1143
1258
|
if (enableVitest) {
|
|
1144
|
-
|
|
1259
|
+
configs.push({
|
|
1145
1260
|
name: "ntnyq/test/vitest",
|
|
1146
1261
|
files,
|
|
1147
1262
|
plugins: {
|
|
1148
|
-
vitest:
|
|
1263
|
+
vitest: pluginVitest
|
|
1149
1264
|
},
|
|
1150
1265
|
settings: {
|
|
1151
1266
|
/**
|
|
@@ -1157,7 +1272,7 @@ var configTest = (options = {}) => {
|
|
|
1157
1272
|
// },
|
|
1158
1273
|
},
|
|
1159
1274
|
rules: {
|
|
1160
|
-
...
|
|
1275
|
+
...pluginVitest.configs.recommended.rules,
|
|
1161
1276
|
"vitest/expect-expect": [
|
|
1162
1277
|
"error",
|
|
1163
1278
|
{
|
|
@@ -1177,18 +1292,17 @@ var configTest = (options = {}) => {
|
|
|
1177
1292
|
}
|
|
1178
1293
|
});
|
|
1179
1294
|
}
|
|
1180
|
-
return
|
|
1295
|
+
return configs;
|
|
1181
1296
|
};
|
|
1182
1297
|
|
|
1183
|
-
|
|
1184
|
-
var configToml = (options = {}) => {
|
|
1298
|
+
const configToml = (options = {}) => {
|
|
1185
1299
|
const { files = [GLOB_TOML] } = options;
|
|
1186
1300
|
return [
|
|
1187
1301
|
{
|
|
1188
1302
|
name: "ntnyq/toml",
|
|
1189
1303
|
files,
|
|
1190
1304
|
plugins: {
|
|
1191
|
-
toml:
|
|
1305
|
+
toml: pluginToml
|
|
1192
1306
|
},
|
|
1193
1307
|
languageOptions: {
|
|
1194
1308
|
parser: parserToml
|
|
@@ -1220,12 +1334,11 @@ var configToml = (options = {}) => {
|
|
|
1220
1334
|
];
|
|
1221
1335
|
};
|
|
1222
1336
|
|
|
1223
|
-
|
|
1224
|
-
var configAntfu = (options = {}) => [
|
|
1337
|
+
const configAntfu = (options = {}) => [
|
|
1225
1338
|
{
|
|
1226
1339
|
name: "ntnyq/antfu",
|
|
1227
1340
|
plugins: {
|
|
1228
|
-
antfu:
|
|
1341
|
+
antfu: pluginAntfu
|
|
1229
1342
|
},
|
|
1230
1343
|
rules: {
|
|
1231
1344
|
// required `object-curly-newline` to be disabled
|
|
@@ -1240,26 +1353,25 @@ var configAntfu = (options = {}) => [
|
|
|
1240
1353
|
}
|
|
1241
1354
|
];
|
|
1242
1355
|
|
|
1243
|
-
|
|
1244
|
-
var javscriptRules = {
|
|
1356
|
+
const javscriptRules = {
|
|
1245
1357
|
"jsdoc/no-types": "off",
|
|
1246
1358
|
"jsdoc/no-undefined-types": "error",
|
|
1247
1359
|
"jsdoc/require-param-type": "error",
|
|
1248
1360
|
"jsdoc/require-property-type": "error",
|
|
1249
1361
|
"jsdoc/require-returns-type": "error"
|
|
1250
1362
|
};
|
|
1251
|
-
|
|
1363
|
+
const typescriptRules = {
|
|
1252
1364
|
"jsdoc/no-undefined-types": "off",
|
|
1253
1365
|
"jsdoc/require-param-type": "off",
|
|
1254
1366
|
"jsdoc/require-property-type": "off",
|
|
1255
1367
|
"jsdoc/require-returns-type": "off",
|
|
1256
1368
|
"jsdoc/no-types": "error"
|
|
1257
1369
|
};
|
|
1258
|
-
|
|
1370
|
+
const configJsdoc = (options = {}) => [
|
|
1259
1371
|
{
|
|
1260
1372
|
name: "ntnyq/jsdoc",
|
|
1261
1373
|
plugins: {
|
|
1262
|
-
jsdoc:
|
|
1374
|
+
jsdoc: pluginJsdoc
|
|
1263
1375
|
},
|
|
1264
1376
|
rules: {
|
|
1265
1377
|
// Disabled rules
|
|
@@ -1332,21 +1444,20 @@ var configJsdoc = (options = {}) => [
|
|
|
1332
1444
|
}
|
|
1333
1445
|
];
|
|
1334
1446
|
|
|
1335
|
-
|
|
1336
|
-
var configJsonc = (options = {}) => {
|
|
1447
|
+
const configJsonc = (options = {}) => {
|
|
1337
1448
|
const { files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC] } = options;
|
|
1338
1449
|
return [
|
|
1339
1450
|
{
|
|
1340
1451
|
name: "ntnyq/jsonc",
|
|
1341
1452
|
files,
|
|
1342
1453
|
plugins: {
|
|
1343
|
-
jsonc:
|
|
1454
|
+
jsonc: pluginJsonc
|
|
1344
1455
|
},
|
|
1345
1456
|
languageOptions: {
|
|
1346
1457
|
parser: parserJsonc
|
|
1347
1458
|
},
|
|
1348
1459
|
rules: {
|
|
1349
|
-
...
|
|
1460
|
+
...pluginJsonc.configs["recommended-with-jsonc"].rules,
|
|
1350
1461
|
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
1351
1462
|
"jsonc/comma-dangle": ["error", "never"],
|
|
1352
1463
|
"jsonc/comma-style": ["error", "last"],
|
|
@@ -1380,12 +1491,11 @@ var configJsonc = (options = {}) => {
|
|
|
1380
1491
|
];
|
|
1381
1492
|
};
|
|
1382
1493
|
|
|
1383
|
-
|
|
1384
|
-
var configNtnyq = (options = {}) => [
|
|
1494
|
+
const configNtnyq = (options = {}) => [
|
|
1385
1495
|
{
|
|
1386
1496
|
name: "ntnyq/ntnyq",
|
|
1387
1497
|
plugins: {
|
|
1388
|
-
ntnyq:
|
|
1498
|
+
ntnyq: pluginNtnyq
|
|
1389
1499
|
},
|
|
1390
1500
|
rules: {
|
|
1391
1501
|
"ntnyq/no-duplicate-exports": "error",
|
|
@@ -1396,15 +1506,14 @@ var configNtnyq = (options = {}) => [
|
|
|
1396
1506
|
}
|
|
1397
1507
|
];
|
|
1398
1508
|
|
|
1399
|
-
|
|
1400
|
-
var configPinia = (options = {}) => {
|
|
1509
|
+
const configPinia = (options = {}) => {
|
|
1401
1510
|
const { files = [GLOB_PINIA_STORE] } = options;
|
|
1402
1511
|
return [
|
|
1403
1512
|
{
|
|
1404
1513
|
name: "ntnyq/pinia",
|
|
1405
1514
|
files,
|
|
1406
1515
|
plugins: {
|
|
1407
|
-
pinia:
|
|
1516
|
+
pinia: pluginPinia
|
|
1408
1517
|
},
|
|
1409
1518
|
rules: {
|
|
1410
1519
|
"pinia/never-export-initialized-store": "error",
|
|
@@ -1427,14 +1536,13 @@ var configPinia = (options = {}) => {
|
|
|
1427
1536
|
];
|
|
1428
1537
|
};
|
|
1429
1538
|
|
|
1430
|
-
|
|
1431
|
-
var configDepend = (options = {}) => {
|
|
1539
|
+
const configDepend = (options = {}) => {
|
|
1432
1540
|
const {
|
|
1433
1541
|
files = [GLOB_SRC],
|
|
1434
1542
|
// check package.json file
|
|
1435
1543
|
packageJson: enableCheckPackageJson = true
|
|
1436
1544
|
} = options;
|
|
1437
|
-
const
|
|
1545
|
+
const configs = [
|
|
1438
1546
|
{
|
|
1439
1547
|
name: "ntnyq/depend",
|
|
1440
1548
|
files,
|
|
@@ -1449,7 +1557,7 @@ var configDepend = (options = {}) => {
|
|
|
1449
1557
|
}
|
|
1450
1558
|
];
|
|
1451
1559
|
if (enableCheckPackageJson) {
|
|
1452
|
-
|
|
1560
|
+
configs.push({
|
|
1453
1561
|
name: "ntnyq/depend/package-json",
|
|
1454
1562
|
files: [GLOB_PACKAGE_JSON],
|
|
1455
1563
|
plugins: {
|
|
@@ -1465,11 +1573,10 @@ var configDepend = (options = {}) => {
|
|
|
1465
1573
|
}
|
|
1466
1574
|
});
|
|
1467
1575
|
}
|
|
1468
|
-
return
|
|
1576
|
+
return configs;
|
|
1469
1577
|
};
|
|
1470
1578
|
|
|
1471
|
-
|
|
1472
|
-
var PRETTIER_DEFAULT_OPTIONS = {
|
|
1579
|
+
const PRETTIER_DEFAULT_OPTIONS = {
|
|
1473
1580
|
arrowParens: "avoid",
|
|
1474
1581
|
bracketSameLine: false,
|
|
1475
1582
|
bracketSpacing: true,
|
|
@@ -1496,25 +1603,24 @@ var PRETTIER_DEFAULT_OPTIONS = {
|
|
|
1496
1603
|
vueIndentScriptAndStyle: false
|
|
1497
1604
|
};
|
|
1498
1605
|
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
// fallbackSort: { order: 'asc', type: 'alphabetical' },
|
|
1606
|
+
const PERFECTIONIST_COMMON_RULE_OPTIONS = {
|
|
1607
|
+
fallbackSort: { order: "asc", type: "alphabetical" },
|
|
1502
1608
|
ignoreCase: true,
|
|
1503
1609
|
order: "asc",
|
|
1504
1610
|
type: "alphabetical"
|
|
1505
1611
|
};
|
|
1506
|
-
|
|
1612
|
+
const PERFECTIONIST_EXTRA_RULE_OPTIONS = {
|
|
1507
1613
|
newlinesBetween: "ignore",
|
|
1508
1614
|
partitionByComment: ["@pg", "@perfectionist-group"]
|
|
1509
1615
|
};
|
|
1510
|
-
|
|
1616
|
+
const PERFECTIONIST_SORT_OBJECTS_GROUPS = [
|
|
1511
1617
|
"property",
|
|
1512
1618
|
"multiline-property",
|
|
1513
1619
|
"method",
|
|
1514
1620
|
"multiline-method",
|
|
1515
1621
|
"unknown"
|
|
1516
1622
|
];
|
|
1517
|
-
|
|
1623
|
+
const PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS = [
|
|
1518
1624
|
"required-property",
|
|
1519
1625
|
"optional-property",
|
|
1520
1626
|
"required-method",
|
|
@@ -1527,7 +1633,7 @@ var PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS = [
|
|
|
1527
1633
|
"index-signature",
|
|
1528
1634
|
"multiline-index-signature"
|
|
1529
1635
|
];
|
|
1530
|
-
|
|
1636
|
+
const PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS = [
|
|
1531
1637
|
/**
|
|
1532
1638
|
* eg. 'foobar', 24, false
|
|
1533
1639
|
*/
|
|
@@ -1577,7 +1683,7 @@ var PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS = [
|
|
|
1577
1683
|
*/
|
|
1578
1684
|
"nullish"
|
|
1579
1685
|
];
|
|
1580
|
-
|
|
1686
|
+
const PERFECTIONIST_SORT_IMPORTS_GROUPS = [
|
|
1581
1687
|
// Side effect style imports (e.g. 'normalize.css')
|
|
1582
1688
|
"side-effect-style",
|
|
1583
1689
|
// Styles (e.g. *.{css,scss,less})
|
|
@@ -1613,10 +1719,11 @@ var PERFECTIONIST_SORT_IMPORTS_GROUPS = [
|
|
|
1613
1719
|
*/
|
|
1614
1720
|
"unknown"
|
|
1615
1721
|
];
|
|
1616
|
-
|
|
1722
|
+
const PERFECTIONIST_SORT_CLASSES_GROUPS = ["unknown"];
|
|
1617
1723
|
|
|
1618
|
-
|
|
1619
|
-
|
|
1724
|
+
const configFormat = async (options = {}) => {
|
|
1725
|
+
await ensurePackages(["eslint-plugin-format"]);
|
|
1726
|
+
const pluginFormat = await interopDefault(import('eslint-plugin-format'));
|
|
1620
1727
|
const {
|
|
1621
1728
|
css: enableCSS = true,
|
|
1622
1729
|
html: enableHTML = true,
|
|
@@ -1627,16 +1734,16 @@ var configFormat = (options = {}) => {
|
|
|
1627
1734
|
...PRETTIER_DEFAULT_OPTIONS,
|
|
1628
1735
|
...prettierOptions
|
|
1629
1736
|
};
|
|
1630
|
-
const
|
|
1737
|
+
const configs = [
|
|
1631
1738
|
{
|
|
1632
1739
|
name: "ntnyq/format/setup",
|
|
1633
1740
|
plugins: {
|
|
1634
|
-
format:
|
|
1741
|
+
format: pluginFormat
|
|
1635
1742
|
}
|
|
1636
1743
|
}
|
|
1637
1744
|
];
|
|
1638
1745
|
if (enableCSS) {
|
|
1639
|
-
|
|
1746
|
+
configs.push(
|
|
1640
1747
|
{
|
|
1641
1748
|
name: "ntnyq/format/css",
|
|
1642
1749
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
@@ -1685,7 +1792,7 @@ var configFormat = (options = {}) => {
|
|
|
1685
1792
|
);
|
|
1686
1793
|
}
|
|
1687
1794
|
if (enableHTML) {
|
|
1688
|
-
|
|
1795
|
+
configs.push({
|
|
1689
1796
|
name: "ntnyq/format/html",
|
|
1690
1797
|
files: [GLOB_HTML],
|
|
1691
1798
|
languageOptions: {
|
|
@@ -1701,19 +1808,18 @@ var configFormat = (options = {}) => {
|
|
|
1701
1808
|
}
|
|
1702
1809
|
});
|
|
1703
1810
|
}
|
|
1704
|
-
return
|
|
1811
|
+
return configs;
|
|
1705
1812
|
};
|
|
1706
1813
|
|
|
1707
|
-
|
|
1708
|
-
var configRegexp = (options = {}) => {
|
|
1814
|
+
const configRegexp = (options = {}) => {
|
|
1709
1815
|
const recommendedConfig = pluginRegexp.configs["flat/recommended"];
|
|
1710
|
-
const
|
|
1816
|
+
const recommendedRules = {
|
|
1711
1817
|
...recommendedConfig.rules
|
|
1712
1818
|
};
|
|
1713
1819
|
if (options.severity === "warn") {
|
|
1714
|
-
for (const key in
|
|
1715
|
-
if (
|
|
1716
|
-
|
|
1820
|
+
for (const key in recommendedRules) {
|
|
1821
|
+
if (recommendedRules[key] === "error") {
|
|
1822
|
+
recommendedRules[key] = "warn";
|
|
1717
1823
|
}
|
|
1718
1824
|
}
|
|
1719
1825
|
}
|
|
@@ -1722,7 +1828,7 @@ var configRegexp = (options = {}) => {
|
|
|
1722
1828
|
...recommendedConfig,
|
|
1723
1829
|
name: "ntnyq/regexp",
|
|
1724
1830
|
rules: {
|
|
1725
|
-
...
|
|
1831
|
+
...recommendedRules,
|
|
1726
1832
|
// Overrides rules
|
|
1727
1833
|
...options.overrides
|
|
1728
1834
|
}
|
|
@@ -1730,12 +1836,11 @@ var configRegexp = (options = {}) => {
|
|
|
1730
1836
|
];
|
|
1731
1837
|
};
|
|
1732
1838
|
|
|
1733
|
-
|
|
1734
|
-
var configUnoCSS = (options = {}) => [
|
|
1839
|
+
const configUnoCSS = (options = {}) => [
|
|
1735
1840
|
{
|
|
1736
1841
|
name: "ntnyq/unocss",
|
|
1737
1842
|
plugins: {
|
|
1738
|
-
unocss:
|
|
1843
|
+
unocss: pluginUnoCSS
|
|
1739
1844
|
},
|
|
1740
1845
|
rules: {
|
|
1741
1846
|
"unocss/order-attributify": options.attributify ? "error" : "off",
|
|
@@ -1746,13 +1851,7 @@ var configUnoCSS = (options = {}) => [
|
|
|
1746
1851
|
}
|
|
1747
1852
|
];
|
|
1748
1853
|
|
|
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({
|
|
1854
|
+
const regexper = defineCommand({
|
|
1756
1855
|
name: "regexper",
|
|
1757
1856
|
// @regexper https://regexper.com/#%2F(%5Cb%7C%5Cs%7C%5E)(%40regexper)(%5Cs%5CS%2B)%3F(%5Cb%7C%5Cs%7C%24)%2F
|
|
1758
1857
|
match: /(\b|\s|^)(@regexper)(\s\S+)?(\b|\s|$)/,
|
|
@@ -1795,11 +1894,9 @@ var regexper = defineCommand({
|
|
|
1795
1894
|
}
|
|
1796
1895
|
});
|
|
1797
1896
|
|
|
1798
|
-
|
|
1799
|
-
var commands = [regexper];
|
|
1897
|
+
const commands = [regexper];
|
|
1800
1898
|
|
|
1801
|
-
|
|
1802
|
-
var configCommand = (options = {}) => [
|
|
1899
|
+
const configCommand = (options = {}) => [
|
|
1803
1900
|
{
|
|
1804
1901
|
...createCommandConfig({
|
|
1805
1902
|
...options,
|
|
@@ -1816,8 +1913,7 @@ var configCommand = (options = {}) => [
|
|
|
1816
1913
|
}
|
|
1817
1914
|
];
|
|
1818
1915
|
|
|
1819
|
-
|
|
1820
|
-
var configIgnores = (customIgnores = []) => [
|
|
1916
|
+
const configIgnores = (customIgnores = []) => [
|
|
1821
1917
|
{
|
|
1822
1918
|
name: "ntnyq/ignores",
|
|
1823
1919
|
ignores: [
|
|
@@ -1828,8 +1924,7 @@ var configIgnores = (customIgnores = []) => [
|
|
|
1828
1924
|
}
|
|
1829
1925
|
];
|
|
1830
1926
|
|
|
1831
|
-
|
|
1832
|
-
var configImportX = (options = {}) => {
|
|
1927
|
+
const configImportX = (options = {}) => {
|
|
1833
1928
|
const {
|
|
1834
1929
|
// use typescript resolve if possible
|
|
1835
1930
|
preferTypeScriptResolver = true,
|
|
@@ -1839,7 +1934,7 @@ var configImportX = (options = {}) => {
|
|
|
1839
1934
|
{
|
|
1840
1935
|
name: "ntnyq/import-x",
|
|
1841
1936
|
plugins: {
|
|
1842
|
-
"import-x":
|
|
1937
|
+
"import-x": pluginImportX
|
|
1843
1938
|
},
|
|
1844
1939
|
settings: {
|
|
1845
1940
|
"import-x/resolver-next": [
|
|
@@ -1853,7 +1948,7 @@ var configImportX = (options = {}) => {
|
|
|
1853
1948
|
".json",
|
|
1854
1949
|
".node"
|
|
1855
1950
|
]
|
|
1856
|
-
}) : createNodeResolver({
|
|
1951
|
+
}) : pluginImportX.createNodeResolver({
|
|
1857
1952
|
extensions: [".js", ".mjs", ".ts", ".mts", ".d.ts", ".json"]
|
|
1858
1953
|
})
|
|
1859
1954
|
]
|
|
@@ -1882,8 +1977,7 @@ var configImportX = (options = {}) => {
|
|
|
1882
1977
|
];
|
|
1883
1978
|
};
|
|
1884
1979
|
|
|
1885
|
-
|
|
1886
|
-
var disabledRules2 = {
|
|
1980
|
+
const disabledRules = {
|
|
1887
1981
|
"unicorn/better-regex": "off",
|
|
1888
1982
|
"unicorn/explicit-length-check": "off",
|
|
1889
1983
|
"unicorn/no-array-callback-reference": "off",
|
|
@@ -1893,11 +1987,11 @@ var disabledRules2 = {
|
|
|
1893
1987
|
"unicorn/prefer-global-this": "off",
|
|
1894
1988
|
"unicorn/prefer-top-level-await": "off"
|
|
1895
1989
|
};
|
|
1896
|
-
|
|
1990
|
+
const configUnicorn = (options = {}) => [
|
|
1897
1991
|
{
|
|
1898
1992
|
name: "ntnyq/unicorn",
|
|
1899
1993
|
plugins: {
|
|
1900
|
-
unicorn:
|
|
1994
|
+
unicorn: pluginUnicorn
|
|
1901
1995
|
},
|
|
1902
1996
|
rules: {
|
|
1903
1997
|
"unicorn/consistent-assert": "error",
|
|
@@ -1989,43 +2083,38 @@ var configUnicorn = (options = {}) => [
|
|
|
1989
2083
|
*/
|
|
1990
2084
|
"unicorn/prefer-set-has": "error",
|
|
1991
2085
|
"unicorn/prefer-set-size": "error",
|
|
1992
|
-
...
|
|
2086
|
+
...disabledRules,
|
|
1993
2087
|
// Overrides rules
|
|
1994
2088
|
...options.overrides
|
|
1995
2089
|
}
|
|
1996
2090
|
}
|
|
1997
2091
|
];
|
|
1998
2092
|
|
|
1999
|
-
|
|
2000
|
-
var configDeMorgan = (options = {}) => [
|
|
2093
|
+
const configDeMorgan = (options = {}) => [
|
|
2001
2094
|
{
|
|
2002
|
-
...
|
|
2095
|
+
...pluginDeMorgan.configs.recommended,
|
|
2003
2096
|
name: "ntnyq/de-morgan",
|
|
2004
2097
|
rules: {
|
|
2005
|
-
...
|
|
2098
|
+
...pluginDeMorgan.configs.recommended.rules,
|
|
2006
2099
|
// Overrides rules
|
|
2007
2100
|
...options.overrides
|
|
2008
2101
|
}
|
|
2009
2102
|
}
|
|
2010
2103
|
];
|
|
2011
2104
|
|
|
2012
|
-
|
|
2013
|
-
var configMarkdown = (options = {}) => {
|
|
2105
|
+
const configMarkdown = (options = {}) => {
|
|
2014
2106
|
const {
|
|
2015
2107
|
/**
|
|
2016
2108
|
* code block files
|
|
2017
2109
|
*/
|
|
2018
2110
|
files = [GLOB_MARKDOWN_CODE],
|
|
2019
|
-
|
|
2020
|
-
* other extensions
|
|
2021
|
-
*/
|
|
2022
|
-
extensions = []
|
|
2111
|
+
extraFileExtensions = []
|
|
2023
2112
|
} = options;
|
|
2024
|
-
const
|
|
2113
|
+
const configs$1 = [
|
|
2025
2114
|
/**
|
|
2026
2115
|
* extracting code blocks to be linted individually
|
|
2027
2116
|
*/
|
|
2028
|
-
...
|
|
2117
|
+
...pluginMarkdown.configs.processor.map((config) => ({
|
|
2029
2118
|
...config,
|
|
2030
2119
|
name: `ntnyq/${config.name}`
|
|
2031
2120
|
})),
|
|
@@ -2037,7 +2126,7 @@ var configMarkdown = (options = {}) => {
|
|
|
2037
2126
|
files,
|
|
2038
2127
|
ignores: [GLOB_MARKDOWN_NESTED],
|
|
2039
2128
|
processor: mergeProcessors([
|
|
2040
|
-
|
|
2129
|
+
pluginMarkdown.processors.markdown,
|
|
2041
2130
|
// Just pass through processor
|
|
2042
2131
|
processorPassThrough
|
|
2043
2132
|
])
|
|
@@ -2054,7 +2143,7 @@ var configMarkdown = (options = {}) => {
|
|
|
2054
2143
|
files: [
|
|
2055
2144
|
...files,
|
|
2056
2145
|
// more nested extensions to disable
|
|
2057
|
-
...
|
|
2146
|
+
...extraFileExtensions.map((ext) => `${GLOB_MARKDOWN}/**/*${ext}`)
|
|
2058
2147
|
],
|
|
2059
2148
|
languageOptions: {
|
|
2060
2149
|
parserOptions: {
|
|
@@ -2067,7 +2156,6 @@ var configMarkdown = (options = {}) => {
|
|
|
2067
2156
|
}
|
|
2068
2157
|
},
|
|
2069
2158
|
rules: {
|
|
2070
|
-
"@typescript-eslint/comma-dangle": "off",
|
|
2071
2159
|
"@typescript-eslint/consistent-type-imports": "off",
|
|
2072
2160
|
"@typescript-eslint/no-extraneous-class": "off",
|
|
2073
2161
|
"@typescript-eslint/no-namespace": "off",
|
|
@@ -2094,11 +2182,10 @@ var configMarkdown = (options = {}) => {
|
|
|
2094
2182
|
}
|
|
2095
2183
|
}
|
|
2096
2184
|
];
|
|
2097
|
-
return
|
|
2185
|
+
return configs$1;
|
|
2098
2186
|
};
|
|
2099
2187
|
|
|
2100
|
-
|
|
2101
|
-
var configPrettier = (options = {}) => {
|
|
2188
|
+
const configPrettier = (options = {}) => {
|
|
2102
2189
|
const {
|
|
2103
2190
|
disabledFiles = [GLOB_SVG, GLOB_TOML, GLOB_ASTRO, GLOB_SVELTE],
|
|
2104
2191
|
// User defined disabled files
|
|
@@ -2108,7 +2195,7 @@ var configPrettier = (options = {}) => {
|
|
|
2108
2195
|
{
|
|
2109
2196
|
name: "ntnyq/prettier",
|
|
2110
2197
|
plugins: {
|
|
2111
|
-
prettier:
|
|
2198
|
+
prettier: pluginPrettier
|
|
2112
2199
|
},
|
|
2113
2200
|
rules: {
|
|
2114
2201
|
"vue/array-bracket-newline": "off",
|
|
@@ -2148,7 +2235,7 @@ var configPrettier = (options = {}) => {
|
|
|
2148
2235
|
"vue/space-infix-ops": "off",
|
|
2149
2236
|
"vue/space-unary-ops": "off",
|
|
2150
2237
|
"vue/template-curly-spacing": "off",
|
|
2151
|
-
...
|
|
2238
|
+
...pluginPrettier.configs.recommended.rules,
|
|
2152
2239
|
"prettier/prettier": options.severity || "warn",
|
|
2153
2240
|
// Overrides rules
|
|
2154
2241
|
...options.overrides
|
|
@@ -2161,7 +2248,7 @@ var configPrettier = (options = {}) => {
|
|
|
2161
2248
|
name: "ntnyq/prettier/disabled",
|
|
2162
2249
|
files: [...disabledFiles, ...userDisabledFiles],
|
|
2163
2250
|
plugins: {
|
|
2164
|
-
prettier:
|
|
2251
|
+
prettier: pluginPrettier
|
|
2165
2252
|
},
|
|
2166
2253
|
rules: {
|
|
2167
2254
|
"prettier/prettier": "off"
|
|
@@ -2170,14 +2257,12 @@ var configPrettier = (options = {}) => {
|
|
|
2170
2257
|
];
|
|
2171
2258
|
};
|
|
2172
2259
|
|
|
2173
|
-
|
|
2174
|
-
import globals from "globals";
|
|
2175
|
-
var configSpecials = (options = {}) => {
|
|
2260
|
+
const configSpecials = (options = {}) => {
|
|
2176
2261
|
const {
|
|
2177
2262
|
// Enable shadcn-vue support
|
|
2178
2263
|
shadcnVue: enableShadcnVue = hasShadcnVue()
|
|
2179
2264
|
} = options;
|
|
2180
|
-
const
|
|
2265
|
+
const configs = [
|
|
2181
2266
|
{
|
|
2182
2267
|
name: "ntnyq/specials/scripts",
|
|
2183
2268
|
files: [`**/scripts/${GLOB_SRC}`],
|
|
@@ -2198,6 +2283,17 @@ var configSpecials = (options = {}) => {
|
|
|
2198
2283
|
...options.overridesCliRules
|
|
2199
2284
|
}
|
|
2200
2285
|
},
|
|
2286
|
+
{
|
|
2287
|
+
name: "ntnyq/specials/bin",
|
|
2288
|
+
files: [`**/bin/${GLOB_SRC}`, `**/bin.${GLOB_SRC_EXT}`],
|
|
2289
|
+
rules: {
|
|
2290
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
2291
|
+
"antfu/no-import-dist": "off",
|
|
2292
|
+
"no-console": "off",
|
|
2293
|
+
// Overrides rules
|
|
2294
|
+
...options.overridesBinRules
|
|
2295
|
+
}
|
|
2296
|
+
},
|
|
2201
2297
|
{
|
|
2202
2298
|
name: "ntnyq/specials/userscript",
|
|
2203
2299
|
files: [`**/*.user.${GLOB_SRC_EXT}`],
|
|
@@ -2221,8 +2317,8 @@ var configSpecials = (options = {}) => {
|
|
|
2221
2317
|
name: "ntnyq/specials/config-file",
|
|
2222
2318
|
files: [`**/*.config*.${GLOB_SRC_EXT}`],
|
|
2223
2319
|
plugins: {
|
|
2224
|
-
"import-x":
|
|
2225
|
-
perfectionist:
|
|
2320
|
+
"import-x": pluginImportX,
|
|
2321
|
+
perfectionist: pluginPerfectionist
|
|
2226
2322
|
},
|
|
2227
2323
|
rules: {
|
|
2228
2324
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
@@ -2242,7 +2338,7 @@ var configSpecials = (options = {}) => {
|
|
|
2242
2338
|
];
|
|
2243
2339
|
if (enableShadcnVue) {
|
|
2244
2340
|
const shadcnOptions = resolveSubOptions(options, "shadcnVue");
|
|
2245
|
-
|
|
2341
|
+
configs.push({
|
|
2246
2342
|
name: "ntnyq/specials/shadcn-vue",
|
|
2247
2343
|
files: shadcnOptions.files || [
|
|
2248
2344
|
"**/components/ui/**/*.ts",
|
|
@@ -2259,14 +2355,12 @@ var configSpecials = (options = {}) => {
|
|
|
2259
2355
|
});
|
|
2260
2356
|
}
|
|
2261
2357
|
if (options.specialCaseConfigs) {
|
|
2262
|
-
|
|
2358
|
+
configs.push(...options.specialCaseConfigs);
|
|
2263
2359
|
}
|
|
2264
|
-
return
|
|
2360
|
+
return configs;
|
|
2265
2361
|
};
|
|
2266
2362
|
|
|
2267
|
-
|
|
2268
|
-
import createGitIgnoreConfig from "eslint-config-flat-gitignore";
|
|
2269
|
-
var configGitIgnore = (options = {}) => {
|
|
2363
|
+
const configGitIgnore = (options = {}) => {
|
|
2270
2364
|
options.strict ??= false;
|
|
2271
2365
|
return [
|
|
2272
2366
|
{
|
|
@@ -2276,10 +2370,7 @@ var configGitIgnore = (options = {}) => {
|
|
|
2276
2370
|
];
|
|
2277
2371
|
};
|
|
2278
2372
|
|
|
2279
|
-
|
|
2280
|
-
import jsConfig from "@eslint/js";
|
|
2281
|
-
import globals2 from "globals";
|
|
2282
|
-
var strictRules = {
|
|
2373
|
+
const strictRules = {
|
|
2283
2374
|
complexity: ["error", { max: 30 }],
|
|
2284
2375
|
"max-depth": ["error", { max: 5 }],
|
|
2285
2376
|
"max-lines": [
|
|
@@ -2301,7 +2392,7 @@ var strictRules = {
|
|
|
2301
2392
|
"max-nested-callbacks": ["error", { max: 10 }],
|
|
2302
2393
|
"max-params": ["error", { max: 5 }]
|
|
2303
2394
|
};
|
|
2304
|
-
|
|
2395
|
+
const configJavaScript = (options = {}) => [
|
|
2305
2396
|
{
|
|
2306
2397
|
...jsConfig.configs.recommended,
|
|
2307
2398
|
name: "ntnyq/js/recommended"
|
|
@@ -2311,9 +2402,9 @@ var configJavaScript = (options = {}) => [
|
|
|
2311
2402
|
languageOptions: {
|
|
2312
2403
|
sourceType: "module",
|
|
2313
2404
|
globals: {
|
|
2314
|
-
...
|
|
2315
|
-
...
|
|
2316
|
-
...
|
|
2405
|
+
...globals.browser,
|
|
2406
|
+
...globals.es2021,
|
|
2407
|
+
...globals.node
|
|
2317
2408
|
}
|
|
2318
2409
|
},
|
|
2319
2410
|
rules: {
|
|
@@ -2499,7 +2590,7 @@ var configJavaScript = (options = {}) => [
|
|
|
2499
2590
|
}
|
|
2500
2591
|
}
|
|
2501
2592
|
];
|
|
2502
|
-
|
|
2593
|
+
const configJSX = () => [
|
|
2503
2594
|
{
|
|
2504
2595
|
name: "ntnyq/jsx",
|
|
2505
2596
|
files: [GLOB_JSX_ONLY],
|
|
@@ -2513,9 +2604,7 @@ var configJSX = () => [
|
|
|
2513
2604
|
}
|
|
2514
2605
|
];
|
|
2515
2606
|
|
|
2516
|
-
|
|
2517
|
-
import process4 from "node:process";
|
|
2518
|
-
var typeAwareRules = {
|
|
2607
|
+
const typeAwareRules = {
|
|
2519
2608
|
// too strict
|
|
2520
2609
|
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
2521
2610
|
"dot-notation": "off",
|
|
@@ -2547,16 +2636,17 @@ var typeAwareRules = {
|
|
|
2547
2636
|
"@typescript-eslint/triple-slash-reference": "error",
|
|
2548
2637
|
"@typescript-eslint/unbound-method": "error"
|
|
2549
2638
|
};
|
|
2550
|
-
|
|
2639
|
+
const recommendedRules = configs.recommended.reduce(
|
|
2551
2640
|
(rules, config) => {
|
|
2552
2641
|
return { ...rules, ...config.rules || {} };
|
|
2553
2642
|
},
|
|
2554
2643
|
{}
|
|
2555
2644
|
);
|
|
2556
|
-
|
|
2645
|
+
const configTypeScript = (options = {}) => {
|
|
2557
2646
|
const enableTypeAwareLint = !!options?.tsconfigPath;
|
|
2558
2647
|
const {
|
|
2559
|
-
|
|
2648
|
+
allowDefaultProject = [],
|
|
2649
|
+
extraFileExtensions = [],
|
|
2560
2650
|
filesTypeAware = [GLOB_TS, GLOB_TSX],
|
|
2561
2651
|
ignoresTypeAware = [GLOB_ASTRO, `${GLOB_MARKDOWN}/**`],
|
|
2562
2652
|
overridesTypeAwareRules = {},
|
|
@@ -2565,17 +2655,17 @@ var configTypeScript = (options = {}) => {
|
|
|
2565
2655
|
const files = options.files ?? [
|
|
2566
2656
|
GLOB_TS,
|
|
2567
2657
|
GLOB_TSX,
|
|
2568
|
-
// Enable typescript in these
|
|
2569
|
-
...
|
|
2658
|
+
// Enable typescript in these files
|
|
2659
|
+
...extraFileExtensions.map((ext) => `**/*${ext}`)
|
|
2570
2660
|
];
|
|
2571
2661
|
function createParserConfig(enableTypeAware = false, files2 = [], ignores = []) {
|
|
2572
2662
|
const typescriptParserOptions = {
|
|
2573
|
-
extraFileExtensions
|
|
2663
|
+
extraFileExtensions,
|
|
2574
2664
|
sourceType: "module",
|
|
2575
2665
|
...enableTypeAware ? {
|
|
2576
|
-
tsconfigRootDir:
|
|
2666
|
+
tsconfigRootDir: process.cwd(),
|
|
2577
2667
|
projectService: {
|
|
2578
|
-
allowDefaultProject: ["./*.js"],
|
|
2668
|
+
allowDefaultProject: ["./*.js", ...allowDefaultProject],
|
|
2579
2669
|
defaultProject: options.tsconfigPath
|
|
2580
2670
|
}
|
|
2581
2671
|
} : {},
|
|
@@ -2586,7 +2676,7 @@ var configTypeScript = (options = {}) => {
|
|
|
2586
2676
|
files: files2,
|
|
2587
2677
|
ignores: [...ignores],
|
|
2588
2678
|
languageOptions: {
|
|
2589
|
-
parser,
|
|
2679
|
+
parser: parser,
|
|
2590
2680
|
parserOptions: typescriptParserOptions
|
|
2591
2681
|
}
|
|
2592
2682
|
};
|
|
@@ -2597,7 +2687,7 @@ var configTypeScript = (options = {}) => {
|
|
|
2597
2687
|
name: "ntnyq/ts/setup",
|
|
2598
2688
|
plugins: {
|
|
2599
2689
|
"@typescript-eslint": plugin,
|
|
2600
|
-
antfu:
|
|
2690
|
+
antfu: pluginAntfu
|
|
2601
2691
|
}
|
|
2602
2692
|
},
|
|
2603
2693
|
...enableTypeAwareLint ? [
|
|
@@ -2740,11 +2830,10 @@ var configTypeScript = (options = {}) => {
|
|
|
2740
2830
|
];
|
|
2741
2831
|
};
|
|
2742
2832
|
|
|
2743
|
-
|
|
2744
|
-
var configESLintPlugin = async (options = {}) => {
|
|
2833
|
+
const configESLintPlugin = async (options = {}) => {
|
|
2745
2834
|
await ensurePackages(["eslint-plugin-eslint-plugin"]);
|
|
2746
2835
|
const pluginESLintPlugin = await interopDefault(
|
|
2747
|
-
import(
|
|
2836
|
+
import('eslint-plugin-eslint-plugin')
|
|
2748
2837
|
);
|
|
2749
2838
|
return [
|
|
2750
2839
|
{
|
|
@@ -2761,9 +2850,7 @@ var configESLintPlugin = async (options = {}) => {
|
|
|
2761
2850
|
];
|
|
2762
2851
|
};
|
|
2763
2852
|
|
|
2764
|
-
|
|
2765
|
-
import { createConfig } from "eslint-plugin-github-action";
|
|
2766
|
-
var configGitHubAction = (options = {}) => {
|
|
2853
|
+
const configGitHubAction = (options = {}) => {
|
|
2767
2854
|
const {
|
|
2768
2855
|
files = [GLOB_GITHUB_ACTION],
|
|
2769
2856
|
rules = {},
|
|
@@ -2786,8 +2873,7 @@ var configGitHubAction = (options = {}) => {
|
|
|
2786
2873
|
];
|
|
2787
2874
|
};
|
|
2788
2875
|
|
|
2789
|
-
|
|
2790
|
-
var configPerfectionist = (options = {}) => {
|
|
2876
|
+
const configPerfectionist = (options = {}) => {
|
|
2791
2877
|
const {
|
|
2792
2878
|
partitionByComment = PERFECTIONIST_EXTRA_RULE_OPTIONS.partitionByComment,
|
|
2793
2879
|
sortConstants: enableSortConstants = true,
|
|
@@ -2843,7 +2929,7 @@ var configPerfectionist = (options = {}) => {
|
|
|
2843
2929
|
}
|
|
2844
2930
|
]
|
|
2845
2931
|
};
|
|
2846
|
-
const
|
|
2932
|
+
const sharedRules = {
|
|
2847
2933
|
"perfectionist/sort-enums": [
|
|
2848
2934
|
"error",
|
|
2849
2935
|
{
|
|
@@ -2957,16 +3043,16 @@ var configPerfectionist = (options = {}) => {
|
|
|
2957
3043
|
}
|
|
2958
3044
|
]
|
|
2959
3045
|
};
|
|
2960
|
-
const
|
|
3046
|
+
const configs = [
|
|
2961
3047
|
{
|
|
2962
3048
|
name: options.all ? "ntnyq/perfectionist/all" : "ntnyq/perfectionist/common",
|
|
2963
3049
|
plugins: {
|
|
2964
|
-
perfectionist:
|
|
3050
|
+
perfectionist: pluginPerfectionist
|
|
2965
3051
|
},
|
|
2966
3052
|
rules: {
|
|
2967
3053
|
...commonRules,
|
|
2968
3054
|
...options.all ? {
|
|
2969
|
-
...
|
|
3055
|
+
...sharedRules,
|
|
2970
3056
|
...sortEnumsRules,
|
|
2971
3057
|
...sortTypesRules,
|
|
2972
3058
|
...sortConstantsRules,
|
|
@@ -2978,17 +3064,17 @@ var configPerfectionist = (options = {}) => {
|
|
|
2978
3064
|
}
|
|
2979
3065
|
];
|
|
2980
3066
|
if (options.all) {
|
|
2981
|
-
return
|
|
3067
|
+
return configs;
|
|
2982
3068
|
}
|
|
2983
3069
|
if (enableSortEnums) {
|
|
2984
|
-
|
|
3070
|
+
configs.push({
|
|
2985
3071
|
name: "ntnyq/perfectionist/enums",
|
|
2986
3072
|
files: [`**/enums/${GLOB_SRC}`, `**/enums.${GLOB_SRC_EXT}`],
|
|
2987
3073
|
plugins: {
|
|
2988
|
-
perfectionist:
|
|
3074
|
+
perfectionist: pluginPerfectionist
|
|
2989
3075
|
},
|
|
2990
3076
|
rules: {
|
|
2991
|
-
...
|
|
3077
|
+
...sharedRules,
|
|
2992
3078
|
...sortEnumsRules,
|
|
2993
3079
|
// Overrides rules
|
|
2994
3080
|
...options.overridesEnumsRules
|
|
@@ -2996,14 +3082,14 @@ var configPerfectionist = (options = {}) => {
|
|
|
2996
3082
|
});
|
|
2997
3083
|
}
|
|
2998
3084
|
if (enableSortTypes) {
|
|
2999
|
-
|
|
3085
|
+
configs.push({
|
|
3000
3086
|
name: "ntnyq/perfectionist/types",
|
|
3001
3087
|
files: [...GLOB_TYPES],
|
|
3002
3088
|
plugins: {
|
|
3003
|
-
perfectionist:
|
|
3089
|
+
perfectionist: pluginPerfectionist
|
|
3004
3090
|
},
|
|
3005
3091
|
rules: {
|
|
3006
|
-
...
|
|
3092
|
+
...sharedRules,
|
|
3007
3093
|
...sortTypesRules,
|
|
3008
3094
|
// Overrides rules
|
|
3009
3095
|
...options.overridesTypesRules
|
|
@@ -3011,61 +3097,65 @@ var configPerfectionist = (options = {}) => {
|
|
|
3011
3097
|
});
|
|
3012
3098
|
}
|
|
3013
3099
|
if (enableSortConstants) {
|
|
3014
|
-
|
|
3100
|
+
configs.push({
|
|
3015
3101
|
name: "ntnyq/perfectionist/constants",
|
|
3016
3102
|
files: [`**/constants/${GLOB_SRC}`, `**/constants.${GLOB_SRC_EXT}`],
|
|
3017
3103
|
plugins: {
|
|
3018
|
-
perfectionist:
|
|
3104
|
+
perfectionist: pluginPerfectionist
|
|
3019
3105
|
},
|
|
3020
3106
|
rules: {
|
|
3021
|
-
...
|
|
3107
|
+
...sharedRules,
|
|
3022
3108
|
...sortConstantsRules,
|
|
3023
3109
|
// Overrides rules
|
|
3024
3110
|
...options.overridesConstantsRules
|
|
3025
3111
|
}
|
|
3026
3112
|
});
|
|
3027
3113
|
}
|
|
3028
|
-
return
|
|
3114
|
+
return configs;
|
|
3029
3115
|
};
|
|
3030
3116
|
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3117
|
+
const configUnusedImports = async (options = {}) => {
|
|
3118
|
+
await ensurePackages(["eslint-plugin-unused-imports"]);
|
|
3119
|
+
const pluginUnusedImports = await interopDefault(
|
|
3120
|
+
import('eslint-plugin-unused-imports')
|
|
3121
|
+
);
|
|
3122
|
+
return [
|
|
3123
|
+
{
|
|
3124
|
+
name: "ntnyq/unused-imports",
|
|
3125
|
+
plugins: {
|
|
3126
|
+
"unused-imports": pluginUnusedImports
|
|
3127
|
+
},
|
|
3128
|
+
rules: {
|
|
3129
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
3130
|
+
"unused-imports/no-unused-imports": "error",
|
|
3131
|
+
"unused-imports/no-unused-vars": [
|
|
3132
|
+
"error",
|
|
3133
|
+
{
|
|
3134
|
+
args: "after-used",
|
|
3135
|
+
argsIgnorePattern: "^_",
|
|
3136
|
+
caughtErrors: "all",
|
|
3137
|
+
caughtErrorsIgnorePattern: "^_",
|
|
3138
|
+
destructuredArrayIgnorePattern: "^_",
|
|
3139
|
+
ignoreRestSiblings: true,
|
|
3140
|
+
vars: "all",
|
|
3141
|
+
varsIgnorePattern: "^_"
|
|
3142
|
+
}
|
|
3143
|
+
],
|
|
3144
|
+
// Overrides rules
|
|
3145
|
+
...options.overrides
|
|
3146
|
+
}
|
|
3056
3147
|
}
|
|
3057
|
-
|
|
3058
|
-
|
|
3148
|
+
];
|
|
3149
|
+
};
|
|
3059
3150
|
|
|
3060
|
-
|
|
3061
|
-
var configESLintComments = (options = {}) => [
|
|
3151
|
+
const configESLintComments = (options = {}) => [
|
|
3062
3152
|
{
|
|
3063
3153
|
name: "ntnyq/eslint-comments",
|
|
3064
3154
|
plugins: {
|
|
3065
|
-
"@eslint-community/eslint-comments":
|
|
3155
|
+
"@eslint-community/eslint-comments": pluginComments
|
|
3066
3156
|
},
|
|
3067
3157
|
rules: {
|
|
3068
|
-
...
|
|
3158
|
+
...pluginComments.configs.recommended.rules,
|
|
3069
3159
|
"@eslint-community/eslint-comments/disable-enable-pair": [
|
|
3070
3160
|
"error",
|
|
3071
3161
|
{ allowWholeFile: true }
|
|
@@ -3076,13 +3166,12 @@ var configESLintComments = (options = {}) => [
|
|
|
3076
3166
|
}
|
|
3077
3167
|
];
|
|
3078
3168
|
|
|
3079
|
-
// src/core.ts
|
|
3080
3169
|
function defineESLintConfig(options = {}, ...userConfigs) {
|
|
3081
3170
|
const {
|
|
3082
3171
|
/**
|
|
3083
|
-
*
|
|
3172
|
+
* Shareable options
|
|
3084
3173
|
*/
|
|
3085
|
-
|
|
3174
|
+
shareable = {},
|
|
3086
3175
|
/**
|
|
3087
3176
|
* Conditional by deps
|
|
3088
3177
|
*/
|
|
@@ -3110,17 +3199,19 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3110
3199
|
githubAction: enableGitHubAction = true,
|
|
3111
3200
|
perfectionist: enablePerfectionist = true,
|
|
3112
3201
|
// disabled by default
|
|
3202
|
+
pnpm: enablePnpm = false,
|
|
3113
3203
|
svgo: enableSVGO = false,
|
|
3114
3204
|
eslintPlugin: enableESLintPlugin = false
|
|
3115
3205
|
} = options;
|
|
3116
|
-
const
|
|
3206
|
+
const configs = [];
|
|
3207
|
+
const { extraFileExtensions = [] } = shareable;
|
|
3117
3208
|
if (enableVue) {
|
|
3118
|
-
|
|
3209
|
+
extraFileExtensions.push(".vue");
|
|
3119
3210
|
}
|
|
3120
3211
|
if (enableGitIgnore) {
|
|
3121
|
-
|
|
3212
|
+
configs.push(configGitIgnore(resolveSubOptions(options, "gitignore")));
|
|
3122
3213
|
}
|
|
3123
|
-
|
|
3214
|
+
configs.push(
|
|
3124
3215
|
configIgnores(options.ignores),
|
|
3125
3216
|
configJSX(),
|
|
3126
3217
|
configNode({
|
|
@@ -3146,7 +3237,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3146
3237
|
})
|
|
3147
3238
|
);
|
|
3148
3239
|
if (enablePerfectionist) {
|
|
3149
|
-
|
|
3240
|
+
configs.push(
|
|
3150
3241
|
configPerfectionist({
|
|
3151
3242
|
...resolveSubOptions(options, "perfectionist"),
|
|
3152
3243
|
overrides: getOverrides(options, "perfectionist")
|
|
@@ -3154,14 +3245,14 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3154
3245
|
);
|
|
3155
3246
|
}
|
|
3156
3247
|
if (enableUnicorn) {
|
|
3157
|
-
|
|
3248
|
+
configs.push(
|
|
3158
3249
|
configUnicorn({
|
|
3159
3250
|
overrides: getOverrides(options, "unicorn")
|
|
3160
3251
|
})
|
|
3161
3252
|
);
|
|
3162
3253
|
}
|
|
3163
3254
|
if (enablePinia) {
|
|
3164
|
-
|
|
3255
|
+
configs.push(
|
|
3165
3256
|
configPinia({
|
|
3166
3257
|
...resolveSubOptions(options, "pinia"),
|
|
3167
3258
|
overrides: getOverrides(options, "pinia")
|
|
@@ -3169,14 +3260,14 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3169
3260
|
);
|
|
3170
3261
|
}
|
|
3171
3262
|
if (enableDeMorgan) {
|
|
3172
|
-
|
|
3263
|
+
configs.push(
|
|
3173
3264
|
configDeMorgan({
|
|
3174
3265
|
overrides: getOverrides(options, "deMorgan")
|
|
3175
3266
|
})
|
|
3176
3267
|
);
|
|
3177
3268
|
}
|
|
3178
3269
|
if (enableRegexp) {
|
|
3179
|
-
|
|
3270
|
+
configs.push(
|
|
3180
3271
|
configRegexp({
|
|
3181
3272
|
...resolveSubOptions(options, "regexp"),
|
|
3182
3273
|
overrides: getOverrides(options, "regexp")
|
|
@@ -3184,25 +3275,25 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3184
3275
|
);
|
|
3185
3276
|
}
|
|
3186
3277
|
if (enableTypeScript) {
|
|
3187
|
-
|
|
3278
|
+
configs.push(
|
|
3188
3279
|
configTypeScript({
|
|
3189
3280
|
...resolveSubOptions(options, "typescript"),
|
|
3190
|
-
|
|
3191
|
-
|
|
3281
|
+
overrides: getOverrides(options, "typescript"),
|
|
3282
|
+
extraFileExtensions
|
|
3192
3283
|
})
|
|
3193
3284
|
);
|
|
3194
3285
|
}
|
|
3195
3286
|
if (enableVue) {
|
|
3196
|
-
|
|
3287
|
+
configs.push(
|
|
3197
3288
|
configVue({
|
|
3198
3289
|
...resolveSubOptions(options, "vue"),
|
|
3199
|
-
|
|
3200
|
-
|
|
3290
|
+
overrides: getOverrides(options, "vue"),
|
|
3291
|
+
extraFileExtensions
|
|
3201
3292
|
})
|
|
3202
3293
|
);
|
|
3203
3294
|
}
|
|
3204
3295
|
if (enableYML) {
|
|
3205
|
-
|
|
3296
|
+
configs.push(
|
|
3206
3297
|
configYml({
|
|
3207
3298
|
...resolveSubOptions(options, "yml"),
|
|
3208
3299
|
overrides: getOverrides(options, "yml")
|
|
@@ -3210,7 +3301,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3210
3301
|
);
|
|
3211
3302
|
}
|
|
3212
3303
|
if (enableTOML) {
|
|
3213
|
-
|
|
3304
|
+
configs.push(
|
|
3214
3305
|
configToml({
|
|
3215
3306
|
...resolveSubOptions(options, "toml"),
|
|
3216
3307
|
overrides: getOverrides(options, "toml")
|
|
@@ -3218,7 +3309,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3218
3309
|
);
|
|
3219
3310
|
}
|
|
3220
3311
|
if (enableJSONC) {
|
|
3221
|
-
|
|
3312
|
+
configs.push(
|
|
3222
3313
|
configJsonc({
|
|
3223
3314
|
...resolveSubOptions(options, "jsonc"),
|
|
3224
3315
|
overrides: getOverrides(options, "jsonc")
|
|
@@ -3226,10 +3317,10 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3226
3317
|
);
|
|
3227
3318
|
}
|
|
3228
3319
|
if (enableSort) {
|
|
3229
|
-
|
|
3320
|
+
configs.push(configSort(resolveSubOptions(options, "sort")));
|
|
3230
3321
|
}
|
|
3231
3322
|
if (enableTest) {
|
|
3232
|
-
|
|
3323
|
+
configs.push(
|
|
3233
3324
|
configTest({
|
|
3234
3325
|
...resolveSubOptions(options, "test"),
|
|
3235
3326
|
overrides: getOverrides(options, "test")
|
|
@@ -3237,30 +3328,30 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3237
3328
|
);
|
|
3238
3329
|
}
|
|
3239
3330
|
if (enableUnoCSS) {
|
|
3240
|
-
|
|
3331
|
+
configs.push(
|
|
3241
3332
|
configUnoCSS({
|
|
3242
3333
|
overrides: getOverrides(options, "unocss")
|
|
3243
3334
|
})
|
|
3244
3335
|
);
|
|
3245
3336
|
}
|
|
3246
3337
|
if (enableMarkdown) {
|
|
3247
|
-
|
|
3338
|
+
configs.push(
|
|
3248
3339
|
configMarkdown({
|
|
3249
3340
|
...resolveSubOptions(options, "markdown"),
|
|
3250
|
-
|
|
3251
|
-
|
|
3341
|
+
overrides: getOverrides(options, "markdown"),
|
|
3342
|
+
extraFileExtensions
|
|
3252
3343
|
})
|
|
3253
3344
|
);
|
|
3254
3345
|
}
|
|
3255
3346
|
if (enableAntfu) {
|
|
3256
|
-
|
|
3347
|
+
configs.push(
|
|
3257
3348
|
configAntfu({
|
|
3258
3349
|
overrides: getOverrides(options, "antfu")
|
|
3259
3350
|
})
|
|
3260
3351
|
);
|
|
3261
3352
|
}
|
|
3262
3353
|
if (enableDepend) {
|
|
3263
|
-
|
|
3354
|
+
configs.push(
|
|
3264
3355
|
configDepend({
|
|
3265
3356
|
...resolveSubOptions(options, "depend"),
|
|
3266
3357
|
overrides: getOverrides(options, "depend")
|
|
@@ -3268,175 +3359,51 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3268
3359
|
);
|
|
3269
3360
|
}
|
|
3270
3361
|
if (enableNtnyq) {
|
|
3271
|
-
|
|
3362
|
+
configs.push(
|
|
3272
3363
|
configNtnyq({
|
|
3273
3364
|
overrides: getOverrides(options, "ntnyq")
|
|
3274
3365
|
})
|
|
3275
3366
|
);
|
|
3276
3367
|
}
|
|
3277
3368
|
if (enableGitHubAction) {
|
|
3278
|
-
|
|
3369
|
+
configs.push(
|
|
3279
3370
|
configGitHubAction({
|
|
3280
3371
|
overrides: getOverrides(options, "githubAction")
|
|
3281
3372
|
})
|
|
3282
3373
|
);
|
|
3283
3374
|
}
|
|
3284
3375
|
if (enableESLintPlugin) {
|
|
3285
|
-
|
|
3376
|
+
configs.push(
|
|
3286
3377
|
configESLintPlugin({
|
|
3287
3378
|
overrides: getOverrides(options, "eslintPlugin")
|
|
3288
3379
|
})
|
|
3289
3380
|
);
|
|
3290
3381
|
}
|
|
3382
|
+
if (enablePnpm) {
|
|
3383
|
+
configs.push(
|
|
3384
|
+
configPnpm({
|
|
3385
|
+
...resolveSubOptions(options, "pnpm"),
|
|
3386
|
+
overrides: getOverrides(options, "pnpm")
|
|
3387
|
+
})
|
|
3388
|
+
);
|
|
3389
|
+
}
|
|
3291
3390
|
if (enableSVGO) {
|
|
3292
|
-
|
|
3391
|
+
configs.push(configSVGO(resolveSubOptions(options, "svgo")));
|
|
3293
3392
|
}
|
|
3294
|
-
const specialsConfigs = configSpecials(
|
|
3393
|
+
const specialsConfigs = configSpecials(
|
|
3394
|
+
resolveSubOptions(options, "specials")
|
|
3395
|
+
);
|
|
3295
3396
|
const prettierConfigs = enablePrettier ? configPrettier({
|
|
3296
3397
|
...resolveSubOptions(options, "prettier"),
|
|
3297
3398
|
overrides: getOverrides(options, "prettier")
|
|
3298
3399
|
}) : [];
|
|
3299
3400
|
const composer = new FlatConfigComposer(
|
|
3300
|
-
...
|
|
3401
|
+
...configs,
|
|
3301
3402
|
...userConfigs,
|
|
3302
3403
|
...specialsConfigs,
|
|
3303
3404
|
...prettierConfigs
|
|
3304
3405
|
);
|
|
3305
3406
|
return composer;
|
|
3306
3407
|
}
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
GLOB_ASTRO,
|
|
3310
|
-
GLOB_ASTRO_TS,
|
|
3311
|
-
GLOB_CSS,
|
|
3312
|
-
GLOB_DIST,
|
|
3313
|
-
GLOB_DTS,
|
|
3314
|
-
GLOB_EXCLUDE,
|
|
3315
|
-
GLOB_GITHUB_ACTION,
|
|
3316
|
-
GLOB_HTML,
|
|
3317
|
-
GLOB_JS,
|
|
3318
|
-
GLOB_JSON,
|
|
3319
|
-
GLOB_JSON5,
|
|
3320
|
-
GLOB_JSONC,
|
|
3321
|
-
GLOB_JSX,
|
|
3322
|
-
GLOB_JSX_ONLY,
|
|
3323
|
-
GLOB_LESS,
|
|
3324
|
-
GLOB_LOCKFILE,
|
|
3325
|
-
GLOB_MARKDOWN,
|
|
3326
|
-
GLOB_MARKDOWN_CODE,
|
|
3327
|
-
GLOB_MARKDOWN_NESTED,
|
|
3328
|
-
GLOB_NODE_MODULES,
|
|
3329
|
-
GLOB_PACKAGE_JSON,
|
|
3330
|
-
GLOB_PINIA_STORE,
|
|
3331
|
-
GLOB_POSTCSS,
|
|
3332
|
-
GLOB_SCSS,
|
|
3333
|
-
GLOB_SRC,
|
|
3334
|
-
GLOB_SRC_EXT,
|
|
3335
|
-
GLOB_STYLE,
|
|
3336
|
-
GLOB_SVELTE,
|
|
3337
|
-
GLOB_SVG,
|
|
3338
|
-
GLOB_TEST,
|
|
3339
|
-
GLOB_TOML,
|
|
3340
|
-
GLOB_TS,
|
|
3341
|
-
GLOB_TSCONFIG_JSON,
|
|
3342
|
-
GLOB_TSX,
|
|
3343
|
-
GLOB_TSX_ONLY,
|
|
3344
|
-
GLOB_TYPES,
|
|
3345
|
-
GLOB_TYPE_TEST,
|
|
3346
|
-
GLOB_VUE,
|
|
3347
|
-
GLOB_YAML,
|
|
3348
|
-
PERFECTIONIST_COMMON_RULE_OPTIONS,
|
|
3349
|
-
PERFECTIONIST_EXTRA_RULE_OPTIONS,
|
|
3350
|
-
PERFECTIONIST_SORT_CLASSES_GROUPS,
|
|
3351
|
-
PERFECTIONIST_SORT_IMPORTS_GROUPS,
|
|
3352
|
-
PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS,
|
|
3353
|
-
PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS,
|
|
3354
|
-
PERFECTIONIST_SORT_OBJECTS_GROUPS,
|
|
3355
|
-
PRETTIER_DEFAULT_OPTIONS,
|
|
3356
|
-
combineConfigs,
|
|
3357
|
-
configAntfu,
|
|
3358
|
-
configCommand,
|
|
3359
|
-
configDeMorgan,
|
|
3360
|
-
configDepend,
|
|
3361
|
-
configESLintComments,
|
|
3362
|
-
configESLintPlugin,
|
|
3363
|
-
configFormat,
|
|
3364
|
-
configGitHubAction,
|
|
3365
|
-
configGitIgnore,
|
|
3366
|
-
configIgnores,
|
|
3367
|
-
configImportX,
|
|
3368
|
-
configJSX,
|
|
3369
|
-
configJavaScript,
|
|
3370
|
-
configJsdoc,
|
|
3371
|
-
configJsonc,
|
|
3372
|
-
configMarkdown,
|
|
3373
|
-
configNode,
|
|
3374
|
-
configNtnyq,
|
|
3375
|
-
configPerfectionist,
|
|
3376
|
-
configPinia,
|
|
3377
|
-
configPrettier,
|
|
3378
|
-
configRegexp,
|
|
3379
|
-
configSVGO,
|
|
3380
|
-
configSort,
|
|
3381
|
-
configSpecials,
|
|
3382
|
-
configTest,
|
|
3383
|
-
configToml,
|
|
3384
|
-
configTypeScript,
|
|
3385
|
-
configUnicorn,
|
|
3386
|
-
configUnoCSS,
|
|
3387
|
-
configUnusedImports,
|
|
3388
|
-
configVue,
|
|
3389
|
-
configYml,
|
|
3390
|
-
configs as configsTypeScript,
|
|
3391
|
-
createNodeResolver,
|
|
3392
|
-
createTypeScriptImportResolver,
|
|
3393
|
-
defineESLintConfig,
|
|
3394
|
-
ensurePackages,
|
|
3395
|
-
getOverrides,
|
|
3396
|
-
hasPinia,
|
|
3397
|
-
hasShadcnVue,
|
|
3398
|
-
hasTypeScript,
|
|
3399
|
-
hasUnoCSS,
|
|
3400
|
-
hasVitest,
|
|
3401
|
-
hasVue,
|
|
3402
|
-
interopDefault,
|
|
3403
|
-
isInGitHooksOrRunByNanoStagedOrRunByTSX,
|
|
3404
|
-
mergePrettierOptions,
|
|
3405
|
-
mergeProcessors,
|
|
3406
|
-
parserJsonc,
|
|
3407
|
-
parserPlain,
|
|
3408
|
-
parserToml,
|
|
3409
|
-
parser as parserTypeScript,
|
|
3410
|
-
parserVue,
|
|
3411
|
-
parserYaml,
|
|
3412
|
-
default8 as pluginAntfu,
|
|
3413
|
-
default24 as pluginComments,
|
|
3414
|
-
default19 as pluginDeMorgan,
|
|
3415
|
-
pluginDepend,
|
|
3416
|
-
default13 as pluginFormat,
|
|
3417
|
-
default21 as pluginGitHubAction,
|
|
3418
|
-
default17 as pluginImportX,
|
|
3419
|
-
default9 as pluginJsdoc,
|
|
3420
|
-
default10 as pluginJsonc,
|
|
3421
|
-
default7 as pluginMarkdown,
|
|
3422
|
-
default20 as pluginNoOnlyTests,
|
|
3423
|
-
default2 as pluginNode,
|
|
3424
|
-
default12 as pluginNtnyq,
|
|
3425
|
-
default22 as pluginPerfectionist,
|
|
3426
|
-
default11 as pluginPinia,
|
|
3427
|
-
default18 as pluginPrettier,
|
|
3428
|
-
pluginRegexp,
|
|
3429
|
-
default5 as pluginSvgo,
|
|
3430
|
-
default6 as pluginToml,
|
|
3431
|
-
plugin as pluginTypeScript,
|
|
3432
|
-
default16 as pluginUnicorn,
|
|
3433
|
-
default14 as pluginUnoCSS,
|
|
3434
|
-
default23 as pluginUnusedImports,
|
|
3435
|
-
default15 as pluginVitest,
|
|
3436
|
-
default3 as pluginVue,
|
|
3437
|
-
default4 as pluginYml,
|
|
3438
|
-
processorPassThrough,
|
|
3439
|
-
default25 as processorVueBlocks,
|
|
3440
|
-
resolveSubOptions,
|
|
3441
|
-
toArray
|
|
3442
|
-
};
|
|
3408
|
+
|
|
3409
|
+
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 };
|