@ntnyq/eslint-config 5.0.0-beta.3 → 5.0.0-beta.5
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 +35 -9
- package/dist/index.d.ts +63 -110
- package/dist/index.js +18 -12
- package/package.json +18 -18
package/README.md
CHANGED
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
[](https://www.npmjs.com/package/@ntnyq/eslint-config)
|
|
8
8
|
[](https://github.com/ntnyq/eslint-config/blob/main/LICENSE)
|
|
9
9
|
|
|
10
|
+
> [!IMPORTANT]
|
|
11
|
+
> Feel free to create and maintain your own fork if you think this is too much opinionated.
|
|
12
|
+
|
|
10
13
|
## Requirement
|
|
11
14
|
|
|
12
15
|
- NodeJS v20.11.0+
|
|
@@ -49,9 +52,30 @@ Highly recommended using **`eslint.config.mjs`** as the config file :
|
|
|
49
52
|
|
|
50
53
|
import { defineESLintConfig } from '@ntnyq/eslint-config'
|
|
51
54
|
|
|
52
|
-
export default defineESLintConfig(
|
|
55
|
+
export default defineESLintConfig(
|
|
53
56
|
// Options here
|
|
54
|
-
|
|
57
|
+
{
|
|
58
|
+
// Enable a config
|
|
59
|
+
svgo: true,
|
|
60
|
+
// Disable a config
|
|
61
|
+
jsdoc: false,
|
|
62
|
+
vue: {
|
|
63
|
+
// Overrides built-in rules
|
|
64
|
+
overrides: {
|
|
65
|
+
'vue/slot-name-casing': 'off',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
// Optional user configs here
|
|
70
|
+
[
|
|
71
|
+
{
|
|
72
|
+
files: ['**/utils/*.ts'],
|
|
73
|
+
rules: {
|
|
74
|
+
'antfu/top-level-function': 'error',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
)
|
|
55
79
|
```
|
|
56
80
|
|
|
57
81
|
Add scripts `lint` in `package.json`:
|
|
@@ -72,6 +96,8 @@ Add scripts `lint` in `package.json`:
|
|
|
72
96
|
|
|
73
97
|
## Prettier config
|
|
74
98
|
|
|
99
|
+
> Feel free to use your own prettier config.
|
|
100
|
+
|
|
75
101
|
Install `prettier` and setup your prettier config:
|
|
76
102
|
|
|
77
103
|
```shell
|
|
@@ -94,12 +120,12 @@ bun add prettier @ntnyq/prettier-config -D
|
|
|
94
120
|
// prettier.config.mjs
|
|
95
121
|
// @ts-check
|
|
96
122
|
|
|
97
|
-
import {
|
|
123
|
+
import { defineConfig } from '@ntnyq/prettier-config'
|
|
98
124
|
|
|
99
125
|
export default defineConfig({
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
126
|
+
// Custom options if needed
|
|
127
|
+
printWidth: 100,
|
|
128
|
+
trailingComma: 'none',
|
|
103
129
|
overrides: [
|
|
104
130
|
{
|
|
105
131
|
files: ['**/*.html'],
|
|
@@ -204,11 +230,8 @@ export interface ConfigOptions {
|
|
|
204
230
|
command?: ConfigCommandOptions
|
|
205
231
|
eslintComments?: ConfigESLintCommentsOptions
|
|
206
232
|
ignores?: ConfigIgnoresOptions
|
|
207
|
-
importX?: ConfigImportXOptions
|
|
208
233
|
javascript?: ConfigJavaScriptOptions
|
|
209
|
-
jsdoc?: ConfigJsdocOptions
|
|
210
234
|
node?: ConfigNodeOptions
|
|
211
|
-
specials?: ConfigSpecialsOptions
|
|
212
235
|
|
|
213
236
|
/**
|
|
214
237
|
* Configs bellow can be disabled
|
|
@@ -218,6 +241,8 @@ export interface ConfigOptions {
|
|
|
218
241
|
depend?: boolean | ConfigDependOptions
|
|
219
242
|
githubAction?: boolean | ConfigGitHubActionOptions
|
|
220
243
|
gitignore?: boolean | ConfigGitIgnoreOptions
|
|
244
|
+
importX?: boolean | ConfigImportXOptions
|
|
245
|
+
jsdoc?: boolean | ConfigJsdocOptions
|
|
221
246
|
jsonc?: boolean | ConfigJsoncOptions
|
|
222
247
|
markdown?: boolean | ConfigMarkdownOptions
|
|
223
248
|
ntnyq?: boolean | ConfigNtnyqOptions
|
|
@@ -226,6 +251,7 @@ export interface ConfigOptions {
|
|
|
226
251
|
prettier?: boolean | ConfigPrettierOptions
|
|
227
252
|
regexp?: boolean | ConfigRegexpOptions
|
|
228
253
|
sort?: boolean | ConfigSortOptions
|
|
254
|
+
specials?: boolean | ConfigSpecialsOptions
|
|
229
255
|
test?: boolean | ConfigTestOptions
|
|
230
256
|
toml?: boolean | ConfigTomlOptions
|
|
231
257
|
typescript?: boolean | ConfigTypeScriptOptions
|
package/dist/index.d.ts
CHANGED
|
@@ -36,12 +36,6 @@ import { Linter } from "eslint";
|
|
|
36
36
|
import { BuiltInParserName, Options as Options$1 } from "prettier";
|
|
37
37
|
|
|
38
38
|
//#region src/types/utils.d.ts
|
|
39
|
-
/**
|
|
40
|
-
* @file Type Utils
|
|
41
|
-
*/
|
|
42
|
-
/**
|
|
43
|
-
* Array or not
|
|
44
|
-
*/
|
|
45
39
|
/**
|
|
46
40
|
* @file Type Utils
|
|
47
41
|
*/
|
|
@@ -61,7 +55,6 @@ type InteropModuleDefault<T> = T extends {
|
|
|
61
55
|
} ? U : T;
|
|
62
56
|
type Pretty<T> = { [P in keyof T]: T[P] } & {};
|
|
63
57
|
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
64
|
-
|
|
65
58
|
//#endregion
|
|
66
59
|
//#region src/configs/vue.d.ts
|
|
67
60
|
/**
|
|
@@ -86,7 +79,6 @@ type ConfigVueOptions = OptionsFiles & OptionsOverrides & OptionsShareable & {
|
|
|
86
79
|
* @returns ESLint configs
|
|
87
80
|
*/
|
|
88
81
|
declare const configVue: (options?: ConfigVueOptions) => TypedConfigItem[];
|
|
89
|
-
|
|
90
82
|
//#endregion
|
|
91
83
|
//#region src/configs/yml.d.ts
|
|
92
84
|
/**
|
|
@@ -107,7 +99,6 @@ type ConfigYmlOptions = OptionsOverrides & OptionsFiles & {
|
|
|
107
99
|
* @returns ESLint configs
|
|
108
100
|
*/
|
|
109
101
|
declare const configYml: (options?: ConfigYmlOptions) => TypedConfigItem[];
|
|
110
|
-
|
|
111
102
|
//#endregion
|
|
112
103
|
//#region src/configs/html.d.ts
|
|
113
104
|
/**
|
|
@@ -123,7 +114,6 @@ type ConfigHtmlOptions = OptionsFiles & OptionsOverrides;
|
|
|
123
114
|
* @returns ESLint configs
|
|
124
115
|
*/
|
|
125
116
|
declare const configHtml: (options?: ConfigHtmlOptions) => Promise<TypedConfigItem[]>;
|
|
126
|
-
|
|
127
117
|
//#endregion
|
|
128
118
|
//#region src/configs/node.d.ts
|
|
129
119
|
/**
|
|
@@ -139,7 +129,6 @@ type ConfigNodeOptions = OptionsOverrides;
|
|
|
139
129
|
* @returns ESLint configs
|
|
140
130
|
*/
|
|
141
131
|
declare const configNode: (options?: ConfigNodeOptions) => TypedConfigItem[];
|
|
142
|
-
|
|
143
132
|
//#endregion
|
|
144
133
|
//#region src/configs/pnpm.d.ts
|
|
145
134
|
/**
|
|
@@ -160,7 +149,6 @@ type ConfigPnpmOptions = {
|
|
|
160
149
|
* @returns ESLint configs
|
|
161
150
|
*/
|
|
162
151
|
declare const configPnpm: (options?: ConfigPnpmOptions) => Promise<TypedConfigItem[]>;
|
|
163
|
-
|
|
164
152
|
//#endregion
|
|
165
153
|
//#region src/configs/sort.d.ts
|
|
166
154
|
/**
|
|
@@ -203,7 +191,6 @@ interface ConfigSortOptions {
|
|
|
203
191
|
* @returns ESLint configs
|
|
204
192
|
*/
|
|
205
193
|
declare const configSort: (options?: ConfigSortOptions) => TypedConfigItem[];
|
|
206
|
-
|
|
207
194
|
//#endregion
|
|
208
195
|
//#region src/configs/svgo.d.ts
|
|
209
196
|
/**
|
|
@@ -219,7 +206,6 @@ type ConfigSVGOOptions = OptionsFiles & OptionsIgnores;
|
|
|
219
206
|
* @returns ESLint configs
|
|
220
207
|
*/
|
|
221
208
|
declare const configSVGO: (options?: ConfigSVGOOptions) => TypedConfigItem[];
|
|
222
|
-
|
|
223
209
|
//#endregion
|
|
224
210
|
//#region src/configs/test.d.ts
|
|
225
211
|
/**
|
|
@@ -246,7 +232,6 @@ type ConfigTestOptions = OptionsFiles & OptionsOverrides & {
|
|
|
246
232
|
* @returns ESLint configs
|
|
247
233
|
*/
|
|
248
234
|
declare const configTest: (options?: ConfigTestOptions) => TypedConfigItem[];
|
|
249
|
-
|
|
250
235
|
//#endregion
|
|
251
236
|
//#region src/configs/toml.d.ts
|
|
252
237
|
/**
|
|
@@ -262,7 +247,6 @@ type ConfigTomlOptions = OptionsOverrides & OptionsFiles;
|
|
|
262
247
|
* @returns ESLint configs
|
|
263
248
|
*/
|
|
264
249
|
declare const configToml: (options?: ConfigTomlOptions) => TypedConfigItem[];
|
|
265
|
-
|
|
266
250
|
//#endregion
|
|
267
251
|
//#region src/configs/antfu.d.ts
|
|
268
252
|
/**
|
|
@@ -278,7 +262,6 @@ type ConfigAntfuOptions = OptionsOverrides;
|
|
|
278
262
|
* @returns ESLint configs
|
|
279
263
|
*/
|
|
280
264
|
declare const configAntfu: (options?: ConfigAntfuOptions) => TypedConfigItem[];
|
|
281
|
-
|
|
282
265
|
//#endregion
|
|
283
266
|
//#region src/configs/astro.d.ts
|
|
284
267
|
/**
|
|
@@ -294,7 +277,6 @@ type ConfigAstroOptions = OptionsFiles & OptionsOverrides & OptionsShareable;
|
|
|
294
277
|
* @returns ESLint configs
|
|
295
278
|
*/
|
|
296
279
|
declare const configAstro: (options?: ConfigAstroOptions) => Promise<TypedConfigItem[]>;
|
|
297
|
-
|
|
298
280
|
//#endregion
|
|
299
281
|
//#region src/configs/jsdoc.d.ts
|
|
300
282
|
/**
|
|
@@ -310,7 +292,6 @@ type ConfigJsdocOptions = Pick<OptionsShareable, 'typescript'> & OptionsOverride
|
|
|
310
292
|
* @returns ESLint configs
|
|
311
293
|
*/
|
|
312
294
|
declare const configJsdoc: (options?: ConfigJsdocOptions) => TypedConfigItem[];
|
|
313
|
-
|
|
314
295
|
//#endregion
|
|
315
296
|
//#region src/configs/jsonc.d.ts
|
|
316
297
|
/**
|
|
@@ -331,7 +312,6 @@ type ConfigJsoncOptions = OptionsOverrides & OptionsFiles & {
|
|
|
331
312
|
* @returns ESLint configs
|
|
332
313
|
*/
|
|
333
314
|
declare const configJsonc: (options?: ConfigJsoncOptions) => TypedConfigItem[];
|
|
334
|
-
|
|
335
315
|
//#endregion
|
|
336
316
|
//#region src/configs/ntnyq.d.ts
|
|
337
317
|
/**
|
|
@@ -347,7 +327,6 @@ type ConfigNtnyqOptions = OptionsOverrides;
|
|
|
347
327
|
* @returns ESLint configs
|
|
348
328
|
*/
|
|
349
329
|
declare const configNtnyq: (options?: ConfigNtnyqOptions) => TypedConfigItem[];
|
|
350
|
-
|
|
351
330
|
//#endregion
|
|
352
331
|
//#region src/configs/pinia.d.ts
|
|
353
332
|
/**
|
|
@@ -363,7 +342,6 @@ type ConfigPiniaOptions = OptionsFiles & OptionsOverrides;
|
|
|
363
342
|
* @returns ESLint configs
|
|
364
343
|
*/
|
|
365
344
|
declare const configPinia: (options?: ConfigPiniaOptions) => TypedConfigItem[];
|
|
366
|
-
|
|
367
345
|
//#endregion
|
|
368
346
|
//#region src/configs/depend.d.ts
|
|
369
347
|
/**
|
|
@@ -391,7 +369,6 @@ type ConfigDependOptions = OptionsFiles & OptionsOverrides & {
|
|
|
391
369
|
* @returns ESLint configs
|
|
392
370
|
*/
|
|
393
371
|
declare const configDepend: (options?: ConfigDependOptions) => TypedConfigItem[];
|
|
394
|
-
|
|
395
372
|
//#endregion
|
|
396
373
|
//#region src/configs/format.d.ts
|
|
397
374
|
/**
|
|
@@ -424,7 +401,6 @@ interface ConfigFormatOptions {
|
|
|
424
401
|
* @returns ESLint configs
|
|
425
402
|
*/
|
|
426
403
|
declare const configFormat: (options?: ConfigFormatOptions) => Promise<TypedConfigItem[]>;
|
|
427
|
-
|
|
428
404
|
//#endregion
|
|
429
405
|
//#region src/configs/regexp.d.ts
|
|
430
406
|
/**
|
|
@@ -447,7 +423,6 @@ type ConfigRegexpOptions = OptionsOverrides & {
|
|
|
447
423
|
* @returns ESLint configs
|
|
448
424
|
*/
|
|
449
425
|
declare const configRegexp: (options?: ConfigRegexpOptions) => TypedConfigItem[];
|
|
450
|
-
|
|
451
426
|
//#endregion
|
|
452
427
|
//#region src/configs/svelte.d.ts
|
|
453
428
|
/**
|
|
@@ -463,7 +438,6 @@ type ConfigSvelteOptions = OptionsFiles & OptionsOverrides & OptionsShareable;
|
|
|
463
438
|
* @returns ESLint configs
|
|
464
439
|
*/
|
|
465
440
|
declare const configSvelte: (options?: ConfigSvelteOptions) => Promise<TypedConfigItem[]>;
|
|
466
|
-
|
|
467
441
|
//#endregion
|
|
468
442
|
//#region src/configs/unocss.d.ts
|
|
469
443
|
/**
|
|
@@ -486,7 +460,6 @@ type ConfigUnoCSSOptions = OptionsOverrides & {
|
|
|
486
460
|
* @returns ESLint configs
|
|
487
461
|
*/
|
|
488
462
|
declare const configUnoCSS: (options?: ConfigUnoCSSOptions) => TypedConfigItem[];
|
|
489
|
-
|
|
490
463
|
//#endregion
|
|
491
464
|
//#region src/configs/command.d.ts
|
|
492
465
|
/**
|
|
@@ -502,7 +475,6 @@ type ConfigCommandOptions = ESLintPluginCommandOptions;
|
|
|
502
475
|
* @returns ESLint configs
|
|
503
476
|
*/
|
|
504
477
|
declare const configCommand: (options?: ConfigCommandOptions) => TypedConfigItem[];
|
|
505
|
-
|
|
506
478
|
//#endregion
|
|
507
479
|
//#region src/configs/ignores.d.ts
|
|
508
480
|
/**
|
|
@@ -518,7 +490,6 @@ type ConfigIgnoresOptions = string[];
|
|
|
518
490
|
* @returns ESLint configs
|
|
519
491
|
*/
|
|
520
492
|
declare const configIgnores: (customIgnores?: ConfigIgnoresOptions) => TypedConfigItem[];
|
|
521
|
-
|
|
522
493
|
//#endregion
|
|
523
494
|
//#region src/configs/importX.d.ts
|
|
524
495
|
/**
|
|
@@ -541,7 +512,6 @@ type ConfigImportXOptions = Pick<OptionsShareable, 'typescript'> & OptionsOverri
|
|
|
541
512
|
* @returns ESLint configs
|
|
542
513
|
*/
|
|
543
514
|
declare const configImportX: (options?: ConfigImportXOptions) => TypedConfigItem[];
|
|
544
|
-
|
|
545
515
|
//#endregion
|
|
546
516
|
//#region src/configs/unicorn.d.ts
|
|
547
517
|
/**
|
|
@@ -557,7 +527,6 @@ type ConfigUnicornOptions = OptionsOverrides;
|
|
|
557
527
|
* @returns ESLint configs
|
|
558
528
|
*/
|
|
559
529
|
declare const configUnicorn: (options?: ConfigUnicornOptions) => TypedConfigItem[];
|
|
560
|
-
|
|
561
530
|
//#endregion
|
|
562
531
|
//#region src/configs/deMorgan.d.ts
|
|
563
532
|
/**
|
|
@@ -573,7 +542,6 @@ type ConfigDeMorganOptions = OptionsOverrides;
|
|
|
573
542
|
* @returns ESLint configs
|
|
574
543
|
*/
|
|
575
544
|
declare const configDeMorgan: (options?: ConfigDeMorganOptions) => TypedConfigItem[];
|
|
576
|
-
|
|
577
545
|
//#endregion
|
|
578
546
|
//#region src/configs/markdown.d.ts
|
|
579
547
|
/**
|
|
@@ -589,7 +557,6 @@ type ConfigMarkdownOptions = OptionsFiles & OptionsOverrides & Pick<OptionsShare
|
|
|
589
557
|
* @returns ESLint configs
|
|
590
558
|
*/
|
|
591
559
|
declare const configMarkdown: (options?: ConfigMarkdownOptions) => TypedConfigItem[];
|
|
592
|
-
|
|
593
560
|
//#endregion
|
|
594
561
|
//#region src/configs/prettier.d.ts
|
|
595
562
|
/**
|
|
@@ -624,7 +591,6 @@ interface ConfigPrettierOptions extends OptionsOverrides {
|
|
|
624
591
|
* @returns ESLint configs
|
|
625
592
|
*/
|
|
626
593
|
declare const configPrettier: (options?: ConfigPrettierOptions) => TypedConfigItem[];
|
|
627
|
-
|
|
628
594
|
//#endregion
|
|
629
595
|
//#region src/configs/specials.d.ts
|
|
630
596
|
/**
|
|
@@ -670,7 +636,6 @@ interface ConfigSpecialsOptions {
|
|
|
670
636
|
* @returns ESLint configs
|
|
671
637
|
*/
|
|
672
638
|
declare const configSpecials: (options?: ConfigSpecialsOptions) => TypedConfigItem[];
|
|
673
|
-
|
|
674
639
|
//#endregion
|
|
675
640
|
//#region src/configs/gitignore.d.ts
|
|
676
641
|
/**
|
|
@@ -693,7 +658,6 @@ type ConfigGitIgnoreOptions = Omit<FlatGitignoreOptions, 'strict'> & {
|
|
|
693
658
|
* @returns ESLint configs
|
|
694
659
|
*/
|
|
695
660
|
declare const configGitIgnore: (options?: ConfigGitIgnoreOptions) => TypedConfigItem[];
|
|
696
|
-
|
|
697
661
|
//#endregion
|
|
698
662
|
//#region src/configs/javascript.d.ts
|
|
699
663
|
/**
|
|
@@ -717,7 +681,6 @@ type ConfigJavaScriptOptions = OptionsOverrides & {
|
|
|
717
681
|
*/
|
|
718
682
|
declare const configJavaScript: (options?: ConfigJavaScriptOptions) => TypedConfigItem[];
|
|
719
683
|
declare const configJSX: () => TypedConfigItem[];
|
|
720
|
-
|
|
721
684
|
//#endregion
|
|
722
685
|
//#region src/configs/typescript.d.ts
|
|
723
686
|
/**
|
|
@@ -760,7 +723,6 @@ type ConfigTypeScriptOptions = OptionsFiles & OptionsOverrides & Pick<OptionsSha
|
|
|
760
723
|
* @returns ESLint configs
|
|
761
724
|
*/
|
|
762
725
|
declare const configTypeScript: (options?: ConfigTypeScriptOptions) => TypedConfigItem[];
|
|
763
|
-
|
|
764
726
|
//#endregion
|
|
765
727
|
//#region src/configs/eslintPlugin.d.ts
|
|
766
728
|
/**
|
|
@@ -776,7 +738,6 @@ type ConfigESLintPluginOptions = OptionsOverrides;
|
|
|
776
738
|
* @returns ESLint configs
|
|
777
739
|
*/
|
|
778
740
|
declare const configESLintPlugin: (options?: ConfigESLintPluginOptions) => Promise<TypedConfigItem[]>;
|
|
779
|
-
|
|
780
741
|
//#endregion
|
|
781
742
|
//#region src/configs/githubAction.d.ts
|
|
782
743
|
/**
|
|
@@ -792,7 +753,6 @@ type ConfigGitHubActionOptions = OptionsFiles & OptionsOverrides;
|
|
|
792
753
|
* @returns ESLint configs
|
|
793
754
|
*/
|
|
794
755
|
declare const configGitHubAction: (options?: ConfigGitHubActionOptions) => TypedConfigItem[];
|
|
795
|
-
|
|
796
756
|
//#endregion
|
|
797
757
|
//#region src/configs/perfectionist.d.ts
|
|
798
758
|
/**
|
|
@@ -862,7 +822,6 @@ type ConfigPerfectionistOptions = OptionsOverrides & {
|
|
|
862
822
|
* @returns ESLint configs
|
|
863
823
|
*/
|
|
864
824
|
declare const configPerfectionist: (options?: ConfigPerfectionistOptions) => TypedConfigItem[];
|
|
865
|
-
|
|
866
825
|
//#endregion
|
|
867
826
|
//#region src/configs/unusedImports.d.ts
|
|
868
827
|
/**
|
|
@@ -878,7 +837,6 @@ type ConfigUnusedImportsOptions = OptionsOverrides;
|
|
|
878
837
|
* @returns ESLint configs
|
|
879
838
|
*/
|
|
880
839
|
declare const configUnusedImports: (options?: ConfigUnusedImportsOptions) => Promise<TypedConfigItem[]>;
|
|
881
|
-
|
|
882
840
|
//#endregion
|
|
883
841
|
//#region src/configs/eslintComments.d.ts
|
|
884
842
|
/**
|
|
@@ -894,7 +852,6 @@ type ConfigESLintCommentsOptions = OptionsOverrides;
|
|
|
894
852
|
* @returns ESLint configs
|
|
895
853
|
*/
|
|
896
854
|
declare const configESLintComments: (options?: ConfigESLintCommentsOptions) => TypedConfigItem[];
|
|
897
|
-
|
|
898
855
|
//#endregion
|
|
899
856
|
//#region src/types/typegen.d.ts
|
|
900
857
|
interface RuleOptions {
|
|
@@ -1783,6 +1740,7 @@ interface RuleOptions {
|
|
|
1783
1740
|
/**
|
|
1784
1741
|
* Require type annotations in certain places
|
|
1785
1742
|
* @see https://typescript-eslint.io/rules/typedef
|
|
1743
|
+
* @deprecated
|
|
1786
1744
|
*/
|
|
1787
1745
|
'@typescript-eslint/typedef'?: Linter.RuleEntry<TypescriptEslintTypedef>;
|
|
1788
1746
|
/**
|
|
@@ -2647,233 +2605,233 @@ interface RuleOptions {
|
|
|
2647
2605
|
'implicit-arrow-linebreak'?: Linter.RuleEntry<ImplicitArrowLinebreak>;
|
|
2648
2606
|
/**
|
|
2649
2607
|
* Enforce or ban the use of inline type-only markers for named imports.
|
|
2650
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2608
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/consistent-type-specifier-style.md
|
|
2651
2609
|
*/
|
|
2652
2610
|
'import-x/consistent-type-specifier-style'?: Linter.RuleEntry<ImportXConsistentTypeSpecifierStyle>;
|
|
2653
2611
|
/**
|
|
2654
2612
|
* Ensure a default export is present, given a default import.
|
|
2655
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2613
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/default.md
|
|
2656
2614
|
*/
|
|
2657
2615
|
'import-x/default'?: Linter.RuleEntry<[]>;
|
|
2658
2616
|
/**
|
|
2659
2617
|
* Enforce a leading comment with the webpackChunkName for dynamic imports.
|
|
2660
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2618
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/dynamic-import-chunkname.md
|
|
2661
2619
|
*/
|
|
2662
2620
|
'import-x/dynamic-import-chunkname'?: Linter.RuleEntry<ImportXDynamicImportChunkname>;
|
|
2663
2621
|
/**
|
|
2664
2622
|
* Forbid any invalid exports, i.e. re-export of the same name.
|
|
2665
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2623
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/export.md
|
|
2666
2624
|
*/
|
|
2667
2625
|
'import-x/export'?: Linter.RuleEntry<[]>;
|
|
2668
2626
|
/**
|
|
2669
2627
|
* Ensure all exports appear after other statements.
|
|
2670
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2628
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/exports-last.md
|
|
2671
2629
|
*/
|
|
2672
2630
|
'import-x/exports-last'?: Linter.RuleEntry<[]>;
|
|
2673
2631
|
/**
|
|
2674
2632
|
* Ensure consistent use of file extension within the import path.
|
|
2675
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2633
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/extensions.md
|
|
2676
2634
|
*/
|
|
2677
2635
|
'import-x/extensions'?: Linter.RuleEntry<ImportXExtensions>;
|
|
2678
2636
|
/**
|
|
2679
2637
|
* Ensure all imports appear before other statements.
|
|
2680
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2638
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/first.md
|
|
2681
2639
|
*/
|
|
2682
2640
|
'import-x/first'?: Linter.RuleEntry<ImportXFirst>;
|
|
2683
2641
|
/**
|
|
2684
2642
|
* Prefer named exports to be grouped together in a single export declaration.
|
|
2685
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2643
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/group-exports.md
|
|
2686
2644
|
*/
|
|
2687
2645
|
'import-x/group-exports'?: Linter.RuleEntry<[]>;
|
|
2688
2646
|
/**
|
|
2689
2647
|
* Replaced by `import-x/first`.
|
|
2690
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2648
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/imports-first.md
|
|
2691
2649
|
* @deprecated
|
|
2692
2650
|
*/
|
|
2693
2651
|
'import-x/imports-first'?: Linter.RuleEntry<ImportXImportsFirst>;
|
|
2694
2652
|
/**
|
|
2695
2653
|
* Enforce the maximum number of dependencies a module can have.
|
|
2696
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2654
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/max-dependencies.md
|
|
2697
2655
|
*/
|
|
2698
2656
|
'import-x/max-dependencies'?: Linter.RuleEntry<ImportXMaxDependencies>;
|
|
2699
2657
|
/**
|
|
2700
2658
|
* Ensure named imports correspond to a named export in the remote file.
|
|
2701
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2659
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/named.md
|
|
2702
2660
|
*/
|
|
2703
2661
|
'import-x/named'?: Linter.RuleEntry<ImportXNamed>;
|
|
2704
2662
|
/**
|
|
2705
2663
|
* Ensure imported namespaces contain dereferenced properties as they are dereferenced.
|
|
2706
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2664
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/namespace.md
|
|
2707
2665
|
*/
|
|
2708
2666
|
'import-x/namespace'?: Linter.RuleEntry<ImportXNamespace>;
|
|
2709
2667
|
/**
|
|
2710
2668
|
* Enforce a newline after import statements.
|
|
2711
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2669
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/newline-after-import.md
|
|
2712
2670
|
*/
|
|
2713
2671
|
'import-x/newline-after-import'?: Linter.RuleEntry<ImportXNewlineAfterImport>;
|
|
2714
2672
|
/**
|
|
2715
2673
|
* Forbid import of modules using absolute paths.
|
|
2716
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2674
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-absolute-path.md
|
|
2717
2675
|
*/
|
|
2718
2676
|
'import-x/no-absolute-path'?: Linter.RuleEntry<ImportXNoAbsolutePath>;
|
|
2719
2677
|
/**
|
|
2720
2678
|
* Forbid AMD `require` and `define` calls.
|
|
2721
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2679
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-amd.md
|
|
2722
2680
|
*/
|
|
2723
2681
|
'import-x/no-amd'?: Linter.RuleEntry<[]>;
|
|
2724
2682
|
/**
|
|
2725
2683
|
* Forbid anonymous values as default exports.
|
|
2726
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2684
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-anonymous-default-export.md
|
|
2727
2685
|
*/
|
|
2728
2686
|
'import-x/no-anonymous-default-export'?: Linter.RuleEntry<ImportXNoAnonymousDefaultExport>;
|
|
2729
2687
|
/**
|
|
2730
2688
|
* Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
|
|
2731
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2689
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-commonjs.md
|
|
2732
2690
|
*/
|
|
2733
2691
|
'import-x/no-commonjs'?: Linter.RuleEntry<ImportXNoCommonjs>;
|
|
2734
2692
|
/**
|
|
2735
2693
|
* Forbid a module from importing a module with a dependency path back to itself.
|
|
2736
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2694
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-cycle.md
|
|
2737
2695
|
*/
|
|
2738
2696
|
'import-x/no-cycle'?: Linter.RuleEntry<ImportXNoCycle>;
|
|
2739
2697
|
/**
|
|
2740
2698
|
* Forbid default exports.
|
|
2741
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2699
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-default-export.md
|
|
2742
2700
|
*/
|
|
2743
2701
|
'import-x/no-default-export'?: Linter.RuleEntry<[]>;
|
|
2744
2702
|
/**
|
|
2745
2703
|
* Forbid imported names marked with `@deprecated` documentation tag.
|
|
2746
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2704
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-deprecated.md
|
|
2747
2705
|
*/
|
|
2748
2706
|
'import-x/no-deprecated'?: Linter.RuleEntry<[]>;
|
|
2749
2707
|
/**
|
|
2750
2708
|
* Forbid repeated import of the same module in multiple places.
|
|
2751
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2709
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-duplicates.md
|
|
2752
2710
|
*/
|
|
2753
2711
|
'import-x/no-duplicates'?: Linter.RuleEntry<ImportXNoDuplicates>;
|
|
2754
2712
|
/**
|
|
2755
2713
|
* Forbid `require()` calls with expressions.
|
|
2756
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2714
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-dynamic-require.md
|
|
2757
2715
|
*/
|
|
2758
2716
|
'import-x/no-dynamic-require'?: Linter.RuleEntry<ImportXNoDynamicRequire>;
|
|
2759
2717
|
/**
|
|
2760
2718
|
* Forbid empty named import blocks.
|
|
2761
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2719
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-empty-named-blocks.md
|
|
2762
2720
|
*/
|
|
2763
2721
|
'import-x/no-empty-named-blocks'?: Linter.RuleEntry<[]>;
|
|
2764
2722
|
/**
|
|
2765
2723
|
* Forbid the use of extraneous packages.
|
|
2766
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2724
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-extraneous-dependencies.md
|
|
2767
2725
|
*/
|
|
2768
2726
|
'import-x/no-extraneous-dependencies'?: Linter.RuleEntry<ImportXNoExtraneousDependencies>;
|
|
2769
2727
|
/**
|
|
2770
2728
|
* Forbid import statements with CommonJS module.exports.
|
|
2771
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2729
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-import-module-exports.md
|
|
2772
2730
|
*/
|
|
2773
2731
|
'import-x/no-import-module-exports'?: Linter.RuleEntry<ImportXNoImportModuleExports>;
|
|
2774
2732
|
/**
|
|
2775
2733
|
* Forbid importing the submodules of other modules.
|
|
2776
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2734
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-internal-modules.md
|
|
2777
2735
|
*/
|
|
2778
2736
|
'import-x/no-internal-modules'?: Linter.RuleEntry<ImportXNoInternalModules>;
|
|
2779
2737
|
/**
|
|
2780
2738
|
* Forbid the use of mutable exports with `var` or `let`.
|
|
2781
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2739
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-mutable-exports.md
|
|
2782
2740
|
*/
|
|
2783
2741
|
'import-x/no-mutable-exports'?: Linter.RuleEntry<[]>;
|
|
2784
2742
|
/**
|
|
2785
2743
|
* Forbid use of exported name as identifier of default export.
|
|
2786
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2744
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-named-as-default.md
|
|
2787
2745
|
*/
|
|
2788
2746
|
'import-x/no-named-as-default'?: Linter.RuleEntry<[]>;
|
|
2789
2747
|
/**
|
|
2790
2748
|
* Forbid use of exported name as property of default export.
|
|
2791
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2749
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-named-as-default-member.md
|
|
2792
2750
|
*/
|
|
2793
2751
|
'import-x/no-named-as-default-member'?: Linter.RuleEntry<[]>;
|
|
2794
2752
|
/**
|
|
2795
2753
|
* Forbid named default exports.
|
|
2796
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2754
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-named-default.md
|
|
2797
2755
|
*/
|
|
2798
2756
|
'import-x/no-named-default'?: Linter.RuleEntry<[]>;
|
|
2799
2757
|
/**
|
|
2800
2758
|
* Forbid named exports.
|
|
2801
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2759
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-named-export.md
|
|
2802
2760
|
*/
|
|
2803
2761
|
'import-x/no-named-export'?: Linter.RuleEntry<[]>;
|
|
2804
2762
|
/**
|
|
2805
2763
|
* Forbid namespace (a.k.a. "wildcard" `*`) imports.
|
|
2806
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2764
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-namespace.md
|
|
2807
2765
|
*/
|
|
2808
2766
|
'import-x/no-namespace'?: Linter.RuleEntry<ImportXNoNamespace>;
|
|
2809
2767
|
/**
|
|
2810
2768
|
* Forbid Node.js builtin modules.
|
|
2811
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2769
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-nodejs-modules.md
|
|
2812
2770
|
*/
|
|
2813
2771
|
'import-x/no-nodejs-modules'?: Linter.RuleEntry<ImportXNoNodejsModules>;
|
|
2814
2772
|
/**
|
|
2815
2773
|
* Forbid importing packages through relative paths.
|
|
2816
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2774
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-relative-packages.md
|
|
2817
2775
|
*/
|
|
2818
2776
|
'import-x/no-relative-packages'?: Linter.RuleEntry<ImportXNoRelativePackages>;
|
|
2819
2777
|
/**
|
|
2820
2778
|
* Forbid importing modules from parent directories.
|
|
2821
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2779
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-relative-parent-imports.md
|
|
2822
2780
|
*/
|
|
2823
2781
|
'import-x/no-relative-parent-imports'?: Linter.RuleEntry<ImportXNoRelativeParentImports>;
|
|
2824
2782
|
/**
|
|
2825
2783
|
* Forbid importing a default export by a different name.
|
|
2826
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2784
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-rename-default.md
|
|
2827
2785
|
*/
|
|
2828
2786
|
'import-x/no-rename-default'?: Linter.RuleEntry<ImportXNoRenameDefault>;
|
|
2829
2787
|
/**
|
|
2830
2788
|
* Enforce which files can be imported in a given folder.
|
|
2831
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2789
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-restricted-paths.md
|
|
2832
2790
|
*/
|
|
2833
2791
|
'import-x/no-restricted-paths'?: Linter.RuleEntry<ImportXNoRestrictedPaths>;
|
|
2834
2792
|
/**
|
|
2835
2793
|
* Forbid a module from importing itself.
|
|
2836
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2794
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-self-import.md
|
|
2837
2795
|
*/
|
|
2838
2796
|
'import-x/no-self-import'?: Linter.RuleEntry<[]>;
|
|
2839
2797
|
/**
|
|
2840
2798
|
* Forbid unassigned imports.
|
|
2841
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2799
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-unassigned-import.md
|
|
2842
2800
|
*/
|
|
2843
2801
|
'import-x/no-unassigned-import'?: Linter.RuleEntry<ImportXNoUnassignedImport>;
|
|
2844
2802
|
/**
|
|
2845
2803
|
* Ensure imports point to a file/module that can be resolved.
|
|
2846
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2804
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-unresolved.md
|
|
2847
2805
|
*/
|
|
2848
2806
|
'import-x/no-unresolved'?: Linter.RuleEntry<ImportXNoUnresolved>;
|
|
2849
2807
|
/**
|
|
2850
2808
|
* Forbid modules without exports, or exports without matching import in another module.
|
|
2851
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2809
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-unused-modules.md
|
|
2852
2810
|
*/
|
|
2853
2811
|
'import-x/no-unused-modules'?: Linter.RuleEntry<ImportXNoUnusedModules>;
|
|
2854
2812
|
/**
|
|
2855
2813
|
* Forbid unnecessary path segments in import and require statements.
|
|
2856
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2814
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-useless-path-segments.md
|
|
2857
2815
|
*/
|
|
2858
2816
|
'import-x/no-useless-path-segments'?: Linter.RuleEntry<ImportXNoUselessPathSegments>;
|
|
2859
2817
|
/**
|
|
2860
2818
|
* Forbid webpack loader syntax in imports.
|
|
2861
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2819
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/no-webpack-loader-syntax.md
|
|
2862
2820
|
*/
|
|
2863
2821
|
'import-x/no-webpack-loader-syntax'?: Linter.RuleEntry<[]>;
|
|
2864
2822
|
/**
|
|
2865
2823
|
* Enforce a convention in module import order.
|
|
2866
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2824
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/order.md
|
|
2867
2825
|
*/
|
|
2868
2826
|
'import-x/order'?: Linter.RuleEntry<ImportXOrder>;
|
|
2869
2827
|
/**
|
|
2870
2828
|
* Prefer a default export if module exports a single name or multiple names.
|
|
2871
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2829
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/prefer-default-export.md
|
|
2872
2830
|
*/
|
|
2873
2831
|
'import-x/prefer-default-export'?: Linter.RuleEntry<ImportXPreferDefaultExport>;
|
|
2874
2832
|
/**
|
|
2875
2833
|
* Forbid potentially ambiguous parse goal (`script` vs. `module`).
|
|
2876
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2834
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.0/docs/rules/unambiguous.md
|
|
2877
2835
|
*/
|
|
2878
2836
|
'import-x/unambiguous'?: Linter.RuleEntry<[]>;
|
|
2879
2837
|
/**
|
|
@@ -9708,6 +9666,7 @@ type _FuncNamesValue = ("always" | "as-needed" | "never");
|
|
|
9708
9666
|
// ----- func-style -----
|
|
9709
9667
|
type FuncStyle = [] | [("declaration" | "expression")] | [("declaration" | "expression"), {
|
|
9710
9668
|
allowArrowFunctions?: boolean;
|
|
9669
|
+
allowTypeAnnotation?: boolean;
|
|
9711
9670
|
overrides?: {
|
|
9712
9671
|
namedExports?: ("declaration" | "expression" | "ignore");
|
|
9713
9672
|
};
|
|
@@ -11506,6 +11465,10 @@ type NoMagicNumbers = [] | [{
|
|
|
11506
11465
|
ignoreArrayIndexes?: boolean;
|
|
11507
11466
|
ignoreDefaultValues?: boolean;
|
|
11508
11467
|
ignoreClassFieldInitialValues?: boolean;
|
|
11468
|
+
ignoreEnums?: boolean;
|
|
11469
|
+
ignoreNumericLiteralTypes?: boolean;
|
|
11470
|
+
ignoreReadonlyClassProperties?: boolean;
|
|
11471
|
+
ignoreTypeIndexes?: boolean;
|
|
11509
11472
|
}];
|
|
11510
11473
|
// ----- no-misleading-character-class -----
|
|
11511
11474
|
type NoMisleadingCharacterClass = [] | [{
|
|
@@ -11645,9 +11608,11 @@ type NoSequences = [] | [{
|
|
|
11645
11608
|
// ----- no-shadow -----
|
|
11646
11609
|
type NoShadow = [] | [{
|
|
11647
11610
|
builtinGlobals?: boolean;
|
|
11648
|
-
hoist?: ("all" | "functions" | "never");
|
|
11611
|
+
hoist?: ("all" | "functions" | "never" | "types" | "functions-and-types");
|
|
11649
11612
|
allow?: string[];
|
|
11650
11613
|
ignoreOnInitialization?: boolean;
|
|
11614
|
+
ignoreTypeValueShadow?: boolean;
|
|
11615
|
+
ignoreFunctionTypeParameterNameValueShadow?: boolean;
|
|
11651
11616
|
}];
|
|
11652
11617
|
// ----- no-shadow-restricted-names -----
|
|
11653
11618
|
type NoShadowRestrictedNames = [] | [{
|
|
@@ -11725,6 +11690,9 @@ type NoUseBeforeDefine = [] | [("nofunc" | {
|
|
|
11725
11690
|
classes?: boolean;
|
|
11726
11691
|
variables?: boolean;
|
|
11727
11692
|
allowNamedExports?: boolean;
|
|
11693
|
+
enums?: boolean;
|
|
11694
|
+
typedefs?: boolean;
|
|
11695
|
+
ignoreTypeReferences?: boolean;
|
|
11728
11696
|
})];
|
|
11729
11697
|
// ----- no-useless-computed-key -----
|
|
11730
11698
|
type NoUselessComputedKey = [] | [{
|
|
@@ -16650,7 +16618,8 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
16650
16618
|
onlyEquality?: boolean;
|
|
16651
16619
|
}];
|
|
16652
16620
|
// Names of all the configs
|
|
16653
|
-
type ConfigNames = 'ntnyq/antfu' | 'ntnyq/astro' | 'ntnyq/command' | 'ntnyq/de-morgan' | 'ntnyq/eslint-comments' | 'ntnyq/depend' | 'ntnyq/depend/package-json' | 'ntnyq/eslint-plugin' | 'ntnyq/format/setup' | 'ntnyq/format/css' | 'ntnyq/format/scss' | 'ntnyq/format/less' | 'ntnyq/format/html' | 'ntnyq/github-action' | 'ntnyq/gitignore' | 'ntnyq/html' | 'ntnyq/ignores' | 'ntnyq/import-x' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/processor' | 'ntnyq/markdown/parser' | 'ntnyq/markdown/disabled' | 'ntnyq/node' | 'ntnyq/ntnyq' | 'ntnyq/pinia' | 'ntnyq/pnpm/package-json' | 'ntnyq/pnpm/pnpm-workspace-yaml' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/perfectionist/common' | 'ntnyq/perfectionist/enums' | 'ntnyq/perfectionist/types' | 'ntnyq/perfectionist/constants' | 'ntnyq/regexp' | 'ntnyq/sort/tsconfig' | 'ntnyq/sort/package-json' | 'ntnyq/sort/i18n-locale/json' | 'ntnyq/sort/i18n-locale/yaml' | 'ntnyq/sort/json-schema' | 'ntnyq/sort/pnpm-workspace' | 'ntnyq/specials/scripts' | 'ntnyq/specials/cli' | 'ntnyq/specials/bin' | 'ntnyq/specials/userscript' | 'ntnyq/specials/config-file' | 'ntnyq/svelte' | 'ntnyq/svgo' | 'ntnyq/test/setup' | 'ntnyq/test/base' | 'ntnyq/test/vitest' | 'ntnyq/toml' | 'ntnyq/ts/setup' | 'ntnyq/ts/parser' | 'ntnyq/ts/rules' | 'ntnyq/ts/types' | 'ntnyq/unused-imports' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'ntnyq/vue/setup' | 'ntnyq/vue/rules' | 'ntnyq/yml';
|
|
16621
|
+
type ConfigNames = 'ntnyq/antfu' | 'ntnyq/astro' | 'ntnyq/command' | 'ntnyq/de-morgan' | 'ntnyq/eslint-comments' | 'ntnyq/depend' | 'ntnyq/depend/package-json' | 'ntnyq/eslint-plugin' | 'ntnyq/format/setup' | 'ntnyq/format/css' | 'ntnyq/format/scss' | 'ntnyq/format/less' | 'ntnyq/format/html' | 'ntnyq/github-action' | 'ntnyq/gitignore' | 'ntnyq/html' | 'ntnyq/ignores' | 'ntnyq/import-x' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/processor' | 'ntnyq/markdown/parser' | 'ntnyq/markdown/disabled' | 'ntnyq/node' | 'ntnyq/ntnyq' | 'ntnyq/pinia' | 'ntnyq/pnpm/package-json' | 'ntnyq/pnpm/pnpm-workspace-yaml' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/perfectionist/common' | 'ntnyq/perfectionist/enums' | 'ntnyq/perfectionist/types' | 'ntnyq/perfectionist/constants' | 'ntnyq/regexp' | 'ntnyq/sort/tsconfig' | 'ntnyq/sort/package-json' | 'ntnyq/sort/i18n-locale/json' | 'ntnyq/sort/i18n-locale/yaml' | 'ntnyq/sort/json-schema' | 'ntnyq/sort/pnpm-workspace' | 'ntnyq/specials/scripts' | 'ntnyq/specials/cli' | 'ntnyq/specials/bin' | 'ntnyq/specials/userscript' | 'ntnyq/specials/config-file' | 'ntnyq/svelte' | 'ntnyq/svgo' | 'ntnyq/test/setup' | 'ntnyq/test/base' | 'ntnyq/test/vitest' | 'ntnyq/toml' | 'ntnyq/ts/setup' | 'ntnyq/ts/parser' | 'ntnyq/ts/rules' | 'ntnyq/ts/types' | 'ntnyq/unused-imports' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'ntnyq/vue/setup' | 'ntnyq/vue/rules' | 'ntnyq/yml';
|
|
16622
|
+
//#endregion
|
|
16654
16623
|
//#region src/types/eslint.d.ts
|
|
16655
16624
|
/**
|
|
16656
16625
|
* ESLint config
|
|
@@ -16691,7 +16660,6 @@ type TypedConfigItem = Omit<Linter.Config<ESLintRulesRecord & RuleOptions>, 'plu
|
|
|
16691
16660
|
*/
|
|
16692
16661
|
plugins?: Record<string, any>;
|
|
16693
16662
|
};
|
|
16694
|
-
|
|
16695
16663
|
//#endregion
|
|
16696
16664
|
//#region src/types/options.d.ts
|
|
16697
16665
|
/**
|
|
@@ -16726,7 +16694,6 @@ interface OptionsShareable {
|
|
|
16726
16694
|
*/
|
|
16727
16695
|
typescript?: boolean;
|
|
16728
16696
|
}
|
|
16729
|
-
|
|
16730
16697
|
//#endregion
|
|
16731
16698
|
//#region src/types/config.d.ts
|
|
16732
16699
|
/**
|
|
@@ -16744,11 +16711,8 @@ interface ConfigOptions {
|
|
|
16744
16711
|
command?: ConfigCommandOptions;
|
|
16745
16712
|
eslintComments?: ConfigESLintCommentsOptions;
|
|
16746
16713
|
ignores?: ConfigIgnoresOptions;
|
|
16747
|
-
importX?: ConfigImportXOptions;
|
|
16748
16714
|
javascript?: ConfigJavaScriptOptions;
|
|
16749
|
-
jsdoc?: ConfigJsdocOptions;
|
|
16750
16715
|
node?: ConfigNodeOptions;
|
|
16751
|
-
specials?: ConfigSpecialsOptions;
|
|
16752
16716
|
/**
|
|
16753
16717
|
* Configs bellow can be disabled
|
|
16754
16718
|
* @pg
|
|
@@ -16761,6 +16725,8 @@ interface ConfigOptions {
|
|
|
16761
16725
|
githubAction?: boolean | ConfigGitHubActionOptions;
|
|
16762
16726
|
gitignore?: boolean | ConfigGitIgnoreOptions;
|
|
16763
16727
|
html?: boolean | ConfigHtmlOptions;
|
|
16728
|
+
importX?: boolean | ConfigImportXOptions;
|
|
16729
|
+
jsdoc?: boolean | ConfigJsdocOptions;
|
|
16764
16730
|
jsonc?: boolean | ConfigJsoncOptions;
|
|
16765
16731
|
markdown?: boolean | ConfigMarkdownOptions;
|
|
16766
16732
|
ntnyq?: boolean | ConfigNtnyqOptions;
|
|
@@ -16770,6 +16736,7 @@ interface ConfigOptions {
|
|
|
16770
16736
|
prettier?: boolean | ConfigPrettierOptions;
|
|
16771
16737
|
regexp?: boolean | ConfigRegexpOptions;
|
|
16772
16738
|
sort?: boolean | ConfigSortOptions;
|
|
16739
|
+
specials?: boolean | ConfigSpecialsOptions;
|
|
16773
16740
|
svelte?: boolean | ConfigSvelteOptions;
|
|
16774
16741
|
svgo?: boolean | ConfigSVGOOptions;
|
|
16775
16742
|
test?: boolean | ConfigTestOptions;
|
|
@@ -16787,7 +16754,6 @@ interface ConfigOptionsInternal {
|
|
|
16787
16754
|
format?: boolean | ConfigFormatOptions;
|
|
16788
16755
|
unusedImports?: boolean | ConfigUnusedImportsOptions;
|
|
16789
16756
|
}
|
|
16790
|
-
|
|
16791
16757
|
//#endregion
|
|
16792
16758
|
//#region src/types/prettier.d.ts
|
|
16793
16759
|
/**
|
|
@@ -16796,14 +16762,12 @@ interface ConfigOptionsInternal {
|
|
|
16796
16762
|
type PrettierOptions = Pick<Options$1, 'arrowParens' | 'bracketSameLine' | 'bracketSpacing' | 'embeddedLanguageFormatting' | 'endOfLine' | 'experimentalOperatorPosition' | 'experimentalTernaries' | 'htmlWhitespaceSensitivity' | 'insertPragma' | 'jsxSingleQuote' | 'objectWrap' | 'plugins' | 'printWidth' | 'proseWrap' | 'quoteProps' | 'rangeEnd' | 'rangeStart' | 'requirePragma' | 'semi' | 'singleAttributePerLine' | 'singleQuote' | 'tabWidth' | 'trailingComma' | 'useTabs' | 'vueIndentScriptAndStyle'> & {
|
|
16797
16763
|
parser?: BuiltInParserName;
|
|
16798
16764
|
};
|
|
16799
|
-
|
|
16800
16765
|
//#endregion
|
|
16801
16766
|
//#region src/core.d.ts
|
|
16802
16767
|
/**
|
|
16803
16768
|
* Config factory
|
|
16804
16769
|
*/
|
|
16805
16770
|
declare function defineESLintConfig(options?: ConfigOptions, ...userConfigs: Awaitable<TypedConfigItem | TypedConfigItem[] | ESLintConfig[]>[]): FlatConfigComposer<TypedConfigItem, ConfigNames>;
|
|
16806
|
-
|
|
16807
16771
|
//#endregion
|
|
16808
16772
|
//#region src/globs.d.ts
|
|
16809
16773
|
/**
|
|
@@ -16851,7 +16815,6 @@ declare const GLOB_NODE_MODULES: string;
|
|
|
16851
16815
|
declare const GLOB_DIST: string;
|
|
16852
16816
|
declare const GLOB_LOCKFILE: string[];
|
|
16853
16817
|
declare const GLOB_EXCLUDE: string[];
|
|
16854
|
-
|
|
16855
16818
|
//#endregion
|
|
16856
16819
|
//#region src/utils/env.d.ts
|
|
16857
16820
|
type ExistChecker = () => boolean;
|
|
@@ -16861,22 +16824,18 @@ declare const hasTypeScript: ExistChecker;
|
|
|
16861
16824
|
declare const hasShadcnVue: ExistChecker;
|
|
16862
16825
|
declare const hasUnoCSS: ExistChecker;
|
|
16863
16826
|
declare const hasVue: ExistChecker;
|
|
16864
|
-
|
|
16865
16827
|
//#endregion
|
|
16866
16828
|
//#region src/utils/getOverrides.d.ts
|
|
16867
16829
|
declare function getOverrides<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): Partial<TypedConfigItem['rules'] & RuleOptions>;
|
|
16868
|
-
|
|
16869
16830
|
//#endregion
|
|
16870
16831
|
//#region src/utils/combineConfigs.d.ts
|
|
16871
16832
|
declare function combineConfigs(...configs: Awaitable<TypedConfigItem | TypedConfigItem[]>[]): Promise<TypedConfigItem[]>;
|
|
16872
|
-
|
|
16873
16833
|
//#endregion
|
|
16874
16834
|
//#region src/utils/ensurePackages.d.ts
|
|
16875
16835
|
/**
|
|
16876
16836
|
* @copyright {@link https://github.com/antfu/eslint-config}
|
|
16877
16837
|
*/
|
|
16878
16838
|
declare function ensurePackages(packages: (string | undefined)[]): Promise<void>;
|
|
16879
|
-
|
|
16880
16839
|
//#endregion
|
|
16881
16840
|
//#region src/utils/interopDefault.d.ts
|
|
16882
16841
|
/**
|
|
@@ -16885,19 +16844,15 @@ declare function ensurePackages(packages: (string | undefined)[]): Promise<void>
|
|
|
16885
16844
|
* @returns The default export
|
|
16886
16845
|
*/
|
|
16887
16846
|
declare function interopDefault<T>(mod: Awaitable<T>): Promise<InteropModuleDefault<T>>;
|
|
16888
|
-
|
|
16889
16847
|
//#endregion
|
|
16890
16848
|
//#region src/utils/resolveSubOptions.d.ts
|
|
16891
16849
|
declare function resolveSubOptions<T extends Record<string, any>, K extends keyof T>(options: T, key: K): Partial<ResolvedOptions<T[K]>>;
|
|
16892
|
-
|
|
16893
16850
|
//#endregion
|
|
16894
16851
|
//#region src/utils/mergePrettierOptions.d.ts
|
|
16895
16852
|
declare function mergePrettierOptions(options?: PrettierOptions, overrides?: PrettierOptions): PrettierOptions;
|
|
16896
|
-
|
|
16897
16853
|
//#endregion
|
|
16898
16854
|
//#region src/utils/isInGitHooksOrRunBySpecifyPackages.d.ts
|
|
16899
16855
|
declare function isInGitHooksOrRunBySpecifyPackages(): boolean;
|
|
16900
|
-
|
|
16901
16856
|
//#endregion
|
|
16902
16857
|
//#region src/constants/prettier.d.ts
|
|
16903
16858
|
/**
|
|
@@ -16906,7 +16861,6 @@ declare function isInGitHooksOrRunBySpecifyPackages(): boolean;
|
|
|
16906
16861
|
* @see {@link https://github.com/ntnyq/configs/blob/main/packages/prettier-config/index.js}
|
|
16907
16862
|
*/
|
|
16908
16863
|
declare const PRETTIER_DEFAULT_OPTIONS: PrettierOptions;
|
|
16909
|
-
|
|
16910
16864
|
//#endregion
|
|
16911
16865
|
//#region src/constants/perfectionist.d.ts
|
|
16912
16866
|
/**
|
|
@@ -16937,6 +16891,5 @@ declare const PERFECTIONIST: Readonly<{
|
|
|
16937
16891
|
sortNamedImportsGroups: string[];
|
|
16938
16892
|
sortObjectsGroups: string[];
|
|
16939
16893
|
}>;
|
|
16940
|
-
|
|
16941
16894
|
//#endregion
|
|
16942
16895
|
export { Arrayable, Awaitable, ConfigAntfuOptions, ConfigAstroOptions, ConfigCommandOptions, ConfigDeMorganOptions, ConfigDependOptions, ConfigESLintCommentsOptions, ConfigESLintPluginOptions, ConfigFormatOptions, ConfigGitHubActionOptions, ConfigGitIgnoreOptions, ConfigHtmlOptions, ConfigIgnoresOptions, ConfigImportXOptions, ConfigJavaScriptOptions, ConfigJsdocOptions, ConfigJsoncOptions, ConfigMarkdownOptions, ConfigNames, ConfigNodeOptions, ConfigNtnyqOptions, ConfigOptions, ConfigOptionsInternal, ConfigPerfectionistOptions, ConfigPiniaOptions, ConfigPnpmOptions, ConfigPrettierOptions, ConfigRegexpOptions, ConfigSVGOOptions, ConfigSortOptions, ConfigSpecialsOptions, ConfigSvelteOptions, ConfigTestOptions, ConfigTomlOptions, ConfigTypeScriptOptions, ConfigUnicornOptions, ConfigUnoCSSOptions, ConfigUnusedImportsOptions, ConfigVueOptions, ConfigYmlOptions, ESLintConfig, ESLintParser, ESLintParserOptions, ESLintProcessor, ESLintRuleSeverity, ESLintRulesRecord, 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_JSON_SCHEMA, 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_PNPM_WORKSPACE_YAML, 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, InteropModuleDefault, OptionsFiles, OptionsIgnores, OptionsOverrides, OptionsShareable, PERFECTIONIST, PRETTIER_DEFAULT_OPTIONS, PerfectionistPartitionByComment, PrettierOptions, Pretty, ResolvedOptions, RuleOptions, TSESLintParserOptions, TypedConfigItem, combineConfigs, configAntfu, configAstro, configCommand, configDeMorgan, configDepend, configESLintComments, configESLintPlugin, configFormat, configGitHubAction, configGitIgnore, configHtml, configIgnores, configImportX, configJSX, configJavaScript, configJsdoc, configJsonc, configMarkdown, configNode, configNtnyq, configPerfectionist, configPinia, configPnpm, configPrettier, configRegexp, configSVGO, configSort, configSpecials, configSvelte, configTest, configToml, configTypeScript, configUnicorn, configUnoCSS, configUnusedImports, configVue, configYml, configsTypeScript, defineESLintConfig, ensurePackages, getOverrides, hasPinia, hasShadcnVue, hasTypeScript, hasUnoCSS, hasVitest, hasVue, interopDefault, isInGitHooksOrRunBySpecifyPackages, mergePrettierOptions, mergeProcessors, parserJsonc, parserPlain, parserToml, parserTypeScript, parserVue, parserYaml, pluginAntfu, pluginComments, pluginDeMorgan, pluginDepend, pluginGitHubAction, pluginImportX, pluginJsdoc, pluginJsonc, pluginMarkdown, pluginNoOnlyTests, pluginNode, pluginNtnyq, pluginPerfectionist, pluginPinia, pluginPrettier, pluginRegexp, pluginSvgo, pluginToml, pluginTypeScript, pluginUnicorn, pluginUnoCSS, pluginVitest, pluginVue, pluginYml, processorPassThrough, processorVueBlocks, resolveSubOptions };
|
package/dist/index.js
CHANGED
|
@@ -267,6 +267,7 @@ const unCategorizedRules = {
|
|
|
267
267
|
]
|
|
268
268
|
}],
|
|
269
269
|
"vue/define-props-declaration": ["error", "type-based"],
|
|
270
|
+
"vue/define-props-destructuring": ["error", { destructure: "never" }],
|
|
270
271
|
"vue/enforce-style-attribute": ["error", { allow: ["scoped", "plain"] }],
|
|
271
272
|
"vue/html-button-has-type": ["error", {
|
|
272
273
|
button: true,
|
|
@@ -995,6 +996,7 @@ const configSort = (options = {}) => {
|
|
|
995
996
|
if (enableSortJsonSchema) configs.push({
|
|
996
997
|
name: "ntnyq/sort/json-schema",
|
|
997
998
|
files: [...GLOB_JSON_SCHEMA],
|
|
999
|
+
ignores: [GLOB_PACKAGE_JSON],
|
|
998
1000
|
rules: {
|
|
999
1001
|
"jsonc/sort-array-values": ["error", {
|
|
1000
1002
|
order: { type: "asc" },
|
|
@@ -1011,6 +1013,7 @@ const configSort = (options = {}) => {
|
|
|
1011
1013
|
"$ref",
|
|
1012
1014
|
"title",
|
|
1013
1015
|
"description",
|
|
1016
|
+
"version",
|
|
1014
1017
|
"type",
|
|
1015
1018
|
"definitions",
|
|
1016
1019
|
"properties",
|
|
@@ -2254,7 +2257,8 @@ const configPrettier = (options = {}) => {
|
|
|
2254
2257
|
"vue/space-infix-ops": "off",
|
|
2255
2258
|
"vue/space-unary-ops": "off",
|
|
2256
2259
|
"vue/template-curly-spacing": "off",
|
|
2257
|
-
|
|
2260
|
+
"arrow-body-style": "off",
|
|
2261
|
+
"prefer-arrow-callback": "off",
|
|
2258
2262
|
"prettier/prettier": options.severity || "warn",
|
|
2259
2263
|
...options.overrides
|
|
2260
2264
|
}
|
|
@@ -2430,7 +2434,7 @@ const configJavaScript = (options = {}) => [{
|
|
|
2430
2434
|
properties: "never"
|
|
2431
2435
|
}],
|
|
2432
2436
|
"constructor-super": "error",
|
|
2433
|
-
curly: ["error", "
|
|
2437
|
+
curly: ["error", "all"],
|
|
2434
2438
|
"default-case-last": "error",
|
|
2435
2439
|
"dot-notation": ["error", { allowKeywords: true }],
|
|
2436
2440
|
eqeqeq: ["error", "smart"],
|
|
@@ -3028,25 +3032,27 @@ const configESLintComments = (options = {}) => [{
|
|
|
3028
3032
|
* Config factory
|
|
3029
3033
|
*/
|
|
3030
3034
|
function defineESLintConfig(options = {}, ...userConfigs) {
|
|
3031
|
-
const { shareable = {}, vue: enableVue = hasVue(), pinia: enablePinia = hasPinia(), test: enableTest = hasVitest(), unocss: enableUnoCSS = hasUnoCSS(), typescript: enableTypeScript = hasTypeScript(), yml: enableYML = true, sort: enableSort = true, toml: enableTOML = true, jsonc: enableJSONC = true, antfu: enableAntfu = true, ntnyq: enableNtnyq = true, depend: enableDepend = true, regexp: enableRegexp = true, unicorn: enableUnicorn = true, deMorgan: enableDeMorgan = true, prettier: enablePrettier = true, markdown: enableMarkdown = true, gitignore: enableGitIgnore = true, githubAction: enableGitHubAction = true, perfectionist: enablePerfectionist = true, pnpm: enablePnpm = false, svgo: enableSVGO = false, html: enableHTML = false, astro: enableAstro = false, svelte: enableSvelte = false, eslintPlugin: enableESLintPlugin = false } = options;
|
|
3035
|
+
const { shareable = {}, vue: enableVue = hasVue(), pinia: enablePinia = hasPinia(), test: enableTest = hasVitest(), unocss: enableUnoCSS = hasUnoCSS(), typescript: enableTypeScript = hasTypeScript(), yml: enableYML = true, sort: enableSort = true, toml: enableTOML = true, jsonc: enableJSONC = true, antfu: enableAntfu = true, ntnyq: enableNtnyq = true, depend: enableDepend = true, regexp: enableRegexp = true, unicorn: enableUnicorn = true, deMorgan: enableDeMorgan = true, prettier: enablePrettier = true, markdown: enableMarkdown = true, gitignore: enableGitIgnore = true, jsdoc: enableJsdoc = true, importX: enableImportX = true, specials: enableSpecials = true, githubAction: enableGitHubAction = true, perfectionist: enablePerfectionist = true, pnpm: enablePnpm = false, svgo: enableSVGO = false, html: enableHTML = false, astro: enableAstro = false, svelte: enableSvelte = false, eslintPlugin: enableESLintPlugin = false } = options;
|
|
3032
3036
|
const configs = [];
|
|
3033
3037
|
const { extraFileExtensions = [] } = shareable;
|
|
3034
3038
|
if (enableVue) extraFileExtensions.push(".vue");
|
|
3035
3039
|
if (enableAstro) extraFileExtensions.push(".astro");
|
|
3036
3040
|
if (enableSvelte) extraFileExtensions.push(".svelte");
|
|
3037
3041
|
if (enableGitIgnore) configs.push(configGitIgnore(resolveSubOptions(options, "gitignore")));
|
|
3038
|
-
configs.push(configIgnores(options.ignores), configJSX(), configNode({ overrides: getOverrides(options, "node") }), configCommand(resolveSubOptions(options, "command")),
|
|
3039
|
-
...resolveSubOptions(options, "
|
|
3042
|
+
configs.push(configIgnores(options.ignores), configJSX(), configNode({ overrides: getOverrides(options, "node") }), configCommand(resolveSubOptions(options, "command")), configESLintComments({ overrides: getOverrides(options, "eslintComments") }), configJavaScript({
|
|
3043
|
+
...resolveSubOptions(options, "javascript"),
|
|
3044
|
+
overrides: getOverrides(options, "javascript")
|
|
3045
|
+
}));
|
|
3046
|
+
if (enableImportX) configImportX({
|
|
3040
3047
|
typescript: !!enableTypeScript,
|
|
3048
|
+
...resolveSubOptions(options, "importX"),
|
|
3041
3049
|
overrides: getOverrides(options, "importX")
|
|
3042
|
-
})
|
|
3050
|
+
});
|
|
3051
|
+
if (enableJsdoc) configJsdoc({
|
|
3043
3052
|
typescript: !!enableTypeScript,
|
|
3044
3053
|
overrides: getOverrides(options, "jsdoc"),
|
|
3045
3054
|
...resolveSubOptions(options, "jsdoc")
|
|
3046
|
-
})
|
|
3047
|
-
...resolveSubOptions(options, "javascript"),
|
|
3048
|
-
overrides: getOverrides(options, "javascript")
|
|
3049
|
-
}));
|
|
3055
|
+
});
|
|
3050
3056
|
if (enablePerfectionist) configs.push(configPerfectionist({
|
|
3051
3057
|
...resolveSubOptions(options, "perfectionist"),
|
|
3052
3058
|
overrides: getOverrides(options, "perfectionist")
|
|
@@ -3123,12 +3129,12 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3123
3129
|
...resolveSubOptions(options, "html"),
|
|
3124
3130
|
overrides: getOverrides(options, "html")
|
|
3125
3131
|
}));
|
|
3126
|
-
|
|
3132
|
+
if (enableSpecials) configs.push(configSpecials(resolveSubOptions(options, "specials")));
|
|
3127
3133
|
const prettierConfigs = enablePrettier ? configPrettier({
|
|
3128
3134
|
...resolveSubOptions(options, "prettier"),
|
|
3129
3135
|
overrides: getOverrides(options, "prettier")
|
|
3130
3136
|
}) : [];
|
|
3131
|
-
const composer = new FlatConfigComposer(...configs, ...userConfigs, ...
|
|
3137
|
+
const composer = new FlatConfigComposer(...configs, ...userConfigs, ...prettierConfigs);
|
|
3132
3138
|
return composer;
|
|
3133
3139
|
}
|
|
3134
3140
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.0-beta.
|
|
4
|
+
"version": "5.0.0-beta.5",
|
|
5
5
|
"description": "An opinionated ESLint config preset of ntnyq",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"eslint",
|
|
@@ -86,23 +86,23 @@
|
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"@antfu/install-pkg": "^1.1.0",
|
|
89
|
-
"@clack/prompts": "^0.
|
|
89
|
+
"@clack/prompts": "^0.11.0",
|
|
90
90
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
91
|
-
"@eslint/js": "^9.
|
|
91
|
+
"@eslint/js": "^9.28.0",
|
|
92
92
|
"@eslint/markdown": "^6.4.0",
|
|
93
|
-
"@unocss/eslint-plugin": "^66.1.
|
|
94
|
-
"@vitest/eslint-plugin": "^1.2.
|
|
93
|
+
"@unocss/eslint-plugin": "^66.1.3",
|
|
94
|
+
"@vitest/eslint-plugin": "^1.2.1",
|
|
95
95
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
96
|
-
"eslint-flat-config-utils": "^2.0
|
|
97
|
-
"eslint-import-resolver-typescript": "^4.
|
|
96
|
+
"eslint-flat-config-utils": "^2.1.0",
|
|
97
|
+
"eslint-import-resolver-typescript": "^4.4.2",
|
|
98
98
|
"eslint-merge-processors": "^2.0.0",
|
|
99
99
|
"eslint-parser-plain": "^0.1.1",
|
|
100
100
|
"eslint-plugin-antfu": "^3.1.1",
|
|
101
|
-
"eslint-plugin-command": "^3.2.
|
|
101
|
+
"eslint-plugin-command": "^3.2.1",
|
|
102
102
|
"eslint-plugin-de-morgan": "^1.2.1",
|
|
103
103
|
"eslint-plugin-depend": "^1.2.0",
|
|
104
104
|
"eslint-plugin-github-action": "^0.0.16",
|
|
105
|
-
"eslint-plugin-import-x": "^4.
|
|
105
|
+
"eslint-plugin-import-x": "^4.15.0",
|
|
106
106
|
"eslint-plugin-jsdoc": "^50.6.17",
|
|
107
107
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
108
108
|
"eslint-plugin-n": "^17.18.0",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"eslint-plugin-ntnyq": "^0.11.0",
|
|
111
111
|
"eslint-plugin-perfectionist": "^4.13.0",
|
|
112
112
|
"eslint-plugin-pinia": "^0.4.1",
|
|
113
|
-
"eslint-plugin-prettier": "^5.4.
|
|
113
|
+
"eslint-plugin-prettier": "^5.4.1",
|
|
114
114
|
"eslint-plugin-regexp": "^2.7.0",
|
|
115
115
|
"eslint-plugin-svgo": "^0.8.0",
|
|
116
116
|
"eslint-plugin-toml": "^0.12.0",
|
|
@@ -118,28 +118,28 @@
|
|
|
118
118
|
"eslint-plugin-vue": "^10.1.0",
|
|
119
119
|
"eslint-plugin-yml": "^1.18.0",
|
|
120
120
|
"eslint-processor-vue-blocks": "^2.0.0",
|
|
121
|
-
"globals": "^16.
|
|
121
|
+
"globals": "^16.2.0",
|
|
122
122
|
"jsonc-eslint-parser": "^2.4.0",
|
|
123
123
|
"local-pkg": "^1.1.1",
|
|
124
124
|
"prettier": "^3.5.3",
|
|
125
125
|
"toml-eslint-parser": "^0.10.0",
|
|
126
|
-
"typescript-eslint": "^8.
|
|
126
|
+
"typescript-eslint": "^8.33.0",
|
|
127
127
|
"vue-eslint-parser": "^10.1.3",
|
|
128
128
|
"yaml-eslint-parser": "^1.3.0"
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
|
-
"@ntnyq/prettier-config": "^2.
|
|
132
|
-
"@types/node": "^22.15.
|
|
131
|
+
"@ntnyq/prettier-config": "^2.2.0",
|
|
132
|
+
"@types/node": "^22.15.29",
|
|
133
133
|
"bumpp": "^10.1.1",
|
|
134
|
-
"eslint": "^9.
|
|
134
|
+
"eslint": "^9.28.0",
|
|
135
135
|
"eslint-plugin-eslint-plugin": "^6.4.0",
|
|
136
136
|
"eslint-typegen": "^2.2.0",
|
|
137
137
|
"husky": "^9.1.7",
|
|
138
138
|
"jiti": "^2.4.2",
|
|
139
139
|
"nano-staged": "^0.8.0",
|
|
140
|
-
"npm-run-all2": "^8.0.
|
|
141
|
-
"tinyglobby": "^0.2.
|
|
142
|
-
"tsdown": "^0.
|
|
140
|
+
"npm-run-all2": "^8.0.4",
|
|
141
|
+
"tinyglobby": "^0.2.14",
|
|
142
|
+
"tsdown": "^0.12.5",
|
|
143
143
|
"tsx": "^4.19.4",
|
|
144
144
|
"typescript": "^5.8.3",
|
|
145
145
|
"uncase": "^0.1.0",
|