@coderwyd/eslint-config 1.1.0-beta.1 → 1.1.0-beta.3
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 +260 -51
- package/dist/index.cjs +1070 -683
- package/dist/index.d.cts +152 -33
- package/dist/index.d.ts +152 -33
- package/dist/index.js +1080 -715
- package/package.json +23 -12
package/dist/index.d.cts
CHANGED
|
@@ -1,28 +1,92 @@
|
|
|
1
|
-
import { FlatESLintConfigItem } from 'eslint-define-config';
|
|
2
1
|
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
2
|
+
import { ParserOptions } from '@typescript-eslint/parser';
|
|
3
|
+
import * as parser from '@typescript-eslint/parser';
|
|
4
|
+
export { parser as parserTs };
|
|
5
|
+
import { Linter, ESLint } from 'eslint';
|
|
6
|
+
import { LanguageOptions, LinterOptions } from 'eslint-define-config';
|
|
3
7
|
export { default as pluginAntfu } from 'eslint-plugin-antfu';
|
|
4
8
|
export { default as pluginComments } from 'eslint-plugin-eslint-comments';
|
|
5
|
-
|
|
9
|
+
import * as eslintPluginI from 'eslint-plugin-i';
|
|
10
|
+
export { eslintPluginI as pluginImport };
|
|
6
11
|
export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
|
|
7
|
-
|
|
12
|
+
import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
|
|
13
|
+
export { eslintPluginJsonc as pluginJsonc };
|
|
8
14
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
9
15
|
export { default as pluginNode } from 'eslint-plugin-n';
|
|
10
16
|
export { default as pluginStylistic } from '@stylistic/eslint-plugin';
|
|
11
17
|
export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
|
|
12
18
|
export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
13
19
|
export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
|
|
14
|
-
|
|
15
|
-
export {
|
|
20
|
+
import * as eslintPluginYml from 'eslint-plugin-yml';
|
|
21
|
+
export { eslintPluginYml as pluginYaml };
|
|
16
22
|
export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests';
|
|
23
|
+
export { default as pluginVitest } from 'eslint-plugin-vitest';
|
|
24
|
+
export { default as pluginVue } from 'eslint-plugin-vue';
|
|
17
25
|
export { default as pluginReact } from 'eslint-plugin-react';
|
|
18
26
|
export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
|
|
19
27
|
export { default as pluginAstro } from 'eslint-plugin-astro';
|
|
20
|
-
export { default as parserTs } from '@typescript-eslint/parser';
|
|
21
28
|
export { default as parserVue } from 'vue-eslint-parser';
|
|
22
|
-
export { default as
|
|
29
|
+
export { default as parserYaml } from 'yaml-eslint-parser';
|
|
23
30
|
export { default as parserJsonc } from 'jsonc-eslint-parser';
|
|
24
31
|
export { default as parserAstro } from 'astro-eslint-parser';
|
|
25
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Flat ESLint Configuration.
|
|
35
|
+
*
|
|
36
|
+
* @see [Configuration Files (New)](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new)
|
|
37
|
+
*/
|
|
38
|
+
interface FlatESLintConfigItem {
|
|
39
|
+
/**
|
|
40
|
+
* The name of the configuration object.
|
|
41
|
+
*/
|
|
42
|
+
name?: string;
|
|
43
|
+
/**
|
|
44
|
+
* An array of glob patterns indicating the files that the configuration object should apply to. If not specified, the configuration object applies to all files.
|
|
45
|
+
*
|
|
46
|
+
* @see [Ignore Patterns](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#excluding-files-with-ignores)
|
|
47
|
+
*/
|
|
48
|
+
files?: string[];
|
|
49
|
+
/**
|
|
50
|
+
* An array of glob patterns indicating the files that the configuration object should not apply to. If not specified, the configuration object applies to all files matched by files.
|
|
51
|
+
*
|
|
52
|
+
* @see [Ignore Patterns](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#excluding-files-with-ignores)
|
|
53
|
+
*/
|
|
54
|
+
ignores?: string[];
|
|
55
|
+
/**
|
|
56
|
+
* An object containing settings related to how JavaScript is configured for linting.
|
|
57
|
+
*
|
|
58
|
+
* @see [Configuring language options](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#configuring-language-options)
|
|
59
|
+
*/
|
|
60
|
+
languageOptions?: LanguageOptions;
|
|
61
|
+
/**
|
|
62
|
+
* An object containing settings related to the linting process.
|
|
63
|
+
*/
|
|
64
|
+
linterOptions?: LinterOptions;
|
|
65
|
+
/**
|
|
66
|
+
* Either an object containing `preprocess()` and `postprocess()` methods or a string indicating the name of a processor inside of a plugin (i.e., `"pluginName/processorName"`).
|
|
67
|
+
*
|
|
68
|
+
* @see [Using processors](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-processors)
|
|
69
|
+
*/
|
|
70
|
+
processor?: string | Linter.Processor;
|
|
71
|
+
/**
|
|
72
|
+
* 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.
|
|
73
|
+
*
|
|
74
|
+
* @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
|
|
75
|
+
*/
|
|
76
|
+
plugins?: Record<string, ESLint.Plugin>;
|
|
77
|
+
/**
|
|
78
|
+
* An object containing the configured rules. When `files` or `ignores` are specified, these rule configurations are only available to the matching files.
|
|
79
|
+
*
|
|
80
|
+
* @see [Configuring rules](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#configuring-rules)
|
|
81
|
+
*/
|
|
82
|
+
rules?: Record<string, Linter.RuleLevel | Linter.RuleLevelAndOptions>;
|
|
83
|
+
/**
|
|
84
|
+
* An object containing name-value pairs of information that should be available to all rules.
|
|
85
|
+
*
|
|
86
|
+
* @see [Configuring shared settings](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#configuring-shared-settings)
|
|
87
|
+
*/
|
|
88
|
+
settings?: Record<string, any>;
|
|
89
|
+
}
|
|
26
90
|
interface OptionsComponentExts {
|
|
27
91
|
/**
|
|
28
92
|
* Additional extensions for components.
|
|
@@ -32,17 +96,36 @@ interface OptionsComponentExts {
|
|
|
32
96
|
*/
|
|
33
97
|
componentExts?: string[];
|
|
34
98
|
}
|
|
35
|
-
interface
|
|
36
|
-
|
|
37
|
-
|
|
99
|
+
interface OptionsTypeScriptParserOptions {
|
|
100
|
+
/**
|
|
101
|
+
* Additional parser options for TypeScript.
|
|
102
|
+
*/
|
|
103
|
+
parserOptions?: Partial<ParserOptions>;
|
|
104
|
+
}
|
|
105
|
+
interface OptionsTypeScriptWithTypes {
|
|
106
|
+
/**
|
|
107
|
+
* When this options is provided, type aware rules will be enabled.
|
|
108
|
+
* @see https://typescript-eslint.io/linting/typed-linting/
|
|
109
|
+
*/
|
|
110
|
+
tsconfigPath?: string;
|
|
38
111
|
}
|
|
39
112
|
interface OptionsHasTypeScript {
|
|
40
113
|
typescript?: boolean;
|
|
41
114
|
}
|
|
115
|
+
interface OptionsStylistic {
|
|
116
|
+
stylistic?: boolean | StylisticConfig;
|
|
117
|
+
}
|
|
118
|
+
interface StylisticConfig {
|
|
119
|
+
indent?: number | 'tab';
|
|
120
|
+
quotes?: 'single' | 'double';
|
|
121
|
+
}
|
|
122
|
+
interface OptionsOverrides {
|
|
123
|
+
overrides?: FlatESLintConfigItem['rules'];
|
|
124
|
+
}
|
|
42
125
|
interface OptionsIsInEditor {
|
|
43
126
|
isInEditor?: boolean;
|
|
44
127
|
}
|
|
45
|
-
interface OptionsConfig {
|
|
128
|
+
interface OptionsConfig extends OptionsComponentExts {
|
|
46
129
|
/**
|
|
47
130
|
* Enable gitignore support.
|
|
48
131
|
*
|
|
@@ -59,7 +142,7 @@ interface OptionsConfig {
|
|
|
59
142
|
*
|
|
60
143
|
* @default auto-detect based on the dependencies
|
|
61
144
|
*/
|
|
62
|
-
typescript?: boolean |
|
|
145
|
+
typescript?: boolean | OptionsTypeScriptWithTypes;
|
|
63
146
|
/**
|
|
64
147
|
* Enable test support.
|
|
65
148
|
*
|
|
@@ -107,12 +190,26 @@ interface OptionsConfig {
|
|
|
107
190
|
*
|
|
108
191
|
* @default true
|
|
109
192
|
*/
|
|
110
|
-
stylistic?: boolean;
|
|
193
|
+
stylistic?: boolean | StylisticConfig;
|
|
111
194
|
/**
|
|
112
195
|
* Control to disable some rules in editors.
|
|
113
196
|
* @default auto-detect based on the process.env
|
|
114
197
|
*/
|
|
115
198
|
isInEditor?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Provide overrides for rules for each integration.
|
|
201
|
+
*/
|
|
202
|
+
overrides?: {
|
|
203
|
+
javascript?: FlatESLintConfigItem['rules'];
|
|
204
|
+
typescript?: FlatESLintConfigItem['rules'];
|
|
205
|
+
test?: FlatESLintConfigItem['rules'];
|
|
206
|
+
vue?: FlatESLintConfigItem['rules'];
|
|
207
|
+
react?: FlatESLintConfigItem['rules'];
|
|
208
|
+
astro?: FlatESLintConfigItem['rules'];
|
|
209
|
+
jsonc?: FlatESLintConfigItem['rules'];
|
|
210
|
+
markdown?: FlatESLintConfigItem['rules'];
|
|
211
|
+
yaml?: FlatESLintConfigItem['rules'];
|
|
212
|
+
};
|
|
116
213
|
}
|
|
117
214
|
|
|
118
215
|
/**
|
|
@@ -120,52 +217,51 @@ interface OptionsConfig {
|
|
|
120
217
|
*/
|
|
121
218
|
declare function coderwyd(options?: OptionsConfig & FlatESLintConfigItem, ...userConfigs: (FlatESLintConfigItem | FlatESLintConfigItem[])[]): FlatESLintConfigItem[];
|
|
122
219
|
|
|
123
|
-
declare
|
|
220
|
+
declare function comments(): FlatESLintConfigItem[];
|
|
124
221
|
|
|
125
|
-
declare
|
|
222
|
+
declare function ignores(): FlatESLintConfigItem[];
|
|
126
223
|
|
|
127
|
-
declare
|
|
224
|
+
declare function imports(options?: OptionsStylistic): FlatESLintConfigItem[];
|
|
128
225
|
|
|
129
|
-
declare function javascript(options?: OptionsIsInEditor): FlatESLintConfigItem[];
|
|
226
|
+
declare function javascript(options?: OptionsIsInEditor & OptionsOverrides): FlatESLintConfigItem[];
|
|
130
227
|
|
|
131
|
-
declare
|
|
228
|
+
declare function jsdoc(options?: OptionsStylistic): FlatESLintConfigItem[];
|
|
132
229
|
|
|
133
|
-
declare
|
|
230
|
+
declare function jsonc(options?: OptionsStylistic & OptionsOverrides): FlatESLintConfigItem[];
|
|
134
231
|
|
|
135
|
-
declare function markdown(options?: OptionsComponentExts): FlatESLintConfigItem[];
|
|
232
|
+
declare function markdown(options?: OptionsComponentExts & OptionsOverrides): FlatESLintConfigItem[];
|
|
136
233
|
|
|
137
|
-
declare
|
|
234
|
+
declare function node(): FlatESLintConfigItem[];
|
|
138
235
|
|
|
139
236
|
/**
|
|
140
237
|
* Sort package.json
|
|
141
238
|
*
|
|
142
239
|
* Requires `jsonc` config
|
|
143
240
|
*/
|
|
144
|
-
declare
|
|
241
|
+
declare function sortPackageJson(): FlatESLintConfigItem[];
|
|
145
242
|
/**
|
|
146
243
|
* Sort tsconfig.json
|
|
147
244
|
*
|
|
148
245
|
* Requires `jsonc` config
|
|
149
246
|
*/
|
|
150
|
-
declare
|
|
247
|
+
declare function sortTsconfig(): FlatESLintConfigItem[];
|
|
151
248
|
|
|
152
|
-
declare
|
|
249
|
+
declare function stylistic(options?: StylisticConfig): FlatESLintConfigItem[];
|
|
153
250
|
|
|
154
|
-
declare function typescript(options?: OptionsComponentExts): FlatESLintConfigItem[];
|
|
155
|
-
declare function typescriptWithLanguageServer(options: OptionsTypeScriptWithLanguageServer & OptionsComponentExts): FlatESLintConfigItem[];
|
|
251
|
+
declare function typescript(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions): FlatESLintConfigItem[];
|
|
156
252
|
|
|
157
|
-
declare
|
|
253
|
+
declare function unicorn(): FlatESLintConfigItem[];
|
|
158
254
|
|
|
159
255
|
declare function getVueVersion(): number;
|
|
160
|
-
declare function vue(options?: OptionsHasTypeScript): FlatESLintConfigItem[];
|
|
256
|
+
declare function vue(options?: OptionsHasTypeScript & OptionsOverrides & OptionsStylistic): FlatESLintConfigItem[];
|
|
161
257
|
|
|
162
|
-
declare
|
|
258
|
+
declare function yaml(options?: OptionsOverrides & OptionsStylistic): FlatESLintConfigItem[];
|
|
163
259
|
|
|
164
|
-
declare function test(options?: OptionsIsInEditor): FlatESLintConfigItem[];
|
|
260
|
+
declare function test(options?: OptionsIsInEditor & OptionsOverrides): FlatESLintConfigItem[];
|
|
165
261
|
|
|
166
|
-
declare function react(options?: OptionsHasTypeScript): FlatESLintConfigItem[];
|
|
262
|
+
declare function react(options?: OptionsHasTypeScript & OptionsOverrides & OptionsStylistic): FlatESLintConfigItem[];
|
|
167
263
|
|
|
168
|
-
declare function astro(options?: OptionsHasTypeScript): FlatESLintConfigItem[];
|
|
264
|
+
declare function astro(options?: OptionsHasTypeScript & OptionsOverrides): FlatESLintConfigItem[];
|
|
169
265
|
|
|
170
266
|
/**
|
|
171
267
|
* Combine array and non-array configs into a single array.
|
|
@@ -175,4 +271,27 @@ declare function renameRules(rules: Record<string, any>, from: string, to: strin
|
|
|
175
271
|
[k: string]: any;
|
|
176
272
|
};
|
|
177
273
|
|
|
178
|
-
|
|
274
|
+
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
275
|
+
declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
276
|
+
declare const GLOB_JS = "**/*.?([cm])js";
|
|
277
|
+
declare const GLOB_JSX = "**/*.?([cm])jsx";
|
|
278
|
+
declare const GLOB_TS = "**/*.?([cm])ts";
|
|
279
|
+
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
280
|
+
declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
281
|
+
declare const GLOB_CSS = "**/*.css";
|
|
282
|
+
declare const GLOB_LESS = "**/*.less";
|
|
283
|
+
declare const GLOB_SCSS = "**/*.scss";
|
|
284
|
+
declare const GLOB_JSON = "**/*.json";
|
|
285
|
+
declare const GLOB_JSON5 = "**/*.json5";
|
|
286
|
+
declare const GLOB_JSONC = "**/*.jsonc";
|
|
287
|
+
declare const GLOB_MARKDOWN = "**/*.md";
|
|
288
|
+
declare const GLOB_VUE = "**/*.vue";
|
|
289
|
+
declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
290
|
+
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
291
|
+
declare const GLOB_ASTRO = "**/*.astro";
|
|
292
|
+
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
293
|
+
declare const GLOB_TESTS: string[];
|
|
294
|
+
declare const GLOB_ALL_SRC: string[];
|
|
295
|
+
declare const GLOB_EXCLUDE: string[];
|
|
296
|
+
|
|
297
|
+
export { FlatESLintConfigItem, GLOB_ALL_SRC, 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_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, StylisticConfig, astro, coderwyd, combine, comments, coderwyd as default, getVueVersion, ignores, imports, javascript, jsdoc, jsonc, markdown, node, react, renameRules, sortPackageJson, sortTsconfig, stylistic, test, typescript, unicorn, vue, yaml };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,92 @@
|
|
|
1
|
-
import { FlatESLintConfigItem } from 'eslint-define-config';
|
|
2
1
|
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
2
|
+
import { ParserOptions } from '@typescript-eslint/parser';
|
|
3
|
+
import * as parser from '@typescript-eslint/parser';
|
|
4
|
+
export { parser as parserTs };
|
|
5
|
+
import { Linter, ESLint } from 'eslint';
|
|
6
|
+
import { LanguageOptions, LinterOptions } from 'eslint-define-config';
|
|
3
7
|
export { default as pluginAntfu } from 'eslint-plugin-antfu';
|
|
4
8
|
export { default as pluginComments } from 'eslint-plugin-eslint-comments';
|
|
5
|
-
|
|
9
|
+
import * as eslintPluginI from 'eslint-plugin-i';
|
|
10
|
+
export { eslintPluginI as pluginImport };
|
|
6
11
|
export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
|
|
7
|
-
|
|
12
|
+
import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
|
|
13
|
+
export { eslintPluginJsonc as pluginJsonc };
|
|
8
14
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
9
15
|
export { default as pluginNode } from 'eslint-plugin-n';
|
|
10
16
|
export { default as pluginStylistic } from '@stylistic/eslint-plugin';
|
|
11
17
|
export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
|
|
12
18
|
export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
13
19
|
export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
|
|
14
|
-
|
|
15
|
-
export {
|
|
20
|
+
import * as eslintPluginYml from 'eslint-plugin-yml';
|
|
21
|
+
export { eslintPluginYml as pluginYaml };
|
|
16
22
|
export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests';
|
|
23
|
+
export { default as pluginVitest } from 'eslint-plugin-vitest';
|
|
24
|
+
export { default as pluginVue } from 'eslint-plugin-vue';
|
|
17
25
|
export { default as pluginReact } from 'eslint-plugin-react';
|
|
18
26
|
export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
|
|
19
27
|
export { default as pluginAstro } from 'eslint-plugin-astro';
|
|
20
|
-
export { default as parserTs } from '@typescript-eslint/parser';
|
|
21
28
|
export { default as parserVue } from 'vue-eslint-parser';
|
|
22
|
-
export { default as
|
|
29
|
+
export { default as parserYaml } from 'yaml-eslint-parser';
|
|
23
30
|
export { default as parserJsonc } from 'jsonc-eslint-parser';
|
|
24
31
|
export { default as parserAstro } from 'astro-eslint-parser';
|
|
25
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Flat ESLint Configuration.
|
|
35
|
+
*
|
|
36
|
+
* @see [Configuration Files (New)](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new)
|
|
37
|
+
*/
|
|
38
|
+
interface FlatESLintConfigItem {
|
|
39
|
+
/**
|
|
40
|
+
* The name of the configuration object.
|
|
41
|
+
*/
|
|
42
|
+
name?: string;
|
|
43
|
+
/**
|
|
44
|
+
* An array of glob patterns indicating the files that the configuration object should apply to. If not specified, the configuration object applies to all files.
|
|
45
|
+
*
|
|
46
|
+
* @see [Ignore Patterns](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#excluding-files-with-ignores)
|
|
47
|
+
*/
|
|
48
|
+
files?: string[];
|
|
49
|
+
/**
|
|
50
|
+
* An array of glob patterns indicating the files that the configuration object should not apply to. If not specified, the configuration object applies to all files matched by files.
|
|
51
|
+
*
|
|
52
|
+
* @see [Ignore Patterns](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#excluding-files-with-ignores)
|
|
53
|
+
*/
|
|
54
|
+
ignores?: string[];
|
|
55
|
+
/**
|
|
56
|
+
* An object containing settings related to how JavaScript is configured for linting.
|
|
57
|
+
*
|
|
58
|
+
* @see [Configuring language options](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#configuring-language-options)
|
|
59
|
+
*/
|
|
60
|
+
languageOptions?: LanguageOptions;
|
|
61
|
+
/**
|
|
62
|
+
* An object containing settings related to the linting process.
|
|
63
|
+
*/
|
|
64
|
+
linterOptions?: LinterOptions;
|
|
65
|
+
/**
|
|
66
|
+
* Either an object containing `preprocess()` and `postprocess()` methods or a string indicating the name of a processor inside of a plugin (i.e., `"pluginName/processorName"`).
|
|
67
|
+
*
|
|
68
|
+
* @see [Using processors](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-processors)
|
|
69
|
+
*/
|
|
70
|
+
processor?: string | Linter.Processor;
|
|
71
|
+
/**
|
|
72
|
+
* 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.
|
|
73
|
+
*
|
|
74
|
+
* @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
|
|
75
|
+
*/
|
|
76
|
+
plugins?: Record<string, ESLint.Plugin>;
|
|
77
|
+
/**
|
|
78
|
+
* An object containing the configured rules. When `files` or `ignores` are specified, these rule configurations are only available to the matching files.
|
|
79
|
+
*
|
|
80
|
+
* @see [Configuring rules](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#configuring-rules)
|
|
81
|
+
*/
|
|
82
|
+
rules?: Record<string, Linter.RuleLevel | Linter.RuleLevelAndOptions>;
|
|
83
|
+
/**
|
|
84
|
+
* An object containing name-value pairs of information that should be available to all rules.
|
|
85
|
+
*
|
|
86
|
+
* @see [Configuring shared settings](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#configuring-shared-settings)
|
|
87
|
+
*/
|
|
88
|
+
settings?: Record<string, any>;
|
|
89
|
+
}
|
|
26
90
|
interface OptionsComponentExts {
|
|
27
91
|
/**
|
|
28
92
|
* Additional extensions for components.
|
|
@@ -32,17 +96,36 @@ interface OptionsComponentExts {
|
|
|
32
96
|
*/
|
|
33
97
|
componentExts?: string[];
|
|
34
98
|
}
|
|
35
|
-
interface
|
|
36
|
-
|
|
37
|
-
|
|
99
|
+
interface OptionsTypeScriptParserOptions {
|
|
100
|
+
/**
|
|
101
|
+
* Additional parser options for TypeScript.
|
|
102
|
+
*/
|
|
103
|
+
parserOptions?: Partial<ParserOptions>;
|
|
104
|
+
}
|
|
105
|
+
interface OptionsTypeScriptWithTypes {
|
|
106
|
+
/**
|
|
107
|
+
* When this options is provided, type aware rules will be enabled.
|
|
108
|
+
* @see https://typescript-eslint.io/linting/typed-linting/
|
|
109
|
+
*/
|
|
110
|
+
tsconfigPath?: string;
|
|
38
111
|
}
|
|
39
112
|
interface OptionsHasTypeScript {
|
|
40
113
|
typescript?: boolean;
|
|
41
114
|
}
|
|
115
|
+
interface OptionsStylistic {
|
|
116
|
+
stylistic?: boolean | StylisticConfig;
|
|
117
|
+
}
|
|
118
|
+
interface StylisticConfig {
|
|
119
|
+
indent?: number | 'tab';
|
|
120
|
+
quotes?: 'single' | 'double';
|
|
121
|
+
}
|
|
122
|
+
interface OptionsOverrides {
|
|
123
|
+
overrides?: FlatESLintConfigItem['rules'];
|
|
124
|
+
}
|
|
42
125
|
interface OptionsIsInEditor {
|
|
43
126
|
isInEditor?: boolean;
|
|
44
127
|
}
|
|
45
|
-
interface OptionsConfig {
|
|
128
|
+
interface OptionsConfig extends OptionsComponentExts {
|
|
46
129
|
/**
|
|
47
130
|
* Enable gitignore support.
|
|
48
131
|
*
|
|
@@ -59,7 +142,7 @@ interface OptionsConfig {
|
|
|
59
142
|
*
|
|
60
143
|
* @default auto-detect based on the dependencies
|
|
61
144
|
*/
|
|
62
|
-
typescript?: boolean |
|
|
145
|
+
typescript?: boolean | OptionsTypeScriptWithTypes;
|
|
63
146
|
/**
|
|
64
147
|
* Enable test support.
|
|
65
148
|
*
|
|
@@ -107,12 +190,26 @@ interface OptionsConfig {
|
|
|
107
190
|
*
|
|
108
191
|
* @default true
|
|
109
192
|
*/
|
|
110
|
-
stylistic?: boolean;
|
|
193
|
+
stylistic?: boolean | StylisticConfig;
|
|
111
194
|
/**
|
|
112
195
|
* Control to disable some rules in editors.
|
|
113
196
|
* @default auto-detect based on the process.env
|
|
114
197
|
*/
|
|
115
198
|
isInEditor?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Provide overrides for rules for each integration.
|
|
201
|
+
*/
|
|
202
|
+
overrides?: {
|
|
203
|
+
javascript?: FlatESLintConfigItem['rules'];
|
|
204
|
+
typescript?: FlatESLintConfigItem['rules'];
|
|
205
|
+
test?: FlatESLintConfigItem['rules'];
|
|
206
|
+
vue?: FlatESLintConfigItem['rules'];
|
|
207
|
+
react?: FlatESLintConfigItem['rules'];
|
|
208
|
+
astro?: FlatESLintConfigItem['rules'];
|
|
209
|
+
jsonc?: FlatESLintConfigItem['rules'];
|
|
210
|
+
markdown?: FlatESLintConfigItem['rules'];
|
|
211
|
+
yaml?: FlatESLintConfigItem['rules'];
|
|
212
|
+
};
|
|
116
213
|
}
|
|
117
214
|
|
|
118
215
|
/**
|
|
@@ -120,52 +217,51 @@ interface OptionsConfig {
|
|
|
120
217
|
*/
|
|
121
218
|
declare function coderwyd(options?: OptionsConfig & FlatESLintConfigItem, ...userConfigs: (FlatESLintConfigItem | FlatESLintConfigItem[])[]): FlatESLintConfigItem[];
|
|
122
219
|
|
|
123
|
-
declare
|
|
220
|
+
declare function comments(): FlatESLintConfigItem[];
|
|
124
221
|
|
|
125
|
-
declare
|
|
222
|
+
declare function ignores(): FlatESLintConfigItem[];
|
|
126
223
|
|
|
127
|
-
declare
|
|
224
|
+
declare function imports(options?: OptionsStylistic): FlatESLintConfigItem[];
|
|
128
225
|
|
|
129
|
-
declare function javascript(options?: OptionsIsInEditor): FlatESLintConfigItem[];
|
|
226
|
+
declare function javascript(options?: OptionsIsInEditor & OptionsOverrides): FlatESLintConfigItem[];
|
|
130
227
|
|
|
131
|
-
declare
|
|
228
|
+
declare function jsdoc(options?: OptionsStylistic): FlatESLintConfigItem[];
|
|
132
229
|
|
|
133
|
-
declare
|
|
230
|
+
declare function jsonc(options?: OptionsStylistic & OptionsOverrides): FlatESLintConfigItem[];
|
|
134
231
|
|
|
135
|
-
declare function markdown(options?: OptionsComponentExts): FlatESLintConfigItem[];
|
|
232
|
+
declare function markdown(options?: OptionsComponentExts & OptionsOverrides): FlatESLintConfigItem[];
|
|
136
233
|
|
|
137
|
-
declare
|
|
234
|
+
declare function node(): FlatESLintConfigItem[];
|
|
138
235
|
|
|
139
236
|
/**
|
|
140
237
|
* Sort package.json
|
|
141
238
|
*
|
|
142
239
|
* Requires `jsonc` config
|
|
143
240
|
*/
|
|
144
|
-
declare
|
|
241
|
+
declare function sortPackageJson(): FlatESLintConfigItem[];
|
|
145
242
|
/**
|
|
146
243
|
* Sort tsconfig.json
|
|
147
244
|
*
|
|
148
245
|
* Requires `jsonc` config
|
|
149
246
|
*/
|
|
150
|
-
declare
|
|
247
|
+
declare function sortTsconfig(): FlatESLintConfigItem[];
|
|
151
248
|
|
|
152
|
-
declare
|
|
249
|
+
declare function stylistic(options?: StylisticConfig): FlatESLintConfigItem[];
|
|
153
250
|
|
|
154
|
-
declare function typescript(options?: OptionsComponentExts): FlatESLintConfigItem[];
|
|
155
|
-
declare function typescriptWithLanguageServer(options: OptionsTypeScriptWithLanguageServer & OptionsComponentExts): FlatESLintConfigItem[];
|
|
251
|
+
declare function typescript(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions): FlatESLintConfigItem[];
|
|
156
252
|
|
|
157
|
-
declare
|
|
253
|
+
declare function unicorn(): FlatESLintConfigItem[];
|
|
158
254
|
|
|
159
255
|
declare function getVueVersion(): number;
|
|
160
|
-
declare function vue(options?: OptionsHasTypeScript): FlatESLintConfigItem[];
|
|
256
|
+
declare function vue(options?: OptionsHasTypeScript & OptionsOverrides & OptionsStylistic): FlatESLintConfigItem[];
|
|
161
257
|
|
|
162
|
-
declare
|
|
258
|
+
declare function yaml(options?: OptionsOverrides & OptionsStylistic): FlatESLintConfigItem[];
|
|
163
259
|
|
|
164
|
-
declare function test(options?: OptionsIsInEditor): FlatESLintConfigItem[];
|
|
260
|
+
declare function test(options?: OptionsIsInEditor & OptionsOverrides): FlatESLintConfigItem[];
|
|
165
261
|
|
|
166
|
-
declare function react(options?: OptionsHasTypeScript): FlatESLintConfigItem[];
|
|
262
|
+
declare function react(options?: OptionsHasTypeScript & OptionsOverrides & OptionsStylistic): FlatESLintConfigItem[];
|
|
167
263
|
|
|
168
|
-
declare function astro(options?: OptionsHasTypeScript): FlatESLintConfigItem[];
|
|
264
|
+
declare function astro(options?: OptionsHasTypeScript & OptionsOverrides): FlatESLintConfigItem[];
|
|
169
265
|
|
|
170
266
|
/**
|
|
171
267
|
* Combine array and non-array configs into a single array.
|
|
@@ -175,4 +271,27 @@ declare function renameRules(rules: Record<string, any>, from: string, to: strin
|
|
|
175
271
|
[k: string]: any;
|
|
176
272
|
};
|
|
177
273
|
|
|
178
|
-
|
|
274
|
+
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
275
|
+
declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
276
|
+
declare const GLOB_JS = "**/*.?([cm])js";
|
|
277
|
+
declare const GLOB_JSX = "**/*.?([cm])jsx";
|
|
278
|
+
declare const GLOB_TS = "**/*.?([cm])ts";
|
|
279
|
+
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
280
|
+
declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
281
|
+
declare const GLOB_CSS = "**/*.css";
|
|
282
|
+
declare const GLOB_LESS = "**/*.less";
|
|
283
|
+
declare const GLOB_SCSS = "**/*.scss";
|
|
284
|
+
declare const GLOB_JSON = "**/*.json";
|
|
285
|
+
declare const GLOB_JSON5 = "**/*.json5";
|
|
286
|
+
declare const GLOB_JSONC = "**/*.jsonc";
|
|
287
|
+
declare const GLOB_MARKDOWN = "**/*.md";
|
|
288
|
+
declare const GLOB_VUE = "**/*.vue";
|
|
289
|
+
declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
290
|
+
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
291
|
+
declare const GLOB_ASTRO = "**/*.astro";
|
|
292
|
+
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
293
|
+
declare const GLOB_TESTS: string[];
|
|
294
|
+
declare const GLOB_ALL_SRC: string[];
|
|
295
|
+
declare const GLOB_EXCLUDE: string[];
|
|
296
|
+
|
|
297
|
+
export { FlatESLintConfigItem, GLOB_ALL_SRC, 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_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, StylisticConfig, astro, coderwyd, combine, comments, coderwyd as default, getVueVersion, ignores, imports, javascript, jsdoc, jsonc, markdown, node, react, renameRules, sortPackageJson, sortTsconfig, stylistic, test, typescript, unicorn, vue, yaml };
|