@luxass/eslint-config 4.2.5 → 4.2.7

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.
Files changed (144) hide show
  1. package/README.md +35 -54
  2. package/dist/index.cjs +166 -479
  3. package/dist/index.d.cts +733 -12
  4. package/dist/index.d.ts +733 -12
  5. package/dist/{configs/index.cjs → index.js} +300 -542
  6. package/package.json +51 -86
  7. package/dist/chunk-4YBQZLPS.mjs +0 -68
  8. package/dist/chunk-4YT54JFZ.mjs +0 -48
  9. package/dist/chunk-5NK24IKQ.mjs +0 -26
  10. package/dist/chunk-6T7MXPCT.mjs +0 -17
  11. package/dist/chunk-7ODEIBF5.mjs +0 -144
  12. package/dist/chunk-AQRBQAKE.mjs +0 -48
  13. package/dist/chunk-DAJA5AV3.mjs +0 -29
  14. package/dist/chunk-DCOLHWHC.mjs +0 -269
  15. package/dist/chunk-DVQQVCGF.mjs +0 -45
  16. package/dist/chunk-EHWA727G.mjs +0 -69
  17. package/dist/chunk-FNOIGW47.mjs +0 -104
  18. package/dist/chunk-KOXCJL3C.mjs +0 -109
  19. package/dist/chunk-MMSZW2UW.mjs +0 -92
  20. package/dist/chunk-MT5P5EKH.mjs +0 -207
  21. package/dist/chunk-O2BXTQHK.mjs +0 -117
  22. package/dist/chunk-QDSV5ONX.mjs +0 -93
  23. package/dist/chunk-QMGT2Z63.mjs +0 -57
  24. package/dist/chunk-RVSUTDCE.mjs +0 -57
  25. package/dist/chunk-SPD4DGYN.mjs +0 -274
  26. package/dist/chunk-UITQW3RA.mjs +0 -293
  27. package/dist/chunk-V57HXOSW.mjs +0 -81
  28. package/dist/chunk-WDSV2EFG.mjs +0 -7
  29. package/dist/chunk-WOBGA3K2.mjs +0 -63
  30. package/dist/chunk-WSQOWO67.mjs +0 -16
  31. package/dist/chunk-XBASVDU6.mjs +0 -215
  32. package/dist/chunk-XPKGXA67.mjs +0 -183
  33. package/dist/chunk-YGZJUKJC.mjs +0 -0
  34. package/dist/chunk-YO3IYQ2L.mjs +0 -220
  35. package/dist/configs/astro.cjs +0 -179
  36. package/dist/configs/astro.d.cts +0 -11
  37. package/dist/configs/astro.d.ts +0 -11
  38. package/dist/configs/astro.mjs +0 -8
  39. package/dist/configs/comments.cjs +0 -63
  40. package/dist/configs/comments.d.cts +0 -15
  41. package/dist/configs/comments.d.ts +0 -15
  42. package/dist/configs/comments.mjs +0 -6
  43. package/dist/configs/formatters.cjs +0 -274
  44. package/dist/configs/formatters.d.cts +0 -11
  45. package/dist/configs/formatters.d.ts +0 -11
  46. package/dist/configs/formatters.mjs +0 -9
  47. package/dist/configs/ignores.cjs +0 -96
  48. package/dist/configs/ignores.d.cts +0 -15
  49. package/dist/configs/ignores.d.ts +0 -15
  50. package/dist/configs/ignores.mjs +0 -7
  51. package/dist/configs/imports.cjs +0 -104
  52. package/dist/configs/imports.d.cts +0 -23
  53. package/dist/configs/imports.d.ts +0 -23
  54. package/dist/configs/imports.mjs +0 -7
  55. package/dist/configs/index.d.cts +0 -20
  56. package/dist/configs/index.d.ts +0 -20
  57. package/dist/configs/index.mjs +0 -104
  58. package/dist/configs/javascript.cjs +0 -324
  59. package/dist/configs/javascript.d.cts +0 -11
  60. package/dist/configs/javascript.d.ts +0 -11
  61. package/dist/configs/javascript.mjs +0 -7
  62. package/dist/configs/jsdoc.cjs +0 -85
  63. package/dist/configs/jsdoc.d.cts +0 -27
  64. package/dist/configs/jsdoc.d.ts +0 -27
  65. package/dist/configs/jsdoc.mjs +0 -7
  66. package/dist/configs/jsonc.cjs +0 -155
  67. package/dist/configs/jsonc.d.cts +0 -11
  68. package/dist/configs/jsonc.d.ts +0 -11
  69. package/dist/configs/jsonc.mjs +0 -8
  70. package/dist/configs/markdown.cjs +0 -164
  71. package/dist/configs/markdown.d.cts +0 -35
  72. package/dist/configs/markdown.d.ts +0 -35
  73. package/dist/configs/markdown.mjs +0 -8
  74. package/dist/configs/nextjs.cjs +0 -180
  75. package/dist/configs/nextjs.d.cts +0 -11
  76. package/dist/configs/nextjs.d.ts +0 -11
  77. package/dist/configs/nextjs.mjs +0 -8
  78. package/dist/configs/node.cjs +0 -60
  79. package/dist/configs/node.d.cts +0 -15
  80. package/dist/configs/node.d.ts +0 -15
  81. package/dist/configs/node.mjs +0 -6
  82. package/dist/configs/perfectionist.cjs +0 -51
  83. package/dist/configs/perfectionist.d.cts +0 -20
  84. package/dist/configs/perfectionist.d.ts +0 -20
  85. package/dist/configs/perfectionist.mjs +0 -6
  86. package/dist/configs/react.cjs +0 -379
  87. package/dist/configs/react.d.cts +0 -11
  88. package/dist/configs/react.d.ts +0 -11
  89. package/dist/configs/react.mjs +0 -8
  90. package/dist/configs/solid.cjs +0 -360
  91. package/dist/configs/solid.d.cts +0 -11
  92. package/dist/configs/solid.d.ts +0 -11
  93. package/dist/configs/solid.mjs +0 -8
  94. package/dist/configs/sort.cjs +0 -240
  95. package/dist/configs/sort.d.cts +0 -26
  96. package/dist/configs/sort.d.ts +0 -26
  97. package/dist/configs/sort.mjs +0 -8
  98. package/dist/configs/stylistic.cjs +0 -98
  99. package/dist/configs/stylistic.d.cts +0 -11
  100. package/dist/configs/stylistic.d.ts +0 -11
  101. package/dist/configs/stylistic.mjs +0 -9
  102. package/dist/configs/tailwindcss.cjs +0 -148
  103. package/dist/configs/tailwindcss.d.cts +0 -11
  104. package/dist/configs/tailwindcss.d.ts +0 -11
  105. package/dist/configs/tailwindcss.mjs +0 -8
  106. package/dist/configs/test.cjs +0 -206
  107. package/dist/configs/test.d.cts +0 -11
  108. package/dist/configs/test.d.ts +0 -11
  109. package/dist/configs/test.mjs +0 -9
  110. package/dist/configs/toml.cjs +0 -131
  111. package/dist/configs/toml.d.cts +0 -11
  112. package/dist/configs/toml.d.ts +0 -11
  113. package/dist/configs/toml.mjs +0 -8
  114. package/dist/configs/typescript.cjs +0 -291
  115. package/dist/configs/typescript.d.cts +0 -11
  116. package/dist/configs/typescript.d.ts +0 -11
  117. package/dist/configs/typescript.mjs +0 -8
  118. package/dist/configs/unicorn.cjs +0 -91
  119. package/dist/configs/unicorn.d.cts +0 -15
  120. package/dist/configs/unicorn.d.ts +0 -15
  121. package/dist/configs/unicorn.mjs +0 -6
  122. package/dist/configs/unocss.cjs +0 -133
  123. package/dist/configs/unocss.d.cts +0 -11
  124. package/dist/configs/unocss.d.ts +0 -11
  125. package/dist/configs/unocss.mjs +0 -8
  126. package/dist/configs/vue.cjs +0 -293
  127. package/dist/configs/vue.d.cts +0 -11
  128. package/dist/configs/vue.d.ts +0 -11
  129. package/dist/configs/vue.mjs +0 -8
  130. package/dist/configs/yaml.cjs +0 -143
  131. package/dist/configs/yaml.d.cts +0 -11
  132. package/dist/configs/yaml.d.ts +0 -11
  133. package/dist/configs/yaml.mjs +0 -8
  134. package/dist/custom-rules/utils.cjs +0 -31
  135. package/dist/custom-rules/utils.d.cts +0 -6
  136. package/dist/custom-rules/utils.d.ts +0 -6
  137. package/dist/custom-rules/utils.mjs +0 -6
  138. package/dist/globs.cjs +0 -158
  139. package/dist/globs.d.cts +0 -28
  140. package/dist/globs.d.ts +0 -28
  141. package/dist/globs.mjs +0 -56
  142. package/dist/index.mjs +0 -284
  143. package/dist/types-HqEzZfQU.d.cts +0 -668
  144. package/dist/types-HqEzZfQU.d.ts +0 -668
