@coderwyd/eslint-config 1.1.0-beta.0 → 1.1.0-beta.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.
@@ -0,0 +1,178 @@
1
+ import { FlatESLintConfigItem } from 'eslint-define-config';
2
+ import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
3
+ export { default as pluginAntfu } from 'eslint-plugin-antfu';
4
+ export { default as pluginComments } from 'eslint-plugin-eslint-comments';
5
+ export { default as pluginImport } from 'eslint-plugin-i';
6
+ export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
7
+ export { default as pluginJsonc } from 'eslint-plugin-jsonc';
8
+ export { default as pluginMarkdown } from 'eslint-plugin-markdown';
9
+ export { default as pluginNode } from 'eslint-plugin-n';
10
+ export { default as pluginStylistic } from '@stylistic/eslint-plugin';
11
+ export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
12
+ export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
13
+ export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
14
+ export { default as pluginVue } from 'eslint-plugin-vue';
15
+ export { default as pluginYml } from 'eslint-plugin-yml';
16
+ export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests';
17
+ export { default as pluginReact } from 'eslint-plugin-react';
18
+ export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
19
+ export { default as pluginAstro } from 'eslint-plugin-astro';
20
+ export { default as parserTs } from '@typescript-eslint/parser';
21
+ export { default as parserVue } from 'vue-eslint-parser';
22
+ export { default as parserYml } from 'yaml-eslint-parser';
23
+ export { default as parserJsonc } from 'jsonc-eslint-parser';
24
+ export { default as parserAstro } from 'astro-eslint-parser';
25
+
26
+ interface OptionsComponentExts {
27
+ /**
28
+ * Additional extensions for components.
29
+ *
30
+ * @example ['vue']
31
+ * @default []
32
+ */
33
+ componentExts?: string[];
34
+ }
35
+ interface OptionsTypeScriptWithLanguageServer {
36
+ tsconfigPath: string;
37
+ tsconfigRootDir?: string;
38
+ }
39
+ interface OptionsHasTypeScript {
40
+ typescript?: boolean;
41
+ }
42
+ interface OptionsIsInEditor {
43
+ isInEditor?: boolean;
44
+ }
45
+ interface OptionsConfig {
46
+ /**
47
+ * Enable gitignore support.
48
+ *
49
+ * Passing an object to configure the options.
50
+ *
51
+ * @see https://github.com/antfu/eslint-config-flat-gitignore
52
+ * @default true
53
+ */
54
+ gitignore?: boolean | FlatGitignoreOptions;
55
+ /**
56
+ * Enable TypeScript support.
57
+ *
58
+ * Passing an object to enable TypeScript Language Server support.
59
+ *
60
+ * @default auto-detect based on the dependencies
61
+ */
62
+ typescript?: boolean | OptionsTypeScriptWithLanguageServer;
63
+ /**
64
+ * Enable test support.
65
+ *
66
+ * @default true
67
+ */
68
+ test?: boolean;
69
+ /**
70
+ * Enable Vue support.
71
+ *
72
+ * @default auto-detect based on the dependencies
73
+ */
74
+ vue?: boolean;
75
+ /**
76
+ * Enable React support.
77
+ *
78
+ * @default auto-detect based on the dependencies
79
+ */
80
+ react?: boolean;
81
+ /**
82
+ * Enable Astro support.
83
+ *
84
+ * @default auto-detect based on the dependencies
85
+ */
86
+ astro?: boolean;
87
+ /**
88
+ * Enable JSONC support.
89
+ *
90
+ * @default true
91
+ */
92
+ jsonc?: boolean;
93
+ /**
94
+ * Enable YAML support.
95
+ *
96
+ * @default true
97
+ */
98
+ yaml?: boolean;
99
+ /**
100
+ * Enable Markdown support.
101
+ *
102
+ * @default true
103
+ */
104
+ markdown?: boolean;
105
+ /**
106
+ * Enable stylistic rules.
107
+ *
108
+ * @default true
109
+ */
110
+ stylistic?: boolean;
111
+ /**
112
+ * Control to disable some rules in editors.
113
+ * @default auto-detect based on the process.env
114
+ */
115
+ isInEditor?: boolean;
116
+ }
117
+
118
+ /**
119
+ * Construct an array of ESLint flat config items.
120
+ */
121
+ declare function coderwyd(options?: OptionsConfig & FlatESLintConfigItem, ...userConfigs: (FlatESLintConfigItem | FlatESLintConfigItem[])[]): FlatESLintConfigItem[];
122
+
123
+ declare const comments: FlatESLintConfigItem[];
124
+
125
+ declare const ignores: FlatESLintConfigItem[];
126
+
127
+ declare const imports: FlatESLintConfigItem[];
128
+
129
+ declare function javascript(options?: OptionsIsInEditor): FlatESLintConfigItem[];
130
+
131
+ declare const jsdoc: FlatESLintConfigItem[];
132
+
133
+ declare const jsonc: FlatESLintConfigItem[];
134
+
135
+ declare function markdown(options?: OptionsComponentExts): FlatESLintConfigItem[];
136
+
137
+ declare const node: FlatESLintConfigItem[];
138
+
139
+ /**
140
+ * Sort package.json
141
+ *
142
+ * Requires `jsonc` config
143
+ */
144
+ declare const sortPackageJson: FlatESLintConfigItem[];
145
+ /**
146
+ * Sort tsconfig.json
147
+ *
148
+ * Requires `jsonc` config
149
+ */
150
+ declare const sortTsconfig: FlatESLintConfigItem[];
151
+
152
+ declare const stylistic: FlatESLintConfigItem[];
153
+
154
+ declare function typescript(options?: OptionsComponentExts): FlatESLintConfigItem[];
155
+ declare function typescriptWithLanguageServer(options: OptionsTypeScriptWithLanguageServer & OptionsComponentExts): FlatESLintConfigItem[];
156
+
157
+ declare const unicorn: FlatESLintConfigItem[];
158
+
159
+ declare function getVueVersion(): number;
160
+ declare function vue(options?: OptionsHasTypeScript): FlatESLintConfigItem[];
161
+
162
+ declare const yml: FlatESLintConfigItem[];
163
+
164
+ declare function test(options?: OptionsIsInEditor): FlatESLintConfigItem[];
165
+
166
+ declare function react(options?: OptionsHasTypeScript): FlatESLintConfigItem[];
167
+
168
+ declare function astro(options?: OptionsHasTypeScript): FlatESLintConfigItem[];
169
+
170
+ /**
171
+ * Combine array and non-array configs into a single array.
172
+ */
173
+ declare function combine(...configs: (FlatESLintConfigItem | FlatESLintConfigItem[])[]): FlatESLintConfigItem[];
174
+ declare function renameRules(rules: Record<string, any>, from: string, to: string): {
175
+ [k: string]: any;
176
+ };
177
+
178
+ export { OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsTypeScriptWithLanguageServer, astro, coderwyd, combine, comments, coderwyd as default, getVueVersion, ignores, imports, javascript, jsdoc, jsonc, markdown, node, react, renameRules, sortPackageJson, sortTsconfig, stylistic, test, typescript, typescriptWithLanguageServer, unicorn, vue, yml };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { FlatESLintConfigItem } from 'eslint-define-config';
2
+ import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
2
3
  export { default as pluginAntfu } from 'eslint-plugin-antfu';
