@jsse/eslint-config 0.0.1
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/LICENSE +21 -0
- package/README.md +93 -0
- package/dist/index.cjs +2259 -0
- package/dist/index.d.cts +257 -0
- package/dist/index.d.ts +257 -0
- package/dist/index.js +2189 -0
- package/package.json +93 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { MergeIntersection, RenamePrefix, TypeScriptRules, VitestRules, YmlRules, NRules, ImportRules, EslintRules, JsoncRules, VueRules, UnicornRules, EslintCommentsRules, RuleConfig, FlatESLintConfigItem } from '@antfu/eslint-define-config';
|
|
2
|
+
import { ParserOptions } from '@typescript-eslint/parser';
|
|
3
|
+
import * as parser from '@typescript-eslint/parser';
|
|
4
|
+
export { parser as parserTs };
|
|
5
|
+
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
6
|
+
export { default as pluginStylistic } from '@stylistic/eslint-plugin';
|
|
7
|
+
export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
|
|
8
|
+
export { default as pluginEslintComments } from 'eslint-plugin-eslint-comments';
|
|
9
|
+
import * as eslintPluginI from 'eslint-plugin-i';
|
|
10
|
+
export { eslintPluginI as pluginImport };
|
|
11
|
+
export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
|
|
12
|
+
import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
|
|
13
|
+
export { eslintPluginJsonc as pluginJsonc };
|
|
14
|
+
export { default as pluginNode } from 'eslint-plugin-n';
|
|
15
|
+
export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests';
|
|
16
|
+
export { default as pluginReact } from 'eslint-plugin-react';
|
|
17
|
+
export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
|
|
18
|
+
import * as eslintPluginReactRefresh from 'eslint-plugin-react-refresh';
|
|
19
|
+
export { eslintPluginReactRefresh as pluginReactRefresh };
|
|
20
|
+
import * as eslintPluginSortKeys from 'eslint-plugin-sort-keys';
|
|
21
|
+
export { eslintPluginSortKeys as pluginSortKeys };
|
|
22
|
+
export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
23
|
+
export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
|
|
24
|
+
export { default as pluginTailwind } from 'eslint-plugin-tailwindcss';
|
|
25
|
+
export { default as pluginVitest } from 'eslint-plugin-vitest';
|
|
26
|
+
export { default as parserJsonc } from 'jsonc-eslint-parser';
|
|
27
|
+
|
|
28
|
+
type Rules = MergeIntersection<RenamePrefix<TypeScriptRules, "@typescript-eslint/", "ts/"> & RenamePrefix<VitestRules, "vitest/", "test/"> & RenamePrefix<YmlRules, "yml/", "yaml/"> & RenamePrefix<NRules, "n/", "node/"> & ImportRules & EslintRules & JsoncRules & VueRules & UnicornRules & EslintCommentsRules & {
|
|
29
|
+
"test/no-only-tests": RuleConfig;
|
|
30
|
+
}>;
|
|
31
|
+
type ConfigItem = Omit<FlatESLintConfigItem<Rules, false>, "plugins"> & {
|
|
32
|
+
/**
|
|
33
|
+
* Custom name of each config item
|
|
34
|
+
*/
|
|
35
|
+
name?: string;
|
|
36
|
+
/**
|
|
37
|
+
* 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.
|
|
38
|
+
*
|
|
39
|
+
* @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
|
|
40
|
+
*/
|
|
41
|
+
plugins?: Record<string, any>;
|
|
42
|
+
};
|
|
43
|
+
type OptionsComponentExts = {
|
|
44
|
+
/**
|
|
45
|
+
* Additional extensions for components.
|
|
46
|
+
*
|
|
47
|
+
* @example ['vue']
|
|
48
|
+
* @default []
|
|
49
|
+
*/
|
|
50
|
+
componentExts?: string[];
|
|
51
|
+
};
|
|
52
|
+
type OptionsTypeScriptParserOptions = {
|
|
53
|
+
/**
|
|
54
|
+
* Additional parser options for TypeScript.
|
|
55
|
+
*/
|
|
56
|
+
parserOptions?: Partial<ParserOptions>;
|
|
57
|
+
};
|
|
58
|
+
type OptionsTypeScriptWithTypes = {
|
|
59
|
+
/**
|
|
60
|
+
* When this options is provided, type aware rules will be enabled.
|
|
61
|
+
* @see https://typescript-eslint.io/linting/typed-linting/
|
|
62
|
+
*/
|
|
63
|
+
tsconfigPath?: string;
|
|
64
|
+
};
|
|
65
|
+
type OptionsHasTypeScript = {
|
|
66
|
+
typescript?: boolean;
|
|
67
|
+
};
|
|
68
|
+
type OptionsStylistic = {
|
|
69
|
+
stylistic?: boolean | StylisticConfig;
|
|
70
|
+
};
|
|
71
|
+
type StylisticConfig = {
|
|
72
|
+
indent?: number | "tab";
|
|
73
|
+
quotes?: "single" | "double";
|
|
74
|
+
jsx?: boolean;
|
|
75
|
+
};
|
|
76
|
+
type OptionsPrefix = {
|
|
77
|
+
prefix?: {
|
|
78
|
+
from: string;
|
|
79
|
+
to: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
type OptionsOverrides = {
|
|
83
|
+
overrides?: ConfigItem["rules"];
|
|
84
|
+
};
|
|
85
|
+
type OptionsIsInEditor = {
|
|
86
|
+
isInEditor?: boolean;
|
|
87
|
+
};
|
|
88
|
+
type OptionsReact = {
|
|
89
|
+
react?: boolean;
|
|
90
|
+
reactRefresh?: boolean;
|
|
91
|
+
};
|
|
92
|
+
type OptionsConfig = {
|
|
93
|
+
/**
|
|
94
|
+
* Enable debug mode.
|
|
95
|
+
*/
|
|
96
|
+
debug?: boolean;
|
|
97
|
+
tailwind?: boolean;
|
|
98
|
+
off?: string[];
|
|
99
|
+
/**
|
|
100
|
+
* Enable gitignore support.
|
|
101
|
+
*
|
|
102
|
+
* Passing an object to configure the options.
|
|
103
|
+
*
|
|
104
|
+
* @see https://github.com/antfu/eslint-config-flat-gitignore
|
|
105
|
+
* @default true
|
|
106
|
+
*/
|
|
107
|
+
gitignore?: boolean | FlatGitignoreOptions;
|
|
108
|
+
tsPrefix?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Enable TypeScript support.
|
|
111
|
+
*
|
|
112
|
+
* Passing an object to enable TypeScript Language Server support.
|
|
113
|
+
*
|
|
114
|
+
* @default auto-detect based on the dependencies
|
|
115
|
+
*/
|
|
116
|
+
typescript?: boolean | OptionsTypeScriptWithTypes;
|
|
117
|
+
react?: boolean;
|
|
118
|
+
reactRefresh?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Enable JSX related rules.
|
|
121
|
+
*
|
|
122
|
+
* Currently only stylistic rules are included.
|
|
123
|
+
*
|
|
124
|
+
* @default true
|
|
125
|
+
*/
|
|
126
|
+
jsx?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Enable test support.
|
|
129
|
+
*
|
|
130
|
+
* @default true
|
|
131
|
+
*/
|
|
132
|
+
test?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Enable JSONC support.
|
|
135
|
+
*
|
|
136
|
+
* @default true
|
|
137
|
+
*/
|
|
138
|
+
jsonc?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Enable YAML support.
|
|
141
|
+
*
|
|
142
|
+
* @default true
|
|
143
|
+
*/
|
|
144
|
+
yaml?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Enable Markdown support.
|
|
147
|
+
*
|
|
148
|
+
* @default true
|
|
149
|
+
*/
|
|
150
|
+
markdown?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Enable stylistic rules.
|
|
153
|
+
*
|
|
154
|
+
* @default true
|
|
155
|
+
*/
|
|
156
|
+
stylistic?: boolean | StylisticConfig;
|
|
157
|
+
/**
|
|
158
|
+
* Control to disable some rules in editors.
|
|
159
|
+
* @default auto-detect based on the process.env
|
|
160
|
+
*/
|
|
161
|
+
isInEditor?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Provide overrides for rules for each integration.
|
|
164
|
+
*/
|
|
165
|
+
overrides?: {
|
|
166
|
+
javascript?: ConfigItem["rules"];
|
|
167
|
+
typescript?: ConfigItem["rules"];
|
|
168
|
+
test?: ConfigItem["rules"];
|
|
169
|
+
vue?: ConfigItem["rules"];
|
|
170
|
+
jsonc?: ConfigItem["rules"];
|
|
171
|
+
markdown?: ConfigItem["rules"];
|
|
172
|
+
yaml?: ConfigItem["rules"];
|
|
173
|
+
};
|
|
174
|
+
} & OptionsComponentExts;
|
|
175
|
+
|
|
176
|
+
declare function comments(): ConfigItem[];
|
|
177
|
+
|
|
178
|
+
declare function ignores(): ConfigItem[];
|
|
179
|
+
|
|
180
|
+
declare function imports(options?: OptionsStylistic): ConfigItem[];
|
|
181
|
+
|
|
182
|
+
declare function javascript(options?: OptionsIsInEditor & OptionsOverrides & {
|
|
183
|
+
reportUnusedDisableDirectives?: boolean;
|
|
184
|
+
}): ConfigItem[];
|
|
185
|
+
|
|
186
|
+
declare function jsdoc(options?: OptionsStylistic): ConfigItem[];
|
|
187
|
+
|
|
188
|
+
declare function jsonc(options?: OptionsStylistic & OptionsOverrides): ConfigItem[];
|
|
189
|
+
|
|
190
|
+
declare function node(): ConfigItem[];
|
|
191
|
+
|
|
192
|
+
declare function reactHooks(): {
|
|
193
|
+
files: string[];
|
|
194
|
+
plugins: {
|
|
195
|
+
"react-hooks": any;
|
|
196
|
+
};
|
|
197
|
+
rules: {
|
|
198
|
+
"react-hooks/exhaustive-deps": string;
|
|
199
|
+
"react-hooks/rules-of-hooks": string;
|
|
200
|
+
};
|
|
201
|
+
}[];
|
|
202
|
+
declare function react(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsReact): ConfigItem[];
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Sort package.json
|
|
206
|
+
*
|
|
207
|
+
* Requires `jsonc` config
|
|
208
|
+
*/
|
|
209
|
+
declare function sortPackageJson(): ConfigItem[];
|
|
210
|
+
/**
|
|
211
|
+
* Sort tsconfig.json
|
|
212
|
+
*
|
|
213
|
+
* Requires `jsonc` config
|
|
214
|
+
*/
|
|
215
|
+
declare function sortTsconfig(): ConfigItem[];
|
|
216
|
+
|
|
217
|
+
declare function test(options?: OptionsIsInEditor & OptionsOverrides): ConfigItem[];
|
|
218
|
+
|
|
219
|
+
declare function typescript(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsReact & OptionsPrefix): ConfigItem[];
|
|
220
|
+
|
|
221
|
+
declare function unicorn(): ConfigItem[];
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Construct an array of ESLint flat config items.
|
|
225
|
+
*/
|
|
226
|
+
declare function jsse(options?: OptionsConfig & ConfigItem, ...userConfigs: (ConfigItem | ConfigItem[])[]): ConfigItem[];
|
|
227
|
+
|
|
228
|
+
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
229
|
+
declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
230
|
+
declare const GLOB_JS = "**/*.?([cm])js";
|
|
231
|
+
declare const GLOB_JSX = "**/*.?([cm])jsx";
|
|
232
|
+
declare const GLOB_TS = "**/*.?([cm])ts";
|
|
233
|
+
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
234
|
+
declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
235
|
+
declare const GLOB_CSS = "**/*.css";
|
|
236
|
+
declare const GLOB_LESS = "**/*.less";
|
|
237
|
+
declare const GLOB_SCSS = "**/*.scss";
|
|
238
|
+
declare const GLOB_JSON = "**/*.json";
|
|
239
|
+
declare const GLOB_JSON5 = "**/*.json5";
|
|
240
|
+
declare const GLOB_JSONC = "**/*.jsonc";
|
|
241
|
+
declare const GLOB_MARKDOWN = "**/*.md";
|
|
242
|
+
declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
243
|
+
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
244
|
+
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
245
|
+
declare const GLOB_TESTS: string[];
|
|
246
|
+
declare const GLOB_ALL_SRC: string[];
|
|
247
|
+
declare const GLOB_EXCLUDE: string[];
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Combine array and non-array configs into a single array.
|
|
251
|
+
*/
|
|
252
|
+
declare function combine(...configs: (ConfigItem | ConfigItem[])[]): ConfigItem[];
|
|
253
|
+
declare function renameRules<TRule = unknown>(rules: Record<string, TRule>, from: string, to: string): Record<string, TRule>;
|
|
254
|
+
declare function isCI(): boolean;
|
|
255
|
+
declare function isInEditor(): boolean;
|
|
256
|
+
|
|
257
|
+
export { ConfigItem, GLOB_ALL_SRC, 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_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsPrefix, OptionsReact, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, Rules, StylisticConfig, combine, comments, jsse as default, ignores, imports, isCI, isInEditor, javascript, jsdoc, jsonc, jsse, node, react, reactHooks, renameRules, sortPackageJson, sortTsconfig, test, typescript, unicorn };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { MergeIntersection, RenamePrefix, TypeScriptRules, VitestRules, YmlRules, NRules, ImportRules, EslintRules, JsoncRules, VueRules, UnicornRules, EslintCommentsRules, RuleConfig, FlatESLintConfigItem } from '@antfu/eslint-define-config';
|
|
2
|
+
import { ParserOptions } from '@typescript-eslint/parser';
|
|
3
|
+
import * as parser from '@typescript-eslint/parser';
|
|
4
|
+
export { parser as parserTs };
|
|
5
|
+
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
6
|
+
export { default as pluginStylistic } from '@stylistic/eslint-plugin';
|
|
7
|
+
export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
|
|
8
|
+
export { default as pluginEslintComments } from 'eslint-plugin-eslint-comments';
|
|
9
|
+
import * as eslintPluginI from 'eslint-plugin-i';
|
|
10
|
+
export { eslintPluginI as pluginImport };
|
|
11
|
+
export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
|
|
12
|
+
import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
|
|
13
|
+
export { eslintPluginJsonc as pluginJsonc };
|
|
14
|
+
export { default as pluginNode } from 'eslint-plugin-n';
|
|
15
|
+
export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests';
|
|
16
|
+
export { default as pluginReact } from 'eslint-plugin-react';
|
|
17
|
+
export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
|
|
18
|
+
import * as eslintPluginReactRefresh from 'eslint-plugin-react-refresh';
|
|
19
|
+
export { eslintPluginReactRefresh as pluginReactRefresh };
|
|
20
|
+
import * as eslintPluginSortKeys from 'eslint-plugin-sort-keys';
|
|
21
|
+
export { eslintPluginSortKeys as pluginSortKeys };
|
|
22
|
+
export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
23
|
+
export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
|
|
24
|
+
export { default as pluginTailwind } from 'eslint-plugin-tailwindcss';
|
|
25
|
+
export { default as pluginVitest } from 'eslint-plugin-vitest';
|
|
26
|
+
export { default as parserJsonc } from 'jsonc-eslint-parser';
|
|
27
|
+
|
|
28
|
+
type Rules = MergeIntersection<RenamePrefix<TypeScriptRules, "@typescript-eslint/", "ts/"> & RenamePrefix<VitestRules, "vitest/", "test/"> & RenamePrefix<YmlRules, "yml/", "yaml/"> & RenamePrefix<NRules, "n/", "node/"> & ImportRules & EslintRules & JsoncRules & VueRules & UnicornRules & EslintCommentsRules & {
|
|
29
|
+
"test/no-only-tests": RuleConfig;
|
|
30
|
+
}>;
|
|
31
|
+
type ConfigItem = Omit<FlatESLintConfigItem<Rules, false>, "plugins"> & {
|
|
32
|
+
/**
|
|
33
|
+
* Custom name of each config item
|
|
34
|
+
*/
|
|
35
|
+
name?: string;
|
|
36
|
+
/**
|
|
37
|
+
* 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.
|
|
38
|
+
*
|
|
39
|
+
* @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
|
|
40
|
+
*/
|
|
41
|
+
plugins?: Record<string, any>;
|
|
42
|
+
};
|
|
43
|
+
type OptionsComponentExts = {
|
|
44
|
+
/**
|
|
45
|
+
* Additional extensions for components.
|
|
46
|
+
*
|
|
47
|
+
* @example ['vue']
|
|
48
|
+
* @default []
|
|
49
|
+
*/
|
|
50
|
+
componentExts?: string[];
|
|
51
|
+
};
|
|
52
|
+
type OptionsTypeScriptParserOptions = {
|
|
53
|
+
/**
|
|
54
|
+
* Additional parser options for TypeScript.
|
|
55
|
+
*/
|
|
56
|
+
parserOptions?: Partial<ParserOptions>;
|
|
57
|
+
};
|
|
58
|
+
type OptionsTypeScriptWithTypes = {
|
|
59
|
+
/**
|
|
60
|
+
* When this options is provided, type aware rules will be enabled.
|
|
61
|
+
* @see https://typescript-eslint.io/linting/typed-linting/
|
|
62
|
+
*/
|
|
63
|
+
tsconfigPath?: string;
|
|
64
|
+
};
|
|
65
|
+
type OptionsHasTypeScript = {
|
|
66
|
+
typescript?: boolean;
|
|
67
|
+
};
|
|
68
|
+
type OptionsStylistic = {
|
|
69
|
+
stylistic?: boolean | StylisticConfig;
|
|
70
|
+
};
|
|
71
|
+
type StylisticConfig = {
|
|
72
|
+
indent?: number | "tab";
|
|
73
|
+
quotes?: "single" | "double";
|
|
74
|
+
jsx?: boolean;
|
|
75
|
+
};
|
|
76
|
+
type OptionsPrefix = {
|
|
77
|
+
prefix?: {
|
|
78
|
+
from: string;
|
|
79
|
+
to: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
type OptionsOverrides = {
|
|
83
|
+
overrides?: ConfigItem["rules"];
|
|
84
|
+
};
|
|
85
|
+
type OptionsIsInEditor = {
|
|
86
|
+
isInEditor?: boolean;
|
|
87
|
+
};
|
|
88
|
+
type OptionsReact = {
|
|
89
|
+
react?: boolean;
|
|
90
|
+
reactRefresh?: boolean;
|
|
91
|
+
};
|
|
92
|
+
type OptionsConfig = {
|
|
93
|
+
/**
|
|
94
|
+
* Enable debug mode.
|
|
95
|
+
*/
|
|
96
|
+
debug?: boolean;
|
|
97
|
+
tailwind?: boolean;
|
|
98
|
+
off?: string[];
|
|
99
|
+
/**
|
|
100
|
+
* Enable gitignore support.
|
|
101
|
+
*
|
|
102
|
+
* Passing an object to configure the options.
|
|
103
|
+
*
|
|
104
|
+
* @see https://github.com/antfu/eslint-config-flat-gitignore
|
|
105
|
+
* @default true
|
|
106
|
+
*/
|
|
107
|
+
gitignore?: boolean | FlatGitignoreOptions;
|
|
108
|
+
tsPrefix?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Enable TypeScript support.
|
|
111
|
+
*
|
|
112
|
+
* Passing an object to enable TypeScript Language Server support.
|
|
113
|
+
*
|
|
114
|
+
* @default auto-detect based on the dependencies
|
|
115
|
+
*/
|
|
116
|
+
typescript?: boolean | OptionsTypeScriptWithTypes;
|
|
117
|
+
react?: boolean;
|
|
118
|
+
reactRefresh?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Enable JSX related rules.
|
|
121
|
+
*
|
|
122
|
+
* Currently only stylistic rules are included.
|
|
123
|
+
*
|
|
124
|
+
* @default true
|
|
125
|
+
*/
|
|
126
|
+
jsx?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Enable test support.
|
|
129
|
+
*
|
|
130
|
+
* @default true
|
|
131
|
+
*/
|
|
132
|
+
test?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Enable JSONC support.
|
|
135
|
+
*
|
|
136
|
+
* @default true
|
|
137
|
+
*/
|
|
138
|
+
jsonc?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Enable YAML support.
|
|
141
|
+
*
|
|
142
|
+
* @default true
|
|
143
|
+
*/
|
|
144
|
+
yaml?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Enable Markdown support.
|
|
147
|
+
*
|
|
148
|
+
* @default true
|
|
149
|
+
*/
|
|
150
|
+
markdown?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Enable stylistic rules.
|
|
153
|
+
*
|
|
154
|
+
* @default true
|
|
155
|
+
*/
|
|
156
|
+
stylistic?: boolean | StylisticConfig;
|
|
157
|
+
/**
|
|
158
|
+
* Control to disable some rules in editors.
|
|
159
|
+
* @default auto-detect based on the process.env
|
|
160
|
+
*/
|
|
161
|
+
isInEditor?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Provide overrides for rules for each integration.
|
|
164
|
+
*/
|
|
165
|
+
overrides?: {
|
|
166
|
+
javascript?: ConfigItem["rules"];
|
|
167
|
+
typescript?: ConfigItem["rules"];
|
|
168
|
+
test?: ConfigItem["rules"];
|
|
169
|
+
vue?: ConfigItem["rules"];
|
|
170
|
+
jsonc?: ConfigItem["rules"];
|
|
171
|
+
markdown?: ConfigItem["rules"];
|
|
172
|
+
yaml?: ConfigItem["rules"];
|
|
173
|
+
};
|
|
174
|
+
} & OptionsComponentExts;
|
|
175
|
+
|
|
176
|
+
declare function comments(): ConfigItem[];
|
|
177
|
+
|
|
178
|
+
declare function ignores(): ConfigItem[];
|
|
179
|
+
|
|
180
|
+
declare function imports(options?: OptionsStylistic): ConfigItem[];
|
|
181
|
+
|
|
182
|
+
declare function javascript(options?: OptionsIsInEditor & OptionsOverrides & {
|
|
183
|
+
reportUnusedDisableDirectives?: boolean;
|
|
184
|
+
}): ConfigItem[];
|
|
185
|
+
|
|
186
|
+
declare function jsdoc(options?: OptionsStylistic): ConfigItem[];
|
|
187
|
+
|
|
188
|
+
declare function jsonc(options?: OptionsStylistic & OptionsOverrides): ConfigItem[];
|
|
189
|
+
|
|
190
|
+
declare function node(): ConfigItem[];
|
|
191
|
+
|
|
192
|
+
declare function reactHooks(): {
|
|
193
|
+
files: string[];
|
|
194
|
+
plugins: {
|
|
195
|
+
"react-hooks": any;
|
|
196
|
+
};
|
|
197
|
+
rules: {
|
|
198
|
+
"react-hooks/exhaustive-deps": string;
|
|
199
|
+
"react-hooks/rules-of-hooks": string;
|
|
200
|
+
};
|
|
201
|
+
}[];
|
|
202
|
+
declare function react(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsReact): ConfigItem[];
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Sort package.json
|
|
206
|
+
*
|
|
207
|
+
* Requires `jsonc` config
|
|
208
|
+
*/
|
|
209
|
+
declare function sortPackageJson(): ConfigItem[];
|
|
210
|
+
/**
|
|
211
|
+
* Sort tsconfig.json
|
|
212
|
+
*
|
|
213
|
+
* Requires `jsonc` config
|
|
214
|
+
*/
|
|
215
|
+
declare function sortTsconfig(): ConfigItem[];
|
|
216
|
+
|
|
217
|
+
declare function test(options?: OptionsIsInEditor & OptionsOverrides): ConfigItem[];
|
|
218
|
+
|
|
219
|
+
declare function typescript(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsReact & OptionsPrefix): ConfigItem[];
|
|
220
|
+
|
|
221
|
+
declare function unicorn(): ConfigItem[];
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Construct an array of ESLint flat config items.
|
|
225
|
+
*/
|
|
226
|
+
declare function jsse(options?: OptionsConfig & ConfigItem, ...userConfigs: (ConfigItem | ConfigItem[])[]): ConfigItem[];
|
|
227
|
+
|
|
228
|
+
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
229
|
+
declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
230
|
+
declare const GLOB_JS = "**/*.?([cm])js";
|
|
231
|
+
declare const GLOB_JSX = "**/*.?([cm])jsx";
|
|
232
|
+
declare const GLOB_TS = "**/*.?([cm])ts";
|
|
233
|
+
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
234
|
+
declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
235
|
+
declare const GLOB_CSS = "**/*.css";
|
|
236
|
+
declare const GLOB_LESS = "**/*.less";
|
|
237
|
+
declare const GLOB_SCSS = "**/*.scss";
|
|
238
|
+
declare const GLOB_JSON = "**/*.json";
|
|
239
|
+
declare const GLOB_JSON5 = "**/*.json5";
|
|
240
|
+
declare const GLOB_JSONC = "**/*.jsonc";
|
|
241
|
+
declare const GLOB_MARKDOWN = "**/*.md";
|
|
242
|
+
declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
243
|
+
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
244
|
+
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
245
|
+
declare const GLOB_TESTS: string[];
|
|
246
|
+
declare const GLOB_ALL_SRC: string[];
|
|
247
|
+
declare const GLOB_EXCLUDE: string[];
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Combine array and non-array configs into a single array.
|
|
251
|
+
*/
|
|
252
|
+
declare function combine(...configs: (ConfigItem | ConfigItem[])[]): ConfigItem[];
|
|
253
|
+
declare function renameRules<TRule = unknown>(rules: Record<string, TRule>, from: string, to: string): Record<string, TRule>;
|
|
254
|
+
declare function isCI(): boolean;
|
|
255
|
+
declare function isInEditor(): boolean;
|
|
256
|
+
|
|
257
|
+
export { ConfigItem, GLOB_ALL_SRC, 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_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsPrefix, OptionsReact, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, Rules, StylisticConfig, combine, comments, jsse as default, ignores, imports, isCI, isInEditor, javascript, jsdoc, jsonc, jsse, node, react, reactHooks, renameRules, sortPackageJson, sortTsconfig, test, typescript, unicorn };
|