@@ -1,668 +0,0 @@
1
- import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
2
- import { FlatESLintConfigItem, MergeIntersection, RenamePrefix, VitestRules, YmlRules, NRules, Prefix, ReactHooksRules, ReactRules, ImportRules, EslintRules, JsoncRules, VueRules, EslintCommentsRules, RuleConfig } from '@antfu/eslint-define-config';
3
- import { RuleOptions as RuleOptions$1 } from '@eslint-types/jsdoc/types';
4
- import { RuleOptions } from '@eslint-types/typescript-eslint/types';
5
- import { RuleOptions as RuleOptions$2 } from '@eslint-types/unicorn/types';
6
- import { Rules as Rules$1 } from 'eslint-plugin-antfu';
7
- import { StylisticCustomizeOptions, UnprefixedRuleOptions } from '@stylistic/eslint-plugin';
8
- import { Linter } from 'eslint';
9
- import { ParserOptions } from '@typescript-eslint/parser';
10
- import { Options } from 'eslint-processor-vue-blocks';
11
-
12
- type StylisticConfig = Pick<StylisticCustomizeOptions, "jsx" | "indent" | "quotes" | "semi">;
13
- declare const StylisticConfigDefaults: StylisticConfig;
14
- interface StylisticOptions {
15
- /**
16
- * Enable stylistic rules.
17
- *
18
- * @default true
19
- */
20
- stylistic?: boolean | StylisticConfig;
21
- /**
22
- * Overrides for the config.
23
- */
24
- overrides?: FlatConfigItem["rules"];
25
- }
26
- declare function stylistic(options?: StylisticOptions): Promise<FlatConfigItem[]>;
27
-
28
- interface JavaScriptOptions {
29
- /**
30
- * Whether the config is for an editor.
31
- * @default false
32
- */
33
- editor?: boolean;
34
- /**
35
- * Overrides for the config.
36
- */
37
- overrides?: FlatConfigItem["rules"];
38
- }
39
- declare function javascript(options?: JavaScriptOptions): Promise<FlatConfigItem[]>;
40
-
41
- interface JSONOptions {
42
- /**
43
- * Override rules.
44
- */
45
- overrides?: FlatConfigItem["rules"];
46
- /**
47
- * Enable stylistic rules.
48
- *
49
- * @default true
50
- */
51
- stylistic?: boolean | StylisticConfig;
52
- /**
53
- * Glob patterns for JSON files.
54
- *
55
- * @default [GLOB_JSON, GLOB_JSON5, GLOB_JSONC]
56
- * @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts
57
- */
58
- files?: string[];
59
- }
60
- declare function jsonc(options?: JSONOptions): Promise<FlatConfigItem[]>;
61
-
62
- interface TypeScriptOptions {
63
- /**
64
- * Additional extensions for components.
65
- *
66
- * @example ["vue"]
67
- * @default []
68
- */
69
- exts?: string[];
70
- /**
71
- * Additional parser options for TypeScript.
72
- */
73
- parserOptions?: Partial<ParserOptions>;
74
- /**
75
- * When this options is provided, type aware rules will be enabled.
76
- * @see https://typescript-eslint.io/linting/typed-linting/
77
- */
78
- tsconfigPath?: string | string[];
79
- /**
80
- * Glob patterns for TypeScript files.
81
- *
82
- * @default GLOB_SRC
83
- * @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts
84
- */
85
- files?: string[];
86
- /**
87
- * Glob patterns for files that should be type aware.
88
- * @default ['**\/*.{ts,tsx}']
89
- */
90
- typeAwareFileS?: string[];
91
- /**
92
- * Overrides for the config.
93
- */
94
- overrides?: FlatConfigItem["rules"];
95
- }
96
- declare function typescript(options?: TypeScriptOptions): Promise<FlatConfigItem[]>;
97
-
98
- interface VueOptions {
99
- /**
100
- * Override rules.
101
- */
102
- overrides?: FlatConfigItem["rules"];
103
- /**
104
- * Enable stylistic rules.
105
- *
106
- * @default true
107
- */
108
- stylistic?: boolean | StylisticConfig;
109
- /**
110
- * Enable TypeScript support.
111
- *
112
- * @default false
113
- */
114
- typescript?: boolean;
115
- /**
116
- * Create virtual files for Vue SFC blocks to enable linting.
117
- *
118
- * @see https://github.com/antfu/eslint-processor-vue-blocks
119
- * @default true
120
- */
121
- sfcBlocks?: boolean | Options;
122
- /**
123
- * Enable Vue a11y support.
124
- *
125
- * @default false
126
- */
127
- a11y?: boolean;
128
- /**
129
- * Glob patterns for Vue files.
130
- *
131
- * @default GLOB_VUE
132
- * @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts
133
- */
134
- files?: string[];
135
- }
136
- declare function vue(options?: VueOptions): Promise<FlatConfigItem[]>;
137
-
138
- interface YAMLOptions {
139
- /**
140
- * Override rules.
141
- */
142
- overrides?: FlatConfigItem["rules"];
143
- /**
144
- * Enable stylistic rules.
145
- *
146
- * @default true
147
- */
148
- stylistic?: boolean | StylisticConfig;
149
- /**
150
- * Glob patterns for YAML files.
151
- *
152
- * @default GLOB_YAML
153
- * @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts
154
- */
155
- files?: string[];
156
- }
157
- declare function yaml(options?: YAMLOptions): Promise<FlatConfigItem[]>;
158
-
159
- interface TestOptions {
160
- /**
161
- * Disable some rules when eslint is run in an editor.
162
- *
163
- * @default false
164
- */
165
- editor?: boolean;
166
- /**
167
- * Glob patterns for test files.
168
- *
169
- * @default GLOB_TESTS
170
- * @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts
171
- */
172
- files?: string[];
173
- /**
174
- * Override rules for for test files.
175
- */
176
- overrides?: FlatConfigItem["rules"];
177
- }
178
- declare function test(options?: TestOptions): Promise<FlatConfigItem[]>;
179
-
180
- interface UnoCSSOptions {
181
- /**
182
- * Enable strict mode.
183
- *
184
- * @default false
185
- */
186
- strict?: boolean;
187
- /**
188
- * Enable attributify mode.
189
- *
190
- * @default true
191
- */
192
- attributify?: boolean;
193
- /**
194
- * Glob patterns for files that includes unocss classes.
195
- *
196
- * @default GLOB_SRC
197
- * @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts
198
- */
199
- files?: string[];
200
- /**
201
- * Override rules for for files with unocss classes.
202
- */
203
- overrides?: FlatConfigItem["rules"];
204
- }
205
- declare function unocss(options?: UnoCSSOptions): Promise<FlatConfigItem[]>;
206
-
207
- interface NextJSOptions {
208
- /**
209
- * Tell the plugin where the root directory is.
210
- * @see https://nextjs.org/docs/app/building-your-application/configuring/eslint#rootdir
211
- *
212
- * @default true
213
- */
214
- rootDir?: boolean | string;
215
- /**
216
- * Override rules.
217
- */
218
- overrides?: FlatConfigItem["rules"];
219
- /**
220
- * Glob patterns for Next.js files.
221
- *
222
- * @default [GLOB_SRC]
223
- * @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts
224
- */
225
- files?: string[];
226
- }
227
- declare function nextjs(options?: NextJSOptions): Promise<FlatConfigItem[]>;
228
-
229
- interface ReactOptions {
230
- /**
231
- * Override rules.
232
- */
233
- overrides?: FlatConfigItem["rules"];
234
- /**
235
- * Enable TypeScript support.
236
- *
237
- * @default true
238
- */
239
- typescript?: boolean;
240
- /**
241
- * Enable JSX A11y support.
242
- *
243
- * @default false
244
- */
245
- a11y?: boolean;
246
- /**
247
- * Glob patterns for JSX & TSX files.
248
- *
249
- * @default [GLOB_JSX, GLOB_TSX]
250
- * @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts
251
- */
252
- files?: string[];
253
- }
254
- declare function react(options?: ReactOptions): Promise<FlatConfigItem[]>;
255
-
256
- interface AstroOptions {
257
- /**
258
- * Override rules.
259
- */
260
- overrides?: FlatConfigItem["rules"];
261
- /**
262
- * Enable TypeScript support.
263
- *
264
- * @default true
265
- */
266
- typescript?: boolean;
267
- /**
268
- * Enable React A11y support.
269
- *
270
- * @default false
271
- */
272
- a11y?: boolean;
273
- /**
274
- * Glob patterns for Astro files.
275
- *
276
- * @default [GLOB_ASTRO]
277
- * @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts#L27
278
- */
279
- files?: string[];
280
- }
281
- declare function astro(options: AstroOptions): Promise<FlatConfigItem[]>;
282
-
283
- interface TailwindCSSOptions {
284
- /**
285
- * Glob patterns for files that includes tailwind classes.
286
- *
287
- * @default [GLOB_SRC]
288
- * @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts
289
- */
290
- files?: string[];
291
- /**
292
- * Override rules for for files with tailwind classes.
293
- */
294
- overrides?: FlatConfigItem["rules"];
295
- }
296
- declare function tailwindcss(options?: TailwindCSSOptions): Promise<FlatConfigItem[]>;
297
-
298
- /**
299
- * Vendor types from Prettier so we don't rely on the dependency.
300
- */
301
- type VendoredPrettierOptions = Partial<VendoredPrettierOptionsRequired>;
302
- interface VendoredPrettierOptionsRequired {
303
- /**
304
- * Specify the line length that the printer will wrap on.
305
- * @default 120
306
- */
307
- printWidth: number;
308
- /**
309
- * Specify the number of spaces per indentation-level.
310
- */
311
- tabWidth: number;
312
- /**
313
- * Indent lines with tabs instead of spaces
314
- */
315
- useTabs?: boolean;
316
- /**
317
- * Print semicolons at the ends of statements.
318
- */
319
- semi: boolean;
320
- /**
321
- * Use single quotes instead of double quotes.
322
- */
323
- singleQuote: boolean;
324
- /**
325
- * Use single quotes in JSX.
326
- */
327
- jsxSingleQuote: boolean;
328
- /**
329
- * Print trailing commas wherever possible.
330
- */
331
- trailingComma: "none" | "es5" | "all";
332
- /**
333
- * Print spaces between brackets in object literals.
334
- */
335
- bracketSpacing: boolean;
336
- /**
337
- * Put the `>` of a multi-line HTML (HTML, JSX, Vue, Angular) element at the end of the last line instead of being
338
- * alone on the next line (does not apply to self closing elements).
339
- */
340
- bracketSameLine: boolean;
341
- /**
342
- * Put the `>` of a multi-line JSX element at the end of the last line instead of being alone on the next line.
343
- * @deprecated use bracketSameLine instead
344
- */
345
- jsxBracketSameLine: boolean;
346
- /**
347
- * Format only a segment of a file.
348
- */
349
- rangeStart: number;
350
- /**
351
- * Format only a segment of a file.
352
- * @default Number.POSITIVE_INFINITY
353
- */
354
- rangeEnd: number;
355
- /**
356
- * By default, Prettier will wrap markdown text as-is since some services use a linebreak-sensitive renderer.
357
- * In some cases you may want to rely on editor/viewer soft wrapping instead, so this option allows you to opt out.
358
- * @default "preserve"
359
- */
360
- proseWrap: "always" | "never" | "preserve";
361
- /**
362
- * Include parentheses around a sole arrow function parameter.
363
- * @default "always"
364
- */
365
- arrowParens: "avoid" | "always";
366
- /**
367
- * Provide ability to support new languages to prettier.
368
- */
369
- plugins: Array<string | any>;
370
- /**
371
- * How to handle whitespaces in HTML.
372
- * @default "css"
373
- */
374
- htmlWhitespaceSensitivity: "css" | "strict" | "ignore";
375
- /**
376
- * Which end of line characters to apply.
377
- * @default "lf"
378
- */
379
- endOfLine: "auto" | "lf" | "crlf" | "cr";
380
- /**
381
- * Change when properties in objects are quoted.
382
- * @default "as-needed"
383
- */
384
- quoteProps: "as-needed" | "consistent" | "preserve";
385
- /**
386
- * Whether or not to indent the code inside <script> and <style> tags in Vue files.
387
- * @default false
388
- */
389
- vueIndentScriptAndStyle: boolean;
390
- /**
391
- * Enforce single attribute per line in HTML, Vue and JSX.
392
- * @default false
393
- */
394
- singleAttributePerLine: boolean;
395
- }
396
-
397
- interface FormattersOptions {
398
- /**
399
- * Enable formatting support for CSS, Less, Sass, and SCSS.
400
- *
401
- * Currently only support Prettier.
402
- */
403
- css?: "prettier" | boolean;
404
- /**
405
- * Enable formatting support for HTML.
406
- *
407
- * Currently only support Prettier.
408
- */
409
- html?: "prettier" | boolean;
410
- /**
411
- * Enable formatting support for Markdown.
412
- *
413
- * Support both Prettier and dprint.
414
- *
415
- * When set to `true`, it will use Prettier.
416
- */
417
- markdown?: "prettier" | "dprint" | boolean;
418
- /**
419
- * Enable formatting support for GraphQL.
420
- */
421
- graphql?: "prettier" | boolean;
422
- /**
423
- * Custom options for Prettier.
424
- *
425
- * By default it's controlled by our own config.
426
- */
427
- prettierOptions?: VendoredPrettierOptions;
428
- /**
429
- * Custom options for dprint.
430
- *
431
- * By default it's controlled by our own config.
432
- */
433
- dprintOptions?: boolean;
434
- }
435
- declare function formatters(options?: FormattersOptions | true, stylistic?: StylisticConfig): Promise<FlatConfigItem[]>;
436
-
437
- interface TOMLOptions {
438
- /**
439
- * Override rules.
440
- */
441
- overrides?: FlatConfigItem["rules"];
442
- /**
443
- * Enable stylistic rules.
444
- *
445
- * @default true
446
- */
447
- stylistic?: boolean | StylisticConfig;
448
- /**
449
- * Glob patterns for TOML files.
450
- *
451
- * @default [GLOB_TOML]
452
- * @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts
453
- */
454
- files?: string[];
455
- }
456
- declare function toml(options?: TOMLOptions): Promise<FlatConfigItem[]>;
457
-
458
- interface SolidOptions {
459
- /**
460
- * Override rules.
461
- */
462
- overrides?: FlatConfigItem["rules"];
463
- /**
464
- * Enable TypeScript support.
465
- *
466
- * @default true
467
- */
468
- typescript?: boolean;
469
- /**
470
- * Enable JSX A11y support.
471
- *
472
- * @default false
473
- */
474
- a11y?: boolean;
475
- /**
476
- * Glob patterns for JSX & TSX files.
477
- *
478
- * @default [GLOB_JSX, GLOB_TSX]
479
- * @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts
480
- */
481
- files?: string[];
482
- }
483
- declare function solid(options?: SolidOptions): Promise<FlatConfigItem[]>;
484
-
485
- interface NoOnlyTestsOptions {
486
- blocks?: string[];
487
- focus?: string[];
488
- }
489
-
490
- type WrapRuleConfig<T extends {
491
- [key: string]: any;
492
- }> = {
493
- [K in keyof T]: T[K] extends RuleConfig ? T[K] : RuleConfig<T[K]>;
494
- };
495
- type Awaitable<T> = T | Promise<T>;
496
- type Rules = WrapRuleConfig<MergeIntersection<RenamePrefix<RuleOptions, "@typescript-eslint/", "ts/"> & RenamePrefix<VitestRules, "vitest/", "test/"> & RenamePrefix<YmlRules, "yml/", "yaml/"> & RenamePrefix<NRules, "n/", "node/"> & Prefix<UnprefixedRuleOptions, "style/"> & Prefix<Rules$1, "antfu/"> & ReactHooksRules & ReactRules & RuleOptions$1 & ImportRules & EslintRules & JsoncRules & VueRules & RuleOptions$2 & EslintCommentsRules & {
497
- "test/no-only-tests": RuleConfig<[NoOnlyTestsOptions]>;
498
- }>>;
499
- type FlatConfigItem = Omit<FlatESLintConfigItem<Rules, false>, "plugins"> & {
500
- /**
501
- * Custom name of each config item
502
- */
503
- name?: string;
504
- /**
505
- * An object containing a name-value mapping of plugin names to plugin objects. When `files` is specified, these plugins are only available to the matching files.
506
- *
507
- * @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
508
- */
509
- plugins?: Record<string, any>;
510
- };
511
- type UserConfigItem = FlatConfigItem | Linter.FlatConfig;
512
- interface ConfigOptions {
513
- /**
514
- * Enable gitignore support.
515
- *
516
- * Passing an object to configure the options.
517
- *
518
- * @see https://github.com/antfu/eslint-config-flat-gitignore
519
- * @default true
520
- */
521
- gitignore?: FlatGitignoreOptions | boolean;
522
- /**
523
- * Control to disable some rules in editors.
524
- * @default auto-detect based on the process.env
525
- */
526
- editor?: boolean;
527
- /**
528
- * JavaScript options
529
- *
530
- * NOTE: Can't be disabled.
531
- */
532
- javascript?: JavaScriptOptions;
533
- /**
534
- * Enable JSONC support.
535
- *
536
- * @default true
537
- */
538
- jsonc?: boolean | JSONOptions;
539
- /**
540
- * Enable JSX related rules.
541
- *
542
- * Currently only stylistic rules are included.
543
- *
544
- * @default true
545
- */
546
- jsx?: boolean;
547
- /**
548
- * Enable linting for **code snippets** in Markdown.
549
- *
550
- * For formatting Markdown content, enable also `formatters.markdown`.
551
- *
552
- * @default true
553
- */
554
- markdown?: boolean;
555
- /**
556
- * Enable NextJS support.
557
- *
558
- * Requires installing:
559
- * - `@next/eslint-plugin-next`
560
- *
561
- * @default false
562
- *
563
- * Note: By enabling this, the `react` option will be enabled automatically.
564
- */
565
- nextjs?: boolean | NextJSOptions;
566
- /**
567
- * Enable react rules.
568
- *
569
- * Requires installing:
570
- * - `eslint-plugin-react`
571
- * - `eslint-plugin-react-hooks`
572
- * - `eslint-plugin-react-refresh`
573
- *
574
- * @default false
575
- */
576
- react?: boolean | ReactOptions;
577
- /**
578
- * Use external formatters to format files.
579
- *
580
- * Requires installing:
581
- * - `eslint-plugin-format`
582
- *
583
- * When set to `true`, it will enable all formatters.
584
- *
585
- * @default false
586
- */
587
- formatters?: boolean | FormattersOptions;
588
- /**
589
- * Enable stylistic rules.
590
- *
591
- * @default true
592
- */
593
- stylistic?: boolean | StylisticConfig;
594
- /**
595
- * Enable test support.
596
- *
597
- * @default true
598
- */
599
- test?: boolean | TestOptions;
600
- /**
601
- * Enable TypeScript support.
602
- *
603
- * Passing an object to enable TypeScript Language Server support.
604
- *
605
- * @default auto-detect based on the dependencies
606
- */
607
- typescript?: boolean | TypeScriptOptions;
608
- /**
609
- * Enable UnoCSS support.
610
- *
611
- * Requires installing:
612
- * - `@unocss/eslint-plugin`
613
- *
614
- * @default false
615
- */
616
- unocss?: boolean | UnoCSSOptions;
617
- /**
618
- * Enable TailwindCSS support.
619
- *
620
- * Requires installing:
621
- * - `eslint-plugin-tailwindcss`
622
- *
623
- * @default false
624
- */
625
- tailwindcss?: boolean | TailwindCSSOptions;
626
- /**
627
- * Enable Vue support.
628
- *
629
- * @default auto-detect based on the dependencies
630
- */
631
- vue?: boolean | VueOptions;
632
- /**
633
- * Enable Astro support.
634
- *
635
- * @default auto-detect based on the dependencies
636
- */
637
- astro?: boolean | AstroOptions;
638
- /**
639
- * Enable YAML support.
640
- *
641
- * @default true
642
- */
643
- yaml?: boolean | YAMLOptions;
644
- /**
645
- * Enable TOML support.
646
- *
647
- * @default true
648
- */
649
- toml?: boolean | TOMLOptions;
650
- /**
651
- * Additional extensions for components.
652
- *
653
- * @example ["vue"]
654
- * @default []
655
- */
656
- exts?: string[];
657
- /**
658
- * Enable Solid support.
659
- *
660
- * Requires installing:
661
- * - `eslint-plugin-solid`
662
- *
663
- * @default false
664
- */
665
- solid?: boolean | SolidOptions;
666
- }
667
-
668
- export { type AstroOptions as A, type ConfigOptions as C, type FormattersOptions as F, type JavaScriptOptions as J, type NextJSOptions as N, type ReactOptions as R, type StylisticConfig as S, type TypeScriptOptions as T, type UnoCSSOptions as U, type VueOptions as V, type YAMLOptions as Y, jsonc as a, type JSONOptions as b, type StylisticOptions as c, test as d, type TestOptions as e, astro as f, tailwindcss as g, type TailwindCSSOptions as h, formatters as i, javascript as j, toml as k, type TOMLOptions as l, solid as m, nextjs as n, type SolidOptions as o, type FlatConfigItem as p, type Awaitable as q, react as r, stylistic as s, typescript as t, unocss as u, vue as v, type UserConfigItem as w, StylisticConfigDefaults as x, yaml as y };