@coderwyd/eslint-config 1.1.0-beta.2 → 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 +35 -5
- package/dist/index.cjs +348 -144
- package/dist/index.d.cts +78 -11
- package/dist/index.d.ts +78 -11
- package/dist/index.js +393 -190
- package/package.json +16 -11
package/dist/index.d.cts
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
import { FlatESLintConfigItem } from 'eslint-define-config';
|
|
2
1
|
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
3
2
|
import { ParserOptions } from '@typescript-eslint/parser';
|
|
4
|
-
|
|
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';
|
|
5
7
|
export { default as pluginAntfu } from 'eslint-plugin-antfu';
|
|
6
8
|
export { default as pluginComments } from 'eslint-plugin-eslint-comments';
|
|
7
|
-
|
|
9
|
+
import * as eslintPluginI from 'eslint-plugin-i';
|
|
10
|
+
export { eslintPluginI as pluginImport };
|
|
8
11
|
export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
|
|
9
|
-
|
|
12
|
+
import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
|
|
13
|
+
export { eslintPluginJsonc as pluginJsonc };
|
|
10
14
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
11
15
|
export { default as pluginNode } from 'eslint-plugin-n';
|
|
12
16
|
export { default as pluginStylistic } from '@stylistic/eslint-plugin';
|
|
13
17
|
export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
|
|
14
18
|
export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
15
19
|
export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
|
|
16
|
-
|
|
17
|
-
export {
|
|
20
|
+
import * as eslintPluginYml from 'eslint-plugin-yml';
|
|
21
|
+
export { eslintPluginYml as pluginYaml };
|
|
18
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';
|
|
19
25
|
export { default as pluginReact } from 'eslint-plugin-react';
|
|
20
26
|
export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
|
|
21
27
|
export { default as pluginAstro } from 'eslint-plugin-astro';
|
|
@@ -24,6 +30,63 @@ export { default as parserYaml } from 'yaml-eslint-parser';
|
|
|
24
30
|
export { default as parserJsonc } from 'jsonc-eslint-parser';
|
|
25
31
|
export { default as parserAstro } from 'astro-eslint-parser';
|
|
26
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
|
+
}
|
|
27
90
|
interface OptionsComponentExts {
|
|
28
91
|
/**
|
|
29
92
|
* Additional extensions for components.
|
|
@@ -50,7 +113,11 @@ interface OptionsHasTypeScript {
|
|
|
50
113
|
typescript?: boolean;
|
|
51
114
|
}
|
|
52
115
|
interface OptionsStylistic {
|
|
53
|
-
stylistic?: boolean;
|
|
116
|
+
stylistic?: boolean | StylisticConfig;
|
|
117
|
+
}
|
|
118
|
+
interface StylisticConfig {
|
|
119
|
+
indent?: number | 'tab';
|
|
120
|
+
quotes?: 'single' | 'double';
|
|
54
121
|
}
|
|
55
122
|
interface OptionsOverrides {
|
|
56
123
|
overrides?: FlatESLintConfigItem['rules'];
|
|
@@ -123,7 +190,7 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
123
190
|
*
|
|
124
191
|
* @default true
|
|
125
192
|
*/
|
|
126
|
-
stylistic?: boolean;
|
|
193
|
+
stylistic?: boolean | StylisticConfig;
|
|
127
194
|
/**
|
|
128
195
|
* Control to disable some rules in editors.
|
|
129
196
|
* @default auto-detect based on the process.env
|
|
@@ -179,7 +246,7 @@ declare function sortPackageJson(): FlatESLintConfigItem[];
|
|
|
179
246
|
*/
|
|
180
247
|
declare function sortTsconfig(): FlatESLintConfigItem[];
|
|
181
248
|
|
|
182
|
-
declare function stylistic(): FlatESLintConfigItem[];
|
|
249
|
+
declare function stylistic(options?: StylisticConfig): FlatESLintConfigItem[];
|
|
183
250
|
|
|
184
251
|
declare function typescript(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions): FlatESLintConfigItem[];
|
|
185
252
|
|
|
@@ -192,7 +259,7 @@ declare function yaml(options?: OptionsOverrides & OptionsStylistic): FlatESLint
|
|
|
192
259
|
|
|
193
260
|
declare function test(options?: OptionsIsInEditor & OptionsOverrides): FlatESLintConfigItem[];
|
|
194
261
|
|
|
195
|
-
declare function react(options?: OptionsHasTypeScript & OptionsOverrides): FlatESLintConfigItem[];
|
|
262
|
+
declare function react(options?: OptionsHasTypeScript & OptionsOverrides & OptionsStylistic): FlatESLintConfigItem[];
|
|
196
263
|
|
|
197
264
|
declare function astro(options?: OptionsHasTypeScript & OptionsOverrides): FlatESLintConfigItem[];
|
|
198
265
|
|
|
@@ -227,4 +294,4 @@ declare const GLOB_TESTS: string[];
|
|
|
227
294
|
declare const GLOB_ALL_SRC: string[];
|
|
228
295
|
declare const GLOB_EXCLUDE: string[];
|
|
229
296
|
|
|
230
|
-
export { 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, 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 };
|
|
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,21 +1,27 @@
|
|
|
1
|
-
import { FlatESLintConfigItem } from 'eslint-define-config';
|
|
2
1
|
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
3
2
|
import { ParserOptions } from '@typescript-eslint/parser';
|
|
4
|
-
|
|
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';
|
|
5
7
|
export { default as pluginAntfu } from 'eslint-plugin-antfu';
|
|
6
8
|
export { default as pluginComments } from 'eslint-plugin-eslint-comments';
|
|
7
|
-
|
|
9
|
+
import * as eslintPluginI from 'eslint-plugin-i';
|
|
10
|
+
export { eslintPluginI as pluginImport };
|
|
8
11
|
export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
|
|
9
|
-
|
|
12
|
+
import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
|
|
13
|
+
export { eslintPluginJsonc as pluginJsonc };
|
|
10
14
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
11
15
|
export { default as pluginNode } from 'eslint-plugin-n';
|
|
12
16
|
export { default as pluginStylistic } from '@stylistic/eslint-plugin';
|
|
13
17
|
export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
|
|
14
18
|
export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
15
19
|
export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
|
|
16
|
-
|
|
17
|
-
export {
|
|
20
|
+
import * as eslintPluginYml from 'eslint-plugin-yml';
|
|
21
|
+
export { eslintPluginYml as pluginYaml };
|
|
18
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';
|
|
19
25
|
export { default as pluginReact } from 'eslint-plugin-react';
|
|
20
26
|
export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
|
|
21
27
|
export { default as pluginAstro } from 'eslint-plugin-astro';
|
|
@@ -24,6 +30,63 @@ export { default as parserYaml } from 'yaml-eslint-parser';
|
|
|
24
30
|
export { default as parserJsonc } from 'jsonc-eslint-parser';
|
|
25
31
|
export { default as parserAstro } from 'astro-eslint-parser';
|
|
26
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
|
+
}
|
|
27
90
|
interface OptionsComponentExts {
|
|
28
91
|
/**
|
|
29
92
|
* Additional extensions for components.
|
|
@@ -50,7 +113,11 @@ interface OptionsHasTypeScript {
|
|
|
50
113
|
typescript?: boolean;
|
|
51
114
|
}
|
|
52
115
|
interface OptionsStylistic {
|
|
53
|
-
stylistic?: boolean;
|
|
116
|
+
stylistic?: boolean | StylisticConfig;
|
|
117
|
+
}
|
|
118
|
+
interface StylisticConfig {
|
|
119
|
+
indent?: number | 'tab';
|
|
120
|
+
quotes?: 'single' | 'double';
|
|
54
121
|
}
|
|
55
122
|
interface OptionsOverrides {
|
|
56
123
|
overrides?: FlatESLintConfigItem['rules'];
|
|
@@ -123,7 +190,7 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
123
190
|
*
|
|
124
191
|
* @default true
|
|
125
192
|
*/
|
|
126
|
-
stylistic?: boolean;
|
|
193
|
+
stylistic?: boolean | StylisticConfig;
|
|
127
194
|
/**
|
|
128
195
|
* Control to disable some rules in editors.
|
|
129
196
|
* @default auto-detect based on the process.env
|
|
@@ -179,7 +246,7 @@ declare function sortPackageJson(): FlatESLintConfigItem[];
|
|
|
179
246
|
*/
|
|
180
247
|
declare function sortTsconfig(): FlatESLintConfigItem[];
|
|
181
248
|
|
|
182
|
-
declare function stylistic(): FlatESLintConfigItem[];
|
|
249
|
+
declare function stylistic(options?: StylisticConfig): FlatESLintConfigItem[];
|
|
183
250
|
|
|
184
251
|
declare function typescript(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions): FlatESLintConfigItem[];
|
|
185
252
|
|
|
@@ -192,7 +259,7 @@ declare function yaml(options?: OptionsOverrides & OptionsStylistic): FlatESLint
|
|
|
192
259
|
|
|
193
260
|
declare function test(options?: OptionsIsInEditor & OptionsOverrides): FlatESLintConfigItem[];
|
|
194
261
|
|
|
195
|
-
declare function react(options?: OptionsHasTypeScript & OptionsOverrides): FlatESLintConfigItem[];
|
|
262
|
+
declare function react(options?: OptionsHasTypeScript & OptionsOverrides & OptionsStylistic): FlatESLintConfigItem[];
|
|
196
263
|
|
|
197
264
|
declare function astro(options?: OptionsHasTypeScript & OptionsOverrides): FlatESLintConfigItem[];
|
|
198
265
|
|
|
@@ -227,4 +294,4 @@ declare const GLOB_TESTS: string[];
|
|
|
227
294
|
declare const GLOB_ALL_SRC: string[];
|
|
228
295
|
declare const GLOB_EXCLUDE: string[];
|
|
229
296
|
|
|
230
|
-
export { 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, 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 };
|
|
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 };
|