@luxass/eslint-config 4.2.6 → 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.
- package/README.md +4 -5
- package/dist/index.cjs +145 -446
- package/dist/index.d.cts +733 -12
- package/dist/index.d.ts +733 -12
- package/dist/{configs/index.cjs → index.js} +288 -516
- package/package.json +51 -85
- package/dist/chunk-2IR43M6N.mjs +0 -48
- package/dist/chunk-47ISSTHW.mjs +0 -291
- package/dist/chunk-4YBQZLPS.mjs +0 -68
- package/dist/chunk-4YT54JFZ.mjs +0 -48
- package/dist/chunk-5NK24IKQ.mjs +0 -26
- package/dist/chunk-AJS3TMZE.mjs +0 -63
- package/dist/chunk-C6FE5KXJ.mjs +0 -104
- package/dist/chunk-DAJA5AV3.mjs +0 -29
- package/dist/chunk-DCOLHWHC.mjs +0 -269
- package/dist/chunk-E4RVBKZB.mjs +0 -207
- package/dist/chunk-HZNHG5PB.mjs +0 -45
- package/dist/chunk-KOXCJL3C.mjs +0 -109
- package/dist/chunk-PFCAWBCD.mjs +0 -93
- package/dist/chunk-PFYV2TWZ.mjs +0 -117
- package/dist/chunk-QT6FHTFU.mjs +0 -92
- package/dist/chunk-RDZJT36Z.mjs +0 -57
- package/dist/chunk-RVSUTDCE.mjs +0 -57
- package/dist/chunk-TWAETZPX.mjs +0 -149
- package/dist/chunk-WSQOWO67.mjs +0 -16
- package/dist/chunk-XBASVDU6.mjs +0 -215
- package/dist/chunk-XD3UVRU7.mjs +0 -274
- package/dist/chunk-XGI647GZ.mjs +0 -81
- package/dist/chunk-XMXYE5WC.mjs +0 -183
- package/dist/chunk-YNMFVYL6.mjs +0 -69
- package/dist/chunk-YO3IYQ2L.mjs +0 -220
- package/dist/chunk-YZCJUX6Z.mjs +0 -0
- package/dist/configs/comments.cjs +0 -63
- package/dist/configs/comments.d.cts +0 -15
- package/dist/configs/comments.d.ts +0 -15
- package/dist/configs/comments.mjs +0 -6
- package/dist/configs/css/tailwindcss.cjs +0 -148
- package/dist/configs/css/tailwindcss.d.cts +0 -11
- package/dist/configs/css/tailwindcss.d.ts +0 -11
- package/dist/configs/css/tailwindcss.mjs +0 -8
- package/dist/configs/css/unocss.cjs +0 -133
- package/dist/configs/css/unocss.d.cts +0 -11
- package/dist/configs/css/unocss.d.ts +0 -11
- package/dist/configs/css/unocss.mjs +0 -8
- package/dist/configs/data/json.cjs +0 -155
- package/dist/configs/data/json.d.cts +0 -11
- package/dist/configs/data/json.d.ts +0 -11
- package/dist/configs/data/json.mjs +0 -8
- package/dist/configs/data/toml.cjs +0 -131
- package/dist/configs/data/toml.d.cts +0 -11
- package/dist/configs/data/toml.d.ts +0 -11
- package/dist/configs/data/toml.mjs +0 -8
- package/dist/configs/data/yaml.cjs +0 -143
- package/dist/configs/data/yaml.d.cts +0 -11
- package/dist/configs/data/yaml.d.ts +0 -11
- package/dist/configs/data/yaml.mjs +0 -8
- package/dist/configs/docs/jsdoc.cjs +0 -85
- package/dist/configs/docs/jsdoc.d.cts +0 -27
- package/dist/configs/docs/jsdoc.d.ts +0 -27
- package/dist/configs/docs/jsdoc.mjs +0 -7
- package/dist/configs/docs/markdown.cjs +0 -164
- package/dist/configs/docs/markdown.d.cts +0 -35
- package/dist/configs/docs/markdown.d.ts +0 -35
- package/dist/configs/docs/markdown.mjs +0 -8
- package/dist/configs/formatters.cjs +0 -274
- package/dist/configs/formatters.d.cts +0 -11
- package/dist/configs/formatters.d.ts +0 -11
- package/dist/configs/formatters.mjs +0 -9
- package/dist/configs/frameworks/astro.cjs +0 -179
- package/dist/configs/frameworks/astro.d.cts +0 -11
- package/dist/configs/frameworks/astro.d.ts +0 -11
- package/dist/configs/frameworks/astro.mjs +0 -8
- package/dist/configs/frameworks/nextjs.cjs +0 -180
- package/dist/configs/frameworks/nextjs.d.cts +0 -11
- package/dist/configs/frameworks/nextjs.d.ts +0 -11
- package/dist/configs/frameworks/nextjs.mjs +0 -8
- package/dist/configs/frameworks/react.cjs +0 -377
- package/dist/configs/frameworks/react.d.cts +0 -11
- package/dist/configs/frameworks/react.d.ts +0 -11
- package/dist/configs/frameworks/react.mjs +0 -8
- package/dist/configs/frameworks/solid.cjs +0 -360
- package/dist/configs/frameworks/solid.d.cts +0 -11
- package/dist/configs/frameworks/solid.d.ts +0 -11
- package/dist/configs/frameworks/solid.mjs +0 -8
- package/dist/configs/frameworks/vue.cjs +0 -293
- package/dist/configs/frameworks/vue.d.cts +0 -11
- package/dist/configs/frameworks/vue.d.ts +0 -11
- package/dist/configs/frameworks/vue.mjs +0 -8
- package/dist/configs/ignores.cjs +0 -96
- package/dist/configs/ignores.d.cts +0 -15
- package/dist/configs/ignores.d.ts +0 -15
- package/dist/configs/ignores.mjs +0 -7
- package/dist/configs/imports.cjs +0 -104
- package/dist/configs/imports.d.cts +0 -23
- package/dist/configs/imports.d.ts +0 -23
- package/dist/configs/imports.mjs +0 -7
- package/dist/configs/index.d.cts +0 -19
- package/dist/configs/index.d.ts +0 -19
- package/dist/configs/index.mjs +0 -99
- package/dist/configs/javascript.cjs +0 -324
- package/dist/configs/javascript.d.cts +0 -11
- package/dist/configs/javascript.d.ts +0 -11
- package/dist/configs/javascript.mjs +0 -7
- package/dist/configs/node.cjs +0 -60
- package/dist/configs/node.d.cts +0 -15
- package/dist/configs/node.d.ts +0 -15
- package/dist/configs/node.mjs +0 -6
- package/dist/configs/sort.cjs +0 -240
- package/dist/configs/sort.d.cts +0 -26
- package/dist/configs/sort.d.ts +0 -26
- package/dist/configs/sort.mjs +0 -8
- package/dist/configs/stylistic.cjs +0 -98
- package/dist/configs/stylistic.d.cts +0 -11
- package/dist/configs/stylistic.d.ts +0 -11
- package/dist/configs/stylistic.mjs +0 -9
- package/dist/configs/test.cjs +0 -210
- package/dist/configs/test.d.cts +0 -11
- package/dist/configs/test.d.ts +0 -11
- package/dist/configs/test.mjs +0 -8
- package/dist/configs/typescript.cjs +0 -291
- package/dist/configs/typescript.d.cts +0 -11
- package/dist/configs/typescript.d.ts +0 -11
- package/dist/configs/typescript.mjs +0 -8
- package/dist/configs/unicorn.cjs +0 -91
- package/dist/configs/unicorn.d.cts +0 -15
- package/dist/configs/unicorn.d.ts +0 -15
- package/dist/configs/unicorn.mjs +0 -6
- package/dist/globs.cjs +0 -158
- package/dist/globs.d.cts +0 -28
- package/dist/globs.d.ts +0 -28
- package/dist/globs.mjs +0 -56
- package/dist/index.mjs +0 -278
- package/dist/types-HqEzZfQU.d.cts +0 -668
- package/dist/types-HqEzZfQU.d.ts +0 -668
package/dist/types-HqEzZfQU.d.ts
DELETED
|
@@ -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 };
|