3
4
  export { default as pluginComments } from 'eslint-plugin-eslint-comments';
4
5
  export { default as pluginImport } from 'eslint-plugin-i';
@@ -6,8 +7,7 @@ export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
6
7
  export { default as pluginJsonc } from 'eslint-plugin-jsonc';
7
8
  export { default as pluginMarkdown } from 'eslint-plugin-markdown';
8
9
  export { default as pluginNode } from 'eslint-plugin-n';
9
- export { default as pluginStylisticJs } from '@stylistic/eslint-plugin-js';
10
- export { default as pluginStylisticTs } from '@stylistic/eslint-plugin-ts';
10
+ export { default as pluginStylistic } from '@stylistic/eslint-plugin';
11
11
  export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
12
12
  export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
13
13
  export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
@@ -16,10 +16,12 @@ export { default as pluginYml } from 'eslint-plugin-yml';
16
16
  export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests';
17
17
  export { default as pluginReact } from 'eslint-plugin-react';
18
18
  export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
19
+ export { default as pluginAstro } from 'eslint-plugin-astro';
19
20
  export { default as parserTs } from '@typescript-eslint/parser';
20
21
  export { default as parserVue } from 'vue-eslint-parser';
21
22
  export { default as parserYml } from 'yaml-eslint-parser';
