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