@ntnyq/eslint-config 3.0.0-beta.9 → 3.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 +112 -8
- package/dist/index.cjs +473 -346
- package/dist/index.d.cts +6404 -3061
- package/dist/index.d.ts +6404 -3061
- package/dist/index.js +510 -387
- package/package.json +30 -28
package/dist/index.js
CHANGED
|
@@ -5,11 +5,16 @@ import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
|
5
5
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
6
6
|
var GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;
|
|
7
7
|
var GLOB_JS = "**/*.?([cm])js";
|
|
8
|
-
var GLOB_JSX =
|
|
8
|
+
var GLOB_JSX = `${GLOB_JS}x`;
|
|
9
9
|
var GLOB_TS = "**/*.?([cm])ts";
|
|
10
|
-
var GLOB_TSX =
|
|
10
|
+
var GLOB_TSX = `${GLOB_TS}x`;
|
|
11
11
|
var GLOB_DTS = "**/*.d.?([cm])ts";
|
|
12
|
-
var GLOB_TEST =
|
|
12
|
+
var GLOB_TEST = [
|
|
13
|
+
`**/*.test.${GLOB_SRC_EXT}`,
|
|
14
|
+
`**/*.spec.${GLOB_SRC_EXT}`,
|
|
15
|
+
`**/*.bench.${GLOB_SRC_EXT}`,
|
|
16
|
+
`**/*.benchmark.${GLOB_SRC_EXT}`
|
|
17
|
+
];
|
|
13
18
|
var GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
14
19
|
var GLOB_CSS = "**/*.css";
|
|
15
20
|
var GLOB_LESS = "**/*.less";
|
|
@@ -21,6 +26,8 @@ var GLOB_VUE = "**/*.vue";
|
|
|
21
26
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
22
27
|
var GLOB_TOML = "**/*.toml";
|
|
23
28
|
var GLOB_HTML = "**/*.htm?(l)";
|
|
29
|
+
var GLOB_ASTRO = "**/*.astro";
|
|
30
|
+
var GLOB_SVELTE = "**/*.svelte";
|
|
24
31
|
var GLOB_MARKDOWN = "**/*.md";
|
|
25
32
|
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
26
33
|
var GLOB_MARKDOWN_NESTED = `${GLOB_MARKDOWN}/*.md`;
|
|
@@ -100,18 +107,19 @@ import { default as default2 } from "eslint-plugin-n";
|
|
|
100
107
|
import { default as default3 } from "eslint-plugin-vue";
|
|
101
108
|
import { default as default4 } from "eslint-plugin-yml";
|
|
102
109
|
import { default as default5 } from "eslint-plugin-toml";
|
|
103
|
-
import { default as default6 } from "
|
|
104
|
-
import { default as default7 } from "eslint
|
|
105
|
-
import { default as default8 } from "eslint-plugin-
|
|
106
|
-
import { default as default9 } from "eslint-plugin-
|
|
107
|
-
import { default as default10 } from "
|
|
108
|
-
import { default as default11 } from "@
|
|
109
|
-
import { default as default12 } from "eslint-plugin
|
|
110
|
-
import { default as default13 } from "eslint-plugin-
|
|
111
|
-
import { default as default14 } from "eslint-plugin-
|
|
112
|
-
import { default as default15 } from "eslint-plugin-
|
|
113
|
-
import { default as default16 } from "eslint-plugin-
|
|
114
|
-
import { default as default17 } from "
|
|
110
|
+
import { default as default6 } from "eslint-plugin-ntnyq";
|
|
111
|
+
import { default as default7 } from "@eslint/markdown";
|
|
112
|
+
import { default as default8 } from "eslint-plugin-antfu";
|
|
113
|
+
import { default as default9 } from "eslint-plugin-jsdoc";
|
|
114
|
+
import { default as default10 } from "eslint-plugin-jsonc";
|
|
115
|
+
import { default as default11 } from "@unocss/eslint-plugin";
|
|
116
|
+
import { default as default12 } from "@vitest/eslint-plugin";
|
|
117
|
+
import { default as default13 } from "eslint-plugin-import-x";
|
|
118
|
+
import { default as default14 } from "eslint-plugin-unicorn";
|
|
119
|
+
import { default as default15 } from "eslint-plugin-prettier";
|
|
120
|
+
import { default as default16 } from "eslint-plugin-perfectionist";
|
|
121
|
+
import { default as default17 } from "eslint-plugin-unused-imports";
|
|
122
|
+
import { default as default18 } from "@eslint-community/eslint-plugin-eslint-comments";
|
|
115
123
|
|
|
116
124
|
// src/configs/typescript.ts
|
|
117
125
|
import process from "node:process";
|
|
@@ -134,6 +142,29 @@ var typescriptCore = (options = {}) => {
|
|
|
134
142
|
}
|
|
135
143
|
},
|
|
136
144
|
rules: {
|
|
145
|
+
// Disabled in favor of ts rules
|
|
146
|
+
"no-redeclare": "off",
|
|
147
|
+
"no-use-before-define": "off",
|
|
148
|
+
"no-unused-vars": "off",
|
|
149
|
+
"@typescript-eslint/no-redeclare": [
|
|
150
|
+
"error",
|
|
151
|
+
{
|
|
152
|
+
builtinGlobals: false,
|
|
153
|
+
ignoreDeclarationMerge: true
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
"@typescript-eslint/no-use-before-define": [
|
|
157
|
+
"error",
|
|
158
|
+
{
|
|
159
|
+
functions: false,
|
|
160
|
+
classes: false,
|
|
161
|
+
variables: true,
|
|
162
|
+
allowNamedExports: false,
|
|
163
|
+
enums: true,
|
|
164
|
+
typedefs: false,
|
|
165
|
+
ignoreTypeReferences: false
|
|
166
|
+
}
|
|
167
|
+
],
|
|
137
168
|
"@typescript-eslint/no-unused-vars": [
|
|
138
169
|
"error",
|
|
139
170
|
{
|
|
@@ -147,7 +178,14 @@ var typescriptCore = (options = {}) => {
|
|
|
147
178
|
ignoreRestSiblings: true
|
|
148
179
|
}
|
|
149
180
|
],
|
|
150
|
-
"@typescript-eslint/no-
|
|
181
|
+
"@typescript-eslint/no-unused-expressions": [
|
|
182
|
+
"error",
|
|
183
|
+
{
|
|
184
|
+
allowShortCircuit: true,
|
|
185
|
+
allowTernary: true,
|
|
186
|
+
allowTaggedTemplates: true
|
|
187
|
+
}
|
|
188
|
+
],
|
|
151
189
|
"@typescript-eslint/consistent-type-imports": [
|
|
152
190
|
"error",
|
|
153
191
|
{
|
|
@@ -185,37 +223,25 @@ var typescriptCore = (options = {}) => {
|
|
|
185
223
|
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
186
224
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
187
225
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
188
|
-
"@typescript-eslint/consistent-indexed-object-style": "off"
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
226
|
+
"@typescript-eslint/consistent-indexed-object-style": "off",
|
|
227
|
+
// Overrides rules
|
|
228
|
+
...options.overrides
|
|
229
|
+
}
|
|
192
230
|
});
|
|
193
231
|
return configs;
|
|
194
232
|
};
|
|
195
233
|
var typescript = (options = {}) => [
|
|
196
234
|
...typescriptCore(options),
|
|
197
235
|
{
|
|
198
|
-
name: "ntnyq/ts/
|
|
199
|
-
files: [GLOB_DTS],
|
|
236
|
+
name: "ntnyq/ts/types",
|
|
237
|
+
files: [GLOB_DTS, "**/types/**/*.ts"],
|
|
200
238
|
rules: {
|
|
201
239
|
"no-use-before-define": "off",
|
|
202
240
|
"no-restricted-syntax": "off",
|
|
203
241
|
"import/no-duplicates": "off",
|
|
204
|
-
"import/newline-after-import": "off"
|
|
205
|
-
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
name: "ntnyq/ts/test",
|
|
209
|
-
files: ["**/*.{spec,test}.ts?(x)"],
|
|
210
|
-
rules: {
|
|
211
|
-
"no-unused-expressions": "off",
|
|
212
|
-
"max-lines-per-function": "off"
|
|
242
|
+
"import/newline-after-import": "off",
|
|
243
|
+
"@typescript-eslint/no-use-before-define": "off"
|
|
213
244
|
}
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
name: "ntnyq/ts/cjs",
|
|
217
|
-
files: [GLOB_JS],
|
|
218
|
-
rules: {}
|
|
219
245
|
}
|
|
220
246
|
];
|
|
221
247
|
|
|
@@ -341,6 +367,7 @@ var vue = (options = {}) => {
|
|
|
341
367
|
"vue/no-irregular-whitespace": "error",
|
|
342
368
|
"vue/no-use-v-else-with-v-for": "error",
|
|
343
369
|
"vue/require-typed-object-prop": "error",
|
|
370
|
+
"vue/no-deprecated-delete-set": "error",
|
|
344
371
|
"vue/no-extra-parens": ["error", "functions"],
|
|
345
372
|
"vue/no-restricted-syntax": [
|
|
346
373
|
"error",
|
|
@@ -487,7 +514,7 @@ var vue = (options = {}) => {
|
|
|
487
514
|
multiline: 1
|
|
488
515
|
}
|
|
489
516
|
],
|
|
490
|
-
// Overrides
|
|
517
|
+
// Overrides rules
|
|
491
518
|
...options.overrides
|
|
492
519
|
}
|
|
493
520
|
}
|
|
@@ -510,7 +537,7 @@ var yml = (options = {}) => [
|
|
|
510
537
|
...default4.configs.prettier.rules,
|
|
511
538
|
"yml/no-empty-mapping-value": "off",
|
|
512
539
|
"yml/quotes": ["error", { avoidEscape: false, prefer: "single" }],
|
|
513
|
-
// Overrides
|
|
540
|
+
// Overrides rules
|
|
514
541
|
...options.overrides
|
|
515
542
|
}
|
|
516
543
|
}
|
|
@@ -532,244 +559,259 @@ var node = (options = {}) => [
|
|
|
532
559
|
"node/prefer-global/buffer": ["error", "never"],
|
|
533
560
|
"node/prefer-global/process": ["error", "never"],
|
|
534
561
|
"node/process-exit-as-throw": "error",
|
|
535
|
-
// Overrides
|
|
562
|
+
// Overrides rules
|
|
536
563
|
...options.overrides
|
|
537
564
|
}
|
|
538
565
|
}
|
|
539
566
|
];
|
|
540
567
|
|
|
541
568
|
// src/configs/sort.ts
|
|
542
|
-
var
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
"
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
"
|
|
553
|
-
"
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
569
|
+
var sort = (options = {}) => {
|
|
570
|
+
const configs = [];
|
|
571
|
+
if (options.tsconfig ?? true) {
|
|
572
|
+
configs.push({
|
|
573
|
+
name: "ntnyq/sort/tsconfig",
|
|
574
|
+
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
575
|
+
rules: {
|
|
576
|
+
"jsonc/sort-keys": [
|
|
577
|
+
"error",
|
|
578
|
+
{
|
|
579
|
+
order: ["extends", "compilerOptions", "references", "files", "include", "exclude"],
|
|
580
|
+
pathPattern: "^$"
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
order: [
|
|
584
|
+
/* Projects */
|
|
585
|
+
"incremental",
|
|
586
|
+
"composite",
|
|
587
|
+
"tsBuildInfoFile",
|
|
588
|
+
"disableSourceOfProjectReferenceRedirect",
|
|
589
|
+
"disableSolutionSearching",
|
|
590
|
+
"disableReferencedProjectLoad",
|
|
591
|
+
/* Language and Environment */
|
|
592
|
+
"target",
|
|
593
|
+
"lib",
|
|
594
|
+
"jsx",
|
|
595
|
+
"experimentalDecorators",
|
|
596
|
+
"emitDecoratorMetadata",
|
|
597
|
+
"jsxFactory",
|
|
598
|
+
"jsxFragmentFactory",
|
|
599
|
+
"jsxImportSource",
|
|
600
|
+
"reactNamespace",
|
|
601
|
+
"noLib",
|
|
602
|
+
"useDefineForClassFields",
|
|
603
|
+
"moduleDetection",
|
|
604
|
+
/* Modules */
|
|
605
|
+
"module",
|
|
606
|
+
"rootDir",
|
|
607
|
+
"moduleResolution",
|
|
608
|
+
"baseUrl",
|
|
609
|
+
"paths",
|
|
610
|
+
"rootDirs",
|
|
611
|
+
"typeRoots",
|
|
612
|
+
"types",
|
|
613
|
+
"allowUmdGlobalAccess",
|
|
614
|
+
"moduleSuffixes",
|
|
615
|
+
"allowImportingTsExtensions",
|
|
616
|
+
"resolvePackageJsonExports",
|
|
617
|
+
"resolvePackageJsonImports",
|
|
618
|
+
"customConditions",
|
|
619
|
+
"resolveJsonModule",
|
|
620
|
+
"allowArbitraryExtensions",
|
|
621
|
+
"noResolve",
|
|
622
|
+
/* JavaScript Support */
|
|
623
|
+
"allowJs",
|
|
624
|
+
"checkJs",
|
|
625
|
+
"maxNodeModuleJsDepth",
|
|
626
|
+
/* Emit */
|
|
627
|
+
"declaration",
|
|
628
|
+
"declarationMap",
|
|
629
|
+
"emitDeclarationOnly",
|
|
630
|
+
"sourceMap",
|
|
631
|
+
"inlineSourceMap",
|
|
632
|
+
"outFile",
|
|
633
|
+
"outDir",
|
|
634
|
+
"removeComments",
|
|
635
|
+
"noEmit",
|
|
636
|
+
"importHelpers",
|
|
637
|
+
"importsNotUsedAsValues",
|
|
638
|
+
"downlevelIteration",
|
|
639
|
+
"sourceRoot",
|
|
640
|
+
"mapRoot",
|
|
641
|
+
"inlineSources",
|
|
642
|
+
"emitBOM",
|
|
643
|
+
"newLine",
|
|
644
|
+
"stripInternal",
|
|
645
|
+
"noEmitHelpers",
|
|
646
|
+
"noEmitOnError",
|
|
647
|
+
"preserveConstEnums",
|
|
648
|
+
"declarationDir",
|
|
649
|
+
"preserveValueImports",
|
|
650
|
+
/* Interop Constraints */
|
|
651
|
+
"isolatedModules",
|
|
652
|
+
"verbatimModuleSyntax",
|
|
653
|
+
"allowSyntheticDefaultImports",
|
|
654
|
+
"esModuleInterop",
|
|
655
|
+
"preserveSymlinks",
|
|
656
|
+
"forceConsistentCasingInFileNames",
|
|
657
|
+
/* Type Checking */
|
|
658
|
+
"strict",
|
|
659
|
+
"strictBindCallApply",
|
|
660
|
+
"strictFunctionTypes",
|
|
661
|
+
"strictNullChecks",
|
|
662
|
+
"strictPropertyInitialization",
|
|
663
|
+
"allowUnreachableCode",
|
|
664
|
+
"allowUnusedLabels",
|
|
665
|
+
"alwaysStrict",
|
|
666
|
+
"exactOptionalPropertyTypes",
|
|
667
|
+
"noFallthroughCasesInSwitch",
|
|
668
|
+
"noImplicitAny",
|
|
669
|
+
"noImplicitOverride",
|
|
670
|
+
"noImplicitReturns",
|
|
671
|
+
"noImplicitThis",
|
|
672
|
+
"noPropertyAccessFromIndexSignature",
|
|
673
|
+
"noUncheckedIndexedAccess",
|
|
674
|
+
"noUnusedLocals",
|
|
675
|
+
"noUnusedParameters",
|
|
676
|
+
"useUnknownInCatchVariables",
|
|
677
|
+
/* Completeness */
|
|
678
|
+
"skipDefaultLibCheck",
|
|
679
|
+
"skipLibCheck"
|
|
680
|
+
],
|
|
681
|
+
pathPattern: "^compilerOptions$"
|
|
682
|
+
}
|
|
683
|
+
]
|
|
684
|
+
}
|
|
685
|
+
});
|
|
640
686
|
}
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
"
|
|
700
|
-
"
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
"
|
|
704
|
-
"
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
"
|
|
708
|
-
"
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
"
|
|
712
|
-
"
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
"
|
|
735
|
-
"
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
"noImplicitOverride",
|
|
741
|
-
"noImplicitReturns",
|
|
742
|
-
"noImplicitThis",
|
|
743
|
-
"noPropertyAccessFromIndexSignature",
|
|
744
|
-
"noUncheckedIndexedAccess",
|
|
745
|
-
"noUnusedLocals",
|
|
746
|
-
"noUnusedParameters",
|
|
747
|
-
"useUnknownInCatchVariables",
|
|
748
|
-
/* Completeness */
|
|
749
|
-
"skipDefaultLibCheck",
|
|
750
|
-
"skipLibCheck"
|
|
751
|
-
],
|
|
752
|
-
pathPattern: "^compilerOptions$"
|
|
753
|
-
}
|
|
754
|
-
]
|
|
755
|
-
}
|
|
687
|
+
if (options.packageJson ?? true) {
|
|
688
|
+
configs.push({
|
|
689
|
+
name: "ntnyq/sort/package-json",
|
|
690
|
+
files: ["**/package.json"],
|
|
691
|
+
rules: {
|
|
692
|
+
"jsonc/sort-keys": [
|
|
693
|
+
"error",
|
|
694
|
+
{
|
|
695
|
+
pathPattern: "^$",
|
|
696
|
+
order: [
|
|
697
|
+
"publisher",
|
|
698
|
+
"name",
|
|
699
|
+
"displayName",
|
|
700
|
+
"preview",
|
|
701
|
+
"type",
|
|
702
|
+
"version",
|
|
703
|
+
"private",
|
|
704
|
+
"packageManager",
|
|
705
|
+
"description",
|
|
706
|
+
"keywords",
|
|
707
|
+
"license",
|
|
708
|
+
"author",
|
|
709
|
+
"homepage",
|
|
710
|
+
"repository",
|
|
711
|
+
"funding",
|
|
712
|
+
"exports",
|
|
713
|
+
"main",
|
|
714
|
+
"module",
|
|
715
|
+
"unpkg",
|
|
716
|
+
"jsdelivr",
|
|
717
|
+
// workaround for `type: "module"` with TS `moduleResolution: "node16"`
|
|
718
|
+
"types",
|
|
719
|
+
"typesVersions",
|
|
720
|
+
"bin",
|
|
721
|
+
"icon",
|
|
722
|
+
"files",
|
|
723
|
+
"sideEffects",
|
|
724
|
+
"scripts",
|
|
725
|
+
"peerDependencies",
|
|
726
|
+
"peerDependenciesMeta",
|
|
727
|
+
"dependencies",
|
|
728
|
+
"optionalDependencies",
|
|
729
|
+
"devDependencies",
|
|
730
|
+
"activationEvents",
|
|
731
|
+
"contributes",
|
|
732
|
+
"categories",
|
|
733
|
+
"engines",
|
|
734
|
+
"pnpm",
|
|
735
|
+
"overrides",
|
|
736
|
+
"resolutions",
|
|
737
|
+
"husky",
|
|
738
|
+
"prettier",
|
|
739
|
+
"nano-staged",
|
|
740
|
+
"lint-staged",
|
|
741
|
+
"eslintConfig"
|
|
742
|
+
]
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$",
|
|
746
|
+
order: { type: "asc" }
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
order: { type: "asc" },
|
|
750
|
+
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
pathPattern: "^exports.*$",
|
|
754
|
+
order: ["types", "import", "require", "default"]
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
pathPattern: "^scripts$",
|
|
758
|
+
order: { type: "asc" }
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
order: [
|
|
762
|
+
// client hooks only
|
|
763
|
+
"pre-commit",
|
|
764
|
+
"prepare-commit-msg",
|
|
765
|
+
"commit-msg",
|
|
766
|
+
"post-commit",
|
|
767
|
+
"pre-rebase",
|
|
768
|
+
"post-rewrite",
|
|
769
|
+
"post-checkout",
|
|
770
|
+
"post-merge",
|
|
771
|
+
"pre-push",
|
|
772
|
+
"pre-auto-gc"
|
|
773
|
+
],
|
|
774
|
+
pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
|
|
775
|
+
}
|
|
776
|
+
],
|
|
777
|
+
"jsonc/sort-array-values": [
|
|
778
|
+
"error",
|
|
779
|
+
{
|
|
780
|
+
pathPattern: "^files$",
|
|
781
|
+
order: { type: "asc" }
|
|
782
|
+
}
|
|
783
|
+
]
|
|
784
|
+
}
|
|
785
|
+
});
|
|
756
786
|
}
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
787
|
+
if (options.i18nLocale ?? true) {
|
|
788
|
+
configs.push({
|
|
789
|
+
name: "ntnyq/sort/i18n-locale",
|
|
790
|
+
files: ["**/{locales,i18n}/*.json", "**/{locales,i18n}/*.y?(a)ml"],
|
|
791
|
+
plugins: {
|
|
792
|
+
jsonc: default10,
|
|
793
|
+
yml: default4
|
|
794
|
+
},
|
|
795
|
+
rules: {
|
|
796
|
+
"jsonc/sort-keys": [
|
|
797
|
+
"error",
|
|
798
|
+
{
|
|
799
|
+
pathPattern: ".*",
|
|
800
|
+
order: { type: "asc" }
|
|
801
|
+
}
|
|
802
|
+
],
|
|
803
|
+
"yml/sort-keys": [
|
|
804
|
+
"error",
|
|
805
|
+
{
|
|
806
|
+
pathPattern: ".*",
|
|
807
|
+
order: { type: "asc" }
|
|
808
|
+
}
|
|
809
|
+
]
|
|
810
|
+
}
|
|
811
|
+
});
|
|
771
812
|
}
|
|
772
|
-
|
|
813
|
+
return configs;
|
|
814
|
+
};
|
|
773
815
|
|
|
774
816
|
// src/configs/toml.ts
|
|
775
817
|
var toml = (options = {}) => [
|
|
@@ -802,24 +844,53 @@ var toml = (options = {}) => [
|
|
|
802
844
|
"toml/quoted-keys": "error",
|
|
803
845
|
"toml/spaced-comment": "error",
|
|
804
846
|
"toml/table-bracket-spacing": "error",
|
|
805
|
-
// Overrides
|
|
847
|
+
// Overrides rules
|
|
848
|
+
...options.overrides
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
];
|
|
852
|
+
|
|
853
|
+
// src/configs/test.ts
|
|
854
|
+
var test = (options = {}) => [
|
|
855
|
+
{
|
|
856
|
+
name: "ntnyq/test",
|
|
857
|
+
files: [...GLOB_TEST],
|
|
858
|
+
rules: {
|
|
859
|
+
"no-unused-expressions": "off",
|
|
860
|
+
"max-lines-per-function": "off",
|
|
861
|
+
// Overrides rules
|
|
806
862
|
...options.overrides
|
|
807
863
|
}
|
|
808
864
|
}
|
|
809
865
|
];
|
|
866
|
+
var vitest = (options = {}) => [
|
|
867
|
+
{
|
|
868
|
+
name: "ntnyq/vitest",
|
|
869
|
+
plugins: {
|
|
870
|
+
vitest: default12
|
|
871
|
+
},
|
|
872
|
+
files: [...GLOB_TEST],
|
|
873
|
+
rules: {
|
|
874
|
+
...default12.configs.recommended.rules,
|
|
875
|
+
// Overrides rules
|
|
876
|
+
...options.overridesVitestRules
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
];
|
|
810
880
|
|
|
811
881
|
// src/configs/antfu.ts
|
|
812
882
|
var antfu = (options = {}) => [
|
|
813
883
|
{
|
|
814
884
|
name: "ntnyq/antfu",
|
|
815
885
|
plugins: {
|
|
816
|
-
antfu:
|
|
886
|
+
antfu: default8
|
|
817
887
|
},
|
|
818
888
|
rules: {
|
|
819
889
|
// required `object-curly-newline` to be disabled
|
|
820
890
|
// 'antfu/consistent-list-newline': 'error',
|
|
821
891
|
"antfu/import-dedupe": "error",
|
|
822
892
|
"antfu/top-level-function": "error",
|
|
893
|
+
// Overrides rules
|
|
823
894
|
...options.overrides
|
|
824
895
|
}
|
|
825
896
|
}
|
|
@@ -830,7 +901,7 @@ var jsdoc = (options = {}) => [
|
|
|
830
901
|
{
|
|
831
902
|
name: "ntnyq/jsdoc",
|
|
832
903
|
plugins: {
|
|
833
|
-
jsdoc:
|
|
904
|
+
jsdoc: default9
|
|
834
905
|
},
|
|
835
906
|
rules: {
|
|
836
907
|
"jsdoc/check-access": "warn",
|
|
@@ -850,7 +921,7 @@ var jsdoc = (options = {}) => [
|
|
|
850
921
|
"jsdoc/require-yields-check": "warn",
|
|
851
922
|
"jsdoc/check-alignment": "warn",
|
|
852
923
|
"jsdoc/multiline-blocks": "warn",
|
|
853
|
-
// Overrides
|
|
924
|
+
// Overrides rules
|
|
854
925
|
...options.overrides
|
|
855
926
|
}
|
|
856
927
|
}
|
|
@@ -862,13 +933,13 @@ var jsonc = (options = {}) => [
|
|
|
862
933
|
name: "ntnyq/jsonc",
|
|
863
934
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
864
935
|
plugins: {
|
|
865
|
-
jsonc:
|
|
936
|
+
jsonc: default10
|
|
866
937
|
},
|
|
867
938
|
languageOptions: {
|
|
868
939
|
parser: parserJsonc
|
|
869
940
|
},
|
|
870
941
|
rules: {
|
|
871
|
-
...
|
|
942
|
+
...default10.configs["recommended-with-jsonc"].rules,
|
|
872
943
|
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
873
944
|
"jsonc/comma-dangle": ["error", "never"],
|
|
874
945
|
"jsonc/comma-style": ["error", "last"],
|
|
@@ -895,7 +966,22 @@ var jsonc = (options = {}) => [
|
|
|
895
966
|
allowMultiplePropertiesPerLine: true
|
|
896
967
|
}
|
|
897
968
|
],
|
|
898
|
-
// Overrides
|
|
969
|
+
// Overrides rules
|
|
970
|
+
...options.overrides
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
];
|
|
974
|
+
|
|
975
|
+
// src/configs/ntnyq.ts
|
|
976
|
+
var ntnyq = (options = {}) => [
|
|
977
|
+
{
|
|
978
|
+
name: "ntnyq/ntnyq",
|
|
979
|
+
plugins: {
|
|
980
|
+
ntnyq: default6
|
|
981
|
+
},
|
|
982
|
+
rules: {
|
|
983
|
+
"ntnyq/no-member-accessibility": "error",
|
|
984
|
+
// Overrides rules
|
|
899
985
|
...options.overrides
|
|
900
986
|
}
|
|
901
987
|
}
|
|
@@ -909,7 +995,7 @@ var regexp = (options = {}) => [
|
|
|
909
995
|
{
|
|
910
996
|
name: "ntnyq/regexp",
|
|
911
997
|
...pluginRegexp.configs["flat/recommended"],
|
|
912
|
-
// Overrides
|
|
998
|
+
// Overrides rules
|
|
913
999
|
...options.overrides
|
|
914
1000
|
}
|
|
915
1001
|
];
|
|
@@ -919,39 +1005,23 @@ var unocss = (options = {}) => [
|
|
|
919
1005
|
{
|
|
920
1006
|
name: "ntnyq/unocss",
|
|
921
1007
|
plugins: {
|
|
922
|
-
unocss:
|
|
1008
|
+
unocss: default11
|
|
923
1009
|
},
|
|
924
1010
|
rules: {
|
|
925
1011
|
"unocss/order": "error",
|
|
926
1012
|
// We don't use this
|
|
927
1013
|
"unocss/order-attributify": "off",
|
|
928
|
-
// Overrides
|
|
929
|
-
...options.overrides
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
];
|
|
933
|
-
|
|
934
|
-
// src/configs/vitest.ts
|
|
935
|
-
var vitest = (options = {}) => [
|
|
936
|
-
{
|
|
937
|
-
name: "ntnyq/vitest",
|
|
938
|
-
plugins: {
|
|
939
|
-
vitest: default11
|
|
940
|
-
},
|
|
941
|
-
files: [GLOB_TEST],
|
|
942
|
-
rules: {
|
|
943
|
-
...default11.configs.recommended.rules,
|
|
944
|
-
// Overrides built-in rules
|
|
1014
|
+
// Overrides rules
|
|
945
1015
|
...options.overrides
|
|
946
1016
|
}
|
|
947
1017
|
}
|
|
948
1018
|
];
|
|
949
1019
|
|
|
950
1020
|
// src/configs/command.ts
|
|
951
|
-
import
|
|
1021
|
+
import createCommandConfig from "eslint-plugin-command/config";
|
|
952
1022
|
var command = (options = {}) => [
|
|
953
1023
|
{
|
|
954
|
-
...
|
|
1024
|
+
...createCommandConfig(options),
|
|
955
1025
|
name: "ntnyq/command"
|
|
956
1026
|
}
|
|
957
1027
|
];
|
|
@@ -973,7 +1043,7 @@ var imports = (options = {}) => [
|
|
|
973
1043
|
{
|
|
974
1044
|
name: "ntnyq/imports",
|
|
975
1045
|
plugins: {
|
|
976
|
-
import:
|
|
1046
|
+
import: default13
|
|
977
1047
|
},
|
|
978
1048
|
settings: {
|
|
979
1049
|
"import/resolver": {
|
|
@@ -984,14 +1054,16 @@ var imports = (options = {}) => [
|
|
|
984
1054
|
"import/no-unresolved": "off",
|
|
985
1055
|
"import/no-absolute-path": "off",
|
|
986
1056
|
"import/no-named-as-default-member": "off",
|
|
987
|
-
|
|
1057
|
+
"import/no-named-default": "off",
|
|
1058
|
+
// disabled in favor or `perfectionist/sort-imports`
|
|
1059
|
+
"import/order": "off",
|
|
988
1060
|
"import/first": "error",
|
|
989
1061
|
"import/export": "error",
|
|
990
1062
|
"import/no-self-import": "error",
|
|
991
1063
|
"import/no-duplicates": "error",
|
|
992
1064
|
"import/no-mutable-exports": "error",
|
|
993
1065
|
"import/newline-after-import": "error",
|
|
994
|
-
// Overrides
|
|
1066
|
+
// Overrides rules
|
|
995
1067
|
...options.overrides
|
|
996
1068
|
}
|
|
997
1069
|
}
|
|
@@ -1002,7 +1074,7 @@ var unicorn = (options = {}) => [
|
|
|
1002
1074
|
{
|
|
1003
1075
|
name: "ntnyq/unicorn",
|
|
1004
1076
|
plugins: {
|
|
1005
|
-
unicorn:
|
|
1077
|
+
unicorn: default14
|
|
1006
1078
|
},
|
|
1007
1079
|
rules: {
|
|
1008
1080
|
// Disabled for now
|
|
@@ -1010,6 +1082,10 @@ var unicorn = (options = {}) => [
|
|
|
1010
1082
|
"unicorn/prefer-top-level-await": "off",
|
|
1011
1083
|
"unicorn/explicit-length-check": "off",
|
|
1012
1084
|
"unicorn/no-array-callback-reference": "off",
|
|
1085
|
+
/**
|
|
1086
|
+
* @see https://caniuse.com/?search=globalThis
|
|
1087
|
+
*/
|
|
1088
|
+
"unicorn/prefer-global-this": "off",
|
|
1013
1089
|
"unicorn/error-message": "error",
|
|
1014
1090
|
"unicorn/escape-case": "error",
|
|
1015
1091
|
"unicorn/no-new-buffer": "error",
|
|
@@ -1039,6 +1115,8 @@ var unicorn = (options = {}) => [
|
|
|
1039
1115
|
"unicorn/prefer-optional-catch-binding": "error",
|
|
1040
1116
|
"unicorn/prefer-prototype-methods": "error",
|
|
1041
1117
|
"unicorn/prefer-reflect-apply": "error",
|
|
1118
|
+
"unicorn/prefer-math-min-max": "error",
|
|
1119
|
+
"unicorn/consistent-existence-index-check": "error",
|
|
1042
1120
|
"unicorn/catch-error-name": [
|
|
1043
1121
|
"error",
|
|
1044
1122
|
{
|
|
@@ -1069,23 +1147,61 @@ var unicorn = (options = {}) => [
|
|
|
1069
1147
|
"unicorn/prefer-array-some": "error",
|
|
1070
1148
|
"unicorn/prefer-array-flat-map": "error",
|
|
1071
1149
|
"unicorn/prefer-array-index-of": "error",
|
|
1072
|
-
// Overrides
|
|
1150
|
+
// Overrides rules
|
|
1073
1151
|
...options.overrides
|
|
1074
1152
|
}
|
|
1075
1153
|
}
|
|
1076
1154
|
];
|
|
1077
1155
|
|
|
1156
|
+
// src/configs/specials.ts
|
|
1157
|
+
import globals from "globals";
|
|
1158
|
+
var specials = () => [
|
|
1159
|
+
{
|
|
1160
|
+
name: "ntnyq/specials/scripts",
|
|
1161
|
+
files: [`**/scripts/${GLOB_SRC}`],
|
|
1162
|
+
rules: {
|
|
1163
|
+
"no-console": "off",
|
|
1164
|
+
"@typescript-eslint/explicit-function-return-type": "off"
|
|
1165
|
+
}
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
name: "ntnyq/specials/cli",
|
|
1169
|
+
files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
|
|
1170
|
+
rules: {
|
|
1171
|
+
"no-console": "off",
|
|
1172
|
+
"@typescript-eslint/explicit-function-return-type": "off"
|
|
1173
|
+
}
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
name: "ntnyq/specials/userscript",
|
|
1177
|
+
files: [`**/*.user.${GLOB_SRC_EXT}`],
|
|
1178
|
+
languageOptions: {
|
|
1179
|
+
globals: {
|
|
1180
|
+
...globals.greasemonkey
|
|
1181
|
+
}
|
|
1182
|
+
},
|
|
1183
|
+
rules: {
|
|
1184
|
+
camelcase: [
|
|
1185
|
+
"error",
|
|
1186
|
+
{
|
|
1187
|
+
allow: ["^GM_.+"]
|
|
1188
|
+
}
|
|
1189
|
+
]
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
];
|
|
1193
|
+
|
|
1078
1194
|
// src/configs/comments.ts
|
|
1079
1195
|
var comments = (options = {}) => [
|
|
1080
1196
|
{
|
|
1081
1197
|
name: "ntnyq/eslint-comments",
|
|
1082
1198
|
plugins: {
|
|
1083
|
-
"@eslint-community/eslint-comments":
|
|
1199
|
+
"@eslint-community/eslint-comments": default18
|
|
1084
1200
|
},
|
|
1085
1201
|
rules: {
|
|
1086
|
-
...
|
|
1202
|
+
...default18.configs.recommended.rules,
|
|
1087
1203
|
"@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
|
|
1088
|
-
// Overrides
|
|
1204
|
+
// Overrides rules
|
|
1089
1205
|
...options.overrides
|
|
1090
1206
|
}
|
|
1091
1207
|
}
|
|
@@ -1093,9 +1209,9 @@ var comments = (options = {}) => [
|
|
|
1093
1209
|
|
|
1094
1210
|
// src/configs/markdown.ts
|
|
1095
1211
|
var markdown = (options = {}) => {
|
|
1096
|
-
if (!Array.isArray(
|
|
1212
|
+
if (!Array.isArray(default7.configs?.processor)) return [];
|
|
1097
1213
|
return [
|
|
1098
|
-
...
|
|
1214
|
+
...default7.configs.processor.map((config) => ({
|
|
1099
1215
|
...config,
|
|
1100
1216
|
name: `ntnyq/${config.name}`
|
|
1101
1217
|
})),
|
|
@@ -1123,7 +1239,7 @@ var markdown = (options = {}) => {
|
|
|
1123
1239
|
"@typescript-eslint/no-use-before-define": "off",
|
|
1124
1240
|
"@typescript-eslint/no-unused-expressions": "off",
|
|
1125
1241
|
"@typescript-eslint/consistent-type-imports": "off",
|
|
1126
|
-
// Overrides
|
|
1242
|
+
// Overrides rules
|
|
1127
1243
|
...options.overrides
|
|
1128
1244
|
}
|
|
1129
1245
|
}
|
|
@@ -1135,7 +1251,7 @@ var prettier = (options = {}) => [
|
|
|
1135
1251
|
{
|
|
1136
1252
|
name: "ntnyq/prettier",
|
|
1137
1253
|
plugins: {
|
|
1138
|
-
prettier:
|
|
1254
|
+
prettier: default15
|
|
1139
1255
|
},
|
|
1140
1256
|
rules: {
|
|
1141
1257
|
"vue/array-bracket-newline": "off",
|
|
@@ -1175,9 +1291,9 @@ var prettier = (options = {}) => [
|
|
|
1175
1291
|
"vue/space-infix-ops": "off",
|
|
1176
1292
|
"vue/space-unary-ops": "off",
|
|
1177
1293
|
"vue/template-curly-spacing": "off",
|
|
1178
|
-
...
|
|
1294
|
+
...default15.configs.recommended.rules,
|
|
1179
1295
|
"prettier/prettier": options.level || "warn",
|
|
1180
|
-
// Overrides
|
|
1296
|
+
// Overrides rules
|
|
1181
1297
|
...options.overrides
|
|
1182
1298
|
}
|
|
1183
1299
|
},
|
|
@@ -1186,9 +1302,9 @@ var prettier = (options = {}) => [
|
|
|
1186
1302
|
*/
|
|
1187
1303
|
{
|
|
1188
1304
|
name: "ntnyq/prettier/disabled",
|
|
1189
|
-
files: [GLOB_TOML],
|
|
1305
|
+
files: [GLOB_TOML, GLOB_ASTRO, GLOB_SVELTE],
|
|
1190
1306
|
plugins: {
|
|
1191
|
-
prettier:
|
|
1307
|
+
prettier: default15
|
|
1192
1308
|
},
|
|
1193
1309
|
rules: {
|
|
1194
1310
|
"prettier/prettier": "off"
|
|
@@ -1197,17 +1313,17 @@ var prettier = (options = {}) => [
|
|
|
1197
1313
|
];
|
|
1198
1314
|
|
|
1199
1315
|
// src/configs/gitignore.ts
|
|
1200
|
-
import
|
|
1316
|
+
import createGitIgnoreConfig from "eslint-config-flat-gitignore";
|
|
1201
1317
|
var gitignore = (options = {}) => [
|
|
1202
1318
|
{
|
|
1203
|
-
...
|
|
1319
|
+
...createGitIgnoreConfig(options),
|
|
1204
1320
|
name: "ntnyq/gitignore"
|
|
1205
1321
|
}
|
|
1206
1322
|
];
|
|
1207
1323
|
|
|
1208
1324
|
// src/configs/javascript.ts
|
|
1209
1325
|
import jsConfig from "@eslint/js";
|
|
1210
|
-
import
|
|
1326
|
+
import globals2 from "globals";
|
|
1211
1327
|
var javascript = (options = {}) => {
|
|
1212
1328
|
const strictRules = {
|
|
1213
1329
|
complexity: ["error", { max: 30 }],
|
|
@@ -1240,13 +1356,19 @@ var javascript = (options = {}) => {
|
|
|
1240
1356
|
name: "ntnyq/js/core",
|
|
1241
1357
|
languageOptions: {
|
|
1242
1358
|
globals: {
|
|
1243
|
-
...
|
|
1244
|
-
...
|
|
1245
|
-
...
|
|
1359
|
+
...globals2.browser,
|
|
1360
|
+
...globals2.es2021,
|
|
1361
|
+
...globals2.node
|
|
1246
1362
|
},
|
|
1247
1363
|
sourceType: "module"
|
|
1248
1364
|
},
|
|
1249
1365
|
rules: {
|
|
1366
|
+
"require-await": "off",
|
|
1367
|
+
"no-return-assign": "off",
|
|
1368
|
+
"no-useless-escape": "off",
|
|
1369
|
+
"consistent-return": "off",
|
|
1370
|
+
// disabled in favor of `perfectionist/sort-named-imports`
|
|
1371
|
+
"sort-imports": "off",
|
|
1250
1372
|
// standard v17.0.0
|
|
1251
1373
|
"accessor-pairs": ["error", { setWithoutGet: true, enforceForClassMembers: true }],
|
|
1252
1374
|
camelcase: [
|
|
@@ -1394,55 +1516,27 @@ var javascript = (options = {}) => {
|
|
|
1394
1516
|
eqeqeq: ["error", "smart"],
|
|
1395
1517
|
"array-callback-return": "error",
|
|
1396
1518
|
"block-scoped-var": "error",
|
|
1397
|
-
"consistent-return": "off",
|
|
1398
1519
|
"no-alert": "error",
|
|
1399
1520
|
"no-case-declarations": "error",
|
|
1400
1521
|
"no-multi-str": "error",
|
|
1401
1522
|
"no-with": "error",
|
|
1402
1523
|
"no-void": "error",
|
|
1403
|
-
"no-useless-escape": "off",
|
|
1404
1524
|
"vars-on-top": "error",
|
|
1405
|
-
"require-await": "off",
|
|
1406
|
-
"no-return-assign": "off",
|
|
1407
1525
|
"one-var": ["error", "never"],
|
|
1408
1526
|
"no-use-before-define": [
|
|
1409
1527
|
"error",
|
|
1410
1528
|
{
|
|
1411
1529
|
functions: false,
|
|
1412
1530
|
classes: false,
|
|
1413
|
-
variables: true
|
|
1414
|
-
|
|
1415
|
-
],
|
|
1416
|
-
"sort-imports": [
|
|
1417
|
-
"error",
|
|
1418
|
-
{
|
|
1419
|
-
ignoreCase: false,
|
|
1420
|
-
ignoreDeclarationSort: true,
|
|
1421
|
-
ignoreMemberSort: false,
|
|
1422
|
-
memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
|
|
1423
|
-
allowSeparatedGroups: false
|
|
1531
|
+
variables: true,
|
|
1532
|
+
allowNamedExports: false
|
|
1424
1533
|
}
|
|
1425
1534
|
],
|
|
1426
1535
|
// Strict rules
|
|
1427
1536
|
...options.strict ? strictRules : {},
|
|
1428
|
-
// Overrides
|
|
1537
|
+
// Overrides rules
|
|
1429
1538
|
...options.overrides
|
|
1430
1539
|
}
|
|
1431
|
-
},
|
|
1432
|
-
{
|
|
1433
|
-
name: "ntnyq/js/scripts",
|
|
1434
|
-
files: ["**/scripts/*", "**/cli.*"],
|
|
1435
|
-
rules: {
|
|
1436
|
-
"no-console": "off"
|
|
1437
|
-
}
|
|
1438
|
-
},
|
|
1439
|
-
{
|
|
1440
|
-
name: "ntnyq/js/test",
|
|
1441
|
-
files: ["**/*.{test,spec}.js?(x)"],
|
|
1442
|
-
rules: {
|
|
1443
|
-
"no-unused-expressions": "off",
|
|
1444
|
-
"max-lines-per-function": "off"
|
|
1445
|
-
}
|
|
1446
1540
|
}
|
|
1447
1541
|
];
|
|
1448
1542
|
};
|
|
@@ -1465,7 +1559,7 @@ var perfectionist = (options = {}) => [
|
|
|
1465
1559
|
{
|
|
1466
1560
|
name: "ntnyq/perfectionist",
|
|
1467
1561
|
plugins: {
|
|
1468
|
-
perfectionist:
|
|
1562
|
+
perfectionist: default16
|
|
1469
1563
|
},
|
|
1470
1564
|
rules: {
|
|
1471
1565
|
"perfectionist/sort-imports": [
|
|
@@ -1507,8 +1601,8 @@ var perfectionist = (options = {}) => [
|
|
|
1507
1601
|
*/
|
|
1508
1602
|
"unknown"
|
|
1509
1603
|
],
|
|
1510
|
-
order: "asc",
|
|
1511
|
-
type: "natural",
|
|
1604
|
+
order: options.imports?.order || "asc",
|
|
1605
|
+
type: options.imports?.type || "natural",
|
|
1512
1606
|
ignoreCase: true,
|
|
1513
1607
|
internalPattern: ["~/**", "@/**", "#**"],
|
|
1514
1608
|
newlinesBetween: "ignore"
|
|
@@ -1517,13 +1611,30 @@ var perfectionist = (options = {}) => [
|
|
|
1517
1611
|
"perfectionist/sort-exports": [
|
|
1518
1612
|
"error",
|
|
1519
1613
|
{
|
|
1520
|
-
order: "asc",
|
|
1521
|
-
type: "line-length"
|
|
1614
|
+
order: options.exports?.order || "asc",
|
|
1615
|
+
type: options.exports?.type || "line-length"
|
|
1616
|
+
}
|
|
1617
|
+
],
|
|
1618
|
+
"perfectionist/sort-named-exports": [
|
|
1619
|
+
"error",
|
|
1620
|
+
{
|
|
1621
|
+
type: options.namedExports?.type || "alphabetical",
|
|
1622
|
+
order: options.namedExports?.order || "asc",
|
|
1623
|
+
ignoreCase: true,
|
|
1624
|
+
groupKind: "values-first"
|
|
1522
1625
|
}
|
|
1523
1626
|
],
|
|
1524
|
-
"perfectionist/sort-named-
|
|
1525
|
-
|
|
1526
|
-
|
|
1627
|
+
"perfectionist/sort-named-imports": [
|
|
1628
|
+
"error",
|
|
1629
|
+
{
|
|
1630
|
+
type: options.namedImports?.type || "alphabetical",
|
|
1631
|
+
order: options.namedImports?.order || "asc",
|
|
1632
|
+
ignoreCase: true,
|
|
1633
|
+
ignoreAlias: false,
|
|
1634
|
+
groupKind: "values-first"
|
|
1635
|
+
}
|
|
1636
|
+
],
|
|
1637
|
+
// Overrides rules
|
|
1527
1638
|
...options.overrides
|
|
1528
1639
|
}
|
|
1529
1640
|
}
|
|
@@ -1534,21 +1645,25 @@ var unusedImports = (options = {}) => [
|
|
|
1534
1645
|
{
|
|
1535
1646
|
name: "ntnyq/unused-imports",
|
|
1536
1647
|
plugins: {
|
|
1537
|
-
"unused-imports":
|
|
1648
|
+
"unused-imports": default17
|
|
1538
1649
|
},
|
|
1539
1650
|
rules: {
|
|
1540
1651
|
"@typescript-eslint/no-unused-vars": "off",
|
|
1541
1652
|
"unused-imports/no-unused-imports": "error",
|
|
1542
1653
|
"unused-imports/no-unused-vars": [
|
|
1543
|
-
"
|
|
1654
|
+
"error",
|
|
1544
1655
|
{
|
|
1545
1656
|
vars: "all",
|
|
1546
1657
|
varsIgnorePattern: "^_",
|
|
1547
1658
|
args: "after-used",
|
|
1548
|
-
argsIgnorePattern: "^_"
|
|
1659
|
+
argsIgnorePattern: "^_",
|
|
1660
|
+
ignoreRestSiblings: true,
|
|
1661
|
+
destructuredArrayIgnorePattern: "^_",
|
|
1662
|
+
caughtErrors: "all",
|
|
1663
|
+
caughtErrorsIgnorePattern: "^_"
|
|
1549
1664
|
}
|
|
1550
1665
|
],
|
|
1551
|
-
// Overrides
|
|
1666
|
+
// Overrides rules
|
|
1552
1667
|
...options.overrides
|
|
1553
1668
|
}
|
|
1554
1669
|
}
|
|
@@ -1598,7 +1713,7 @@ function getOverrides(options, key) {
|
|
|
1598
1713
|
}
|
|
1599
1714
|
|
|
1600
1715
|
// src/core.ts
|
|
1601
|
-
function
|
|
1716
|
+
function defineESLintConfig(options = {}, userConfigs = []) {
|
|
1602
1717
|
const configs = [];
|
|
1603
1718
|
if (options.gitignore ?? true) {
|
|
1604
1719
|
configs.push(
|
|
@@ -1624,6 +1739,7 @@ function ntnyq(options = {}, userConfigs = []) {
|
|
|
1624
1739
|
if (options.perfectionist ?? true) {
|
|
1625
1740
|
configs.push(
|
|
1626
1741
|
...perfectionist({
|
|
1742
|
+
...resolveSubOptions(options, "perfectionist"),
|
|
1627
1743
|
overrides: getOverrides(options, "perfectionist")
|
|
1628
1744
|
})
|
|
1629
1745
|
);
|
|
@@ -1664,15 +1780,6 @@ function ntnyq(options = {}, userConfigs = []) {
|
|
|
1664
1780
|
})
|
|
1665
1781
|
);
|
|
1666
1782
|
}
|
|
1667
|
-
if (options.sortI18nLocale ?? true) {
|
|
1668
|
-
configs.push(...sortI18nLocale());
|
|
1669
|
-
}
|
|
1670
|
-
if (options.sortTsConfig ?? true) {
|
|
1671
|
-
configs.push(...sortTsConfig());
|
|
1672
|
-
}
|
|
1673
|
-
if (options.sortPackageJson ?? true) {
|
|
1674
|
-
configs.push(...sortPackageJson());
|
|
1675
|
-
}
|
|
1676
1783
|
if (options.yml ?? true) {
|
|
1677
1784
|
configs.push(
|
|
1678
1785
|
...yml({
|
|
@@ -1694,6 +1801,13 @@ function ntnyq(options = {}, userConfigs = []) {
|
|
|
1694
1801
|
})
|
|
1695
1802
|
);
|
|
1696
1803
|
}
|
|
1804
|
+
if (options.sort ?? true) {
|
|
1805
|
+
configs.push(
|
|
1806
|
+
...sort({
|
|
1807
|
+
...resolveSubOptions(options, "sort")
|
|
1808
|
+
})
|
|
1809
|
+
);
|
|
1810
|
+
}
|
|
1697
1811
|
if (options.vue ?? hasVue) {
|
|
1698
1812
|
configs.push(
|
|
1699
1813
|
...vue({
|
|
@@ -1702,10 +1816,13 @@ function ntnyq(options = {}, userConfigs = []) {
|
|
|
1702
1816
|
})
|
|
1703
1817
|
);
|
|
1704
1818
|
}
|
|
1705
|
-
if (options.
|
|
1819
|
+
if (options.test ?? hasVitest) {
|
|
1706
1820
|
configs.push(
|
|
1821
|
+
...test({
|
|
1822
|
+
overrides: getOverrides(options, "test")
|
|
1823
|
+
}),
|
|
1707
1824
|
...vitest({
|
|
1708
|
-
overrides: getOverrides(options, "
|
|
1825
|
+
overrides: getOverrides(options, "test")
|
|
1709
1826
|
})
|
|
1710
1827
|
);
|
|
1711
1828
|
}
|
|
@@ -1730,6 +1847,7 @@ function ntnyq(options = {}, userConfigs = []) {
|
|
|
1730
1847
|
})
|
|
1731
1848
|
);
|
|
1732
1849
|
}
|
|
1850
|
+
const configSpecials = specials();
|
|
1733
1851
|
const configPrettier = options.prettier ?? true ? prettier({
|
|
1734
1852
|
...resolveSubOptions(options, "prettier"),
|
|
1735
1853
|
overrides: getOverrides(options, "prettier")
|
|
@@ -1738,12 +1856,14 @@ function ntnyq(options = {}, userConfigs = []) {
|
|
|
1738
1856
|
composer.append(
|
|
1739
1857
|
...configs,
|
|
1740
1858
|
...toArray(userConfigs),
|
|
1859
|
+
...configSpecials,
|
|
1741
1860
|
...configPrettier
|
|
1742
1861
|
);
|
|
1743
1862
|
return composer;
|
|
1744
1863
|
}
|
|
1745
1864
|
export {
|
|
1746
1865
|
GLOB_ALL_SRC,
|
|
1866
|
+
GLOB_ASTRO,
|
|
1747
1867
|
GLOB_CSS,
|
|
1748
1868
|
GLOB_DIST,
|
|
1749
1869
|
GLOB_DTS,
|
|
@@ -1764,6 +1884,7 @@ export {
|
|
|
1764
1884
|
GLOB_SRC,
|
|
1765
1885
|
GLOB_SRC_EXT,
|
|
1766
1886
|
GLOB_STYLE,
|
|
1887
|
+
GLOB_SVELTE,
|
|
1767
1888
|
GLOB_TEST,
|
|
1768
1889
|
GLOB_TOML,
|
|
1769
1890
|
GLOB_TS,
|
|
@@ -1773,6 +1894,7 @@ export {
|
|
|
1773
1894
|
antfu,
|
|
1774
1895
|
command,
|
|
1775
1896
|
comments,
|
|
1897
|
+
defineESLintConfig,
|
|
1776
1898
|
getOverrides,
|
|
1777
1899
|
gitignore,
|
|
1778
1900
|
hasTypeScript,
|
|
@@ -1795,29 +1917,30 @@ export {
|
|
|
1795
1917
|
parserVue,
|
|
1796
1918
|
parserYaml,
|
|
1797
1919
|
perfectionist,
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1920
|
+
default8 as pluginAntfu,
|
|
1921
|
+
default18 as pluginComments,
|
|
1922
|
+
default13 as pluginImport,
|
|
1923
|
+
default9 as pluginJsdoc,
|
|
1924
|
+
default10 as pluginJsonc,
|
|
1925
|
+
default7 as pluginMarkdown,
|
|
1804
1926
|
default2 as pluginNode,
|
|
1805
|
-
|
|
1806
|
-
|
|
1927
|
+
default6 as pluginNtnyq,
|
|
1928
|
+
default16 as pluginPerfectionist,
|
|
1929
|
+
default15 as pluginPrettier,
|
|
1807
1930
|
pluginRegexp,
|
|
1808
1931
|
default5 as pluginToml,
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1932
|
+
default14 as pluginUnicorn,
|
|
1933
|
+
default11 as pluginUnoCSS,
|
|
1934
|
+
default17 as pluginUnusedImports,
|
|
1935
|
+
default12 as pluginVitest,
|
|
1813
1936
|
default3 as pluginVue,
|
|
1814
1937
|
default4 as pluginYaml,
|
|
1815
1938
|
prettier,
|
|
1816
1939
|
regexp,
|
|
1817
1940
|
resolveSubOptions,
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1941
|
+
sort,
|
|
1942
|
+
specials,
|
|
1943
|
+
test,
|
|
1821
1944
|
toArray,
|
|
1822
1945
|
toml,
|
|
1823
1946
|
tseslint,
|