22
23
  export { default as parserJsonc } from 'jsonc-eslint-parser';
24
+ export { default as parserAstro } from 'astro-eslint-parser';
23
25
 
24
26
  interface OptionsComponentExts {
25
27
  /**
@@ -41,6 +43,15 @@ interface OptionsIsInEditor {
41
43
  isInEditor?: boolean;
42
44
  }
43
45
  interface OptionsConfig {
46
+ /**
47
+ * Enable gitignore support.
48
+ *
49
+ * Passing an object to configure the options.
50
+ *
51
+ * @see https://github.com/antfu/eslint-config-flat-gitignore
52
+ * @default true
53
+ */
54
+ gitignore?: boolean | FlatGitignoreOptions;
44
55
  /**
45
56
  * Enable TypeScript support.
46
57
  *
@@ -61,6 +72,18 @@ interface OptionsConfig {
61
72
  * @default auto-detect based on the dependencies
62
73
  */
63
74
  vue?: boolean;
75
+ /**
76
+ * Enable React support.
77
+ *
78
+ * @default auto-detect based on the dependencies
79
+ */
80
+ react?: boolean;
81
+ /**
82
+ * Enable Astro support.
83
+ *
84
+ * @default auto-detect based on the dependencies
85
+ */
86
+ astro?: boolean;
64
87
  /**
65
88
  * Enable JSONC support.
66
89
  *
@@ -95,7 +118,7 @@ interface OptionsConfig {
95
118
  /**
96
119
  * Construct an array of ESLint flat config items.
97
120
  */
98
- declare function coderwyd(options?: OptionsConfig, ...userConfigs: (FlatESLintConfigItem | FlatESLintConfigItem[])[]): FlatESLintConfigItem[];
121
+ declare function coderwyd(options?: OptionsConfig & FlatESLintConfigItem, ...userConfigs: (FlatESLintConfigItem | FlatESLintConfigItem[])[]): FlatESLintConfigItem[];
99
122
 
100
123
  declare const comments: FlatESLintConfigItem[];
101
124
 
@@ -126,8 +149,7 @@ declare const sortPackageJson: FlatESLintConfigItem[];
126
149
  */
127
150
  declare const sortTsconfig: FlatESLintConfigItem[];
128
151
 
129
- declare const javascriptStylistic: FlatESLintConfigItem[];
130
- declare const typescriptStylistic: FlatESLintConfigItem[];
152
+ declare const stylistic: FlatESLintConfigItem[];
131
153
 
132
154
  declare function typescript(options?: OptionsComponentExts): FlatESLintConfigItem[];
133
155
  declare function typescriptWithLanguageServer(options: OptionsTypeScriptWithLanguageServer & OptionsComponentExts): FlatESLintConfigItem[];
@@ -143,6 +165,8 @@ declare function test(options?: OptionsIsInEditor): FlatESLintConfigItem[];
143
165
 
144
166
  declare function react(options?: OptionsHasTypeScript): FlatESLintConfigItem[];
145
167
 
168
+ declare function astro(options?: OptionsHasTypeScript): FlatESLintConfigItem[];
169
+
146
170
  /**
147
171
  * Combine array and non-array configs into a single array.
148
172
  */
@@ -151,4 +175,4 @@ declare function renameRules(rules: Record<string, any>, from: string, to: strin
151
175
  [k: string]: any;
152
176
  };
153
177
 
154
- export { OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsTypeScriptWithLanguageServer, coderwyd, combine, comments, coderwyd as default, getVueVersion, ignores, imports, javascript, javascriptStylistic, jsdoc, jsonc, markdown, node, react, renameRules, sortPackageJson, sortTsconfig, test, typescript, typescriptStylistic, typescriptWithLanguageServer, unicorn, vue, yml };
178
+ export { OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsTypeScriptWithLanguageServer, astro, coderwyd, combine, comments, coderwyd as default, getVueVersion, ignores, imports, javascript, jsdoc, jsonc, markdown, node, react, renameRules, sortPackageJson, sortTsconfig, stylistic, test, typescript, typescriptWithLanguageServer, unicorn, vue, yml };