@debbl/eslint-config 3.10.2 → 3.12.0

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 CHANGED
@@ -32,22 +32,22 @@ pnpm i eslint @debbl/eslint-config -D
32
32
  - prettier
33
33
 
34
34
  ```js
35
- import { defineConfig } from "@debbl/eslint-config";
35
+ import { defineConfig } from '@debbl/eslint-config'
36
36
 
37
- export default defineConfig();
37
+ export default defineConfig()
38
38
  ```
39
39
 
40
40
  ## Config `Prettier`, will override default rules
41
41
 
42
42
  ```js
43
- import { defineConfig } from "@debbl/eslint-config";
43
+ import { defineConfig } from '@debbl/eslint-config'
44
44
 
45
45
  export default defineConfig({
46
46
  typescript: true,
47
47
  prettier: {
48
48
  semi: false,
49
49
  },
50
- });
50
+ })
51
51
  ```
52
52
 
53
53
  ## Full OptionConfig
package/dist/index.d.ts CHANGED
@@ -1,50 +1,63 @@
1
- import { ParserOptions } from '@typescript-eslint/parser';
2
- import { Linter } from 'eslint';
3
- import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
4
- import { RequiredOptions } from 'prettier';
1
+ import { ParserOptions } from "@typescript-eslint/parser";
2
+ import { FlatGitignoreOptions } from "eslint-config-flat-gitignore";
3
+ import { Linter } from "eslint";
4
+ import { RequiredOptions } from "prettier";
5
5
 
6
+ //#region src/configs/comments.d.ts
6
7
  declare function comments(): Promise<ConfigItem[]>;
7
-
8
+ //#endregion
9
+ //#region src/configs/ignores.d.ts
8
10
  type IgnoresConfig = (options: {
9
- enableGitignore?: boolean | Omit<FlatGitignoreOptions, "name">;
10
- files?: ((files: string[]) => string[]) | string[];
11
+ enableGitignore?: boolean | Omit<FlatGitignoreOptions, 'name'>;
12
+ files?: ((files: string[]) => string[]) | string[];
11
13
  }) => ReturnType<ConfigFn>;
12
14
  declare const ignores: IgnoresConfig;
13
-
15
+ //#endregion
16
+ //#region src/configs/imports.d.ts
14
17
  declare function imports(): Promise<ConfigItem[]>;
15
-
18
+ //#endregion
19
+ //#region src/configs/javascript.d.ts
16
20
  type JavascriptConfig = ConfigFn;
17
21
  declare const javascript: JavascriptConfig;
18
-
22
+ //#endregion
23
+ //#region src/configs/jsdoc.d.ts
19
24
  declare function jsdoc(): Promise<ConfigItem[]>;
20
-
25
+ //#endregion
26
+ //#region src/configs/jsonc.d.ts
21
27
  type JsoncConfig = ConfigFn;
22
28
  declare const jsonc: JsoncConfig;
23
-
29
+ //#endregion
30
+ //#region src/configs/markdown.d.ts
24
31
  type MarkdownConfig = (options: {
25
- componentExts?: string[];
26
- /**
27
- * @deprecated remove this option
28
- */
29
- mdx?: boolean;
32
+ componentExts?: string[];
33
+ /**
34
+ * @deprecated remove this option
35
+ */
36
+ mdx?: boolean;
30
37
  } & OptionsOverrides) => ReturnType<ConfigFn>;
31
38
  declare const markdown: MarkdownConfig;
32
-
39
+ //#endregion
40
+ //#region src/configs/node.d.ts
33
41
  declare function node(): Promise<ConfigItem[]>;
34
-
42
+ //#endregion
43
+ //#region src/configs/perfectionist.d.ts
35
44
  /**
36
45
  * Perfectionist plugin for props and items sorting.
37
46
  *
38
47
  * @see https://github.com/azat-io/eslint-plugin-perfectionist
39
48
  */
40
49
  declare function perfectionist(): Promise<ConfigItem[]>;
41
-
50
+ //#endregion
51
+ //#region src/configs/prettier.d.ts
42
52
  type PrettierRequiredOptions = Partial<RequiredOptions>;
43
- type PrettierConfig = ({ options, }: PrettierRequiredOptions & {
44
- tailwindcss?: boolean;
53
+ type PrettierConfig = ({
54
+ options
55
+ }: PrettierRequiredOptions & {
56
+ tailwindcss?: boolean;
45
57
  }) => Promise<ConfigItem[]>;
46
58
  declare const prettier: PrettierConfig;
47
-
59
+ //#endregion
60
+ //#region src/configs/sort.d.ts
48
61
  /**
49
62
  * Sort package.json
50
63
  *
@@ -57,166 +70,176 @@ declare function sortPackageJson(): Promise<ConfigItem[]>;
57
70
  * Requires `jsonc` config
58
71
  */
59
72
  declare function sortTsconfig(): Promise<ConfigItem[]>;
60
-
73
+ //#endregion
74
+ //#region src/configs/test.d.ts
61
75
  type TestConfig = ConfigFn;
62
76
  declare const test: TestConfig;
63
-
77
+ //#endregion
78
+ //#region src/configs/toml.d.ts
64
79
  type TomlConfig = ConfigFn;
65
80
  declare const toml: TomlConfig;
66
-
81
+ //#endregion
82
+ //#region src/configs/typescript.d.ts
67
83
  type TypeScriptConfig = (options?: OptionsComponentExts & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsOverrides & {
68
- enableSolid?: boolean;
84
+ enableSolid?: boolean;
69
85
  }) => ReturnType<ConfigFn>;
70
86
  declare const typescript: TypeScriptConfig;
71
-
87
+ //#endregion
88
+ //#region src/configs/unicorn.d.ts
72
89
  declare function unicorn(): Promise<ConfigItem[]>;
73
-
90
+ //#endregion
91
+ //#region src/configs/vue.d.ts
74
92
  type VueConfig = (options: OptionsHasTypeScript & OptionsOverrides) => ReturnType<ConfigFn>;
75
93
  declare const vue: VueConfig;
76
-
94
+ //#endregion
95
+ //#region src/configs/yml.d.ts
77
96
  type YmlConfig = (options: OptionsOverrides) => ReturnType<ConfigFn>;
78
97
  declare const yml: YmlConfig;
79
-
98
+ //#endregion
99
+ //#region src/configs/react.d.ts
80
100
  type ReactConfig = (options: {
81
- next?: boolean;
82
- compiler?: boolean;
101
+ next?: boolean;
102
+ compiler?: boolean;
83
103
  } & OptionsOverrides) => ReturnType<ConfigFn>;
84
-
104
+ //#endregion
105
+ //#region src/types.d.ts
85
106
  type Awaitable<T> = T | Promise<T>;
86
107
  type GetConfigOption<T extends (...args: any) => any> = Parameters<T>[0];
87
108
  interface ConfigItem extends Linter.Config {
88
- /**
89
- * 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.
90
- *
91
- * @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
92
- */
93
- plugins?: Record<string, any>;
109
+ /**
110
+ * 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.
111
+ *
112
+ * @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
113
+ */
114
+ plugins?: Record<string, any>;
94
115
  }
95
116
  interface OptionsOverrides {
96
- overrides?: ConfigItem["rules"];
117
+ overrides?: ConfigItem['rules'];
97
118
  }
98
119
  type ConfigFn = (options: OptionsOverrides) => Awaitable<ConfigItem[]>;
99
120
  interface OptionsComponentExts {
100
- /**
101
- * Additional extensions for components.
102
- *
103
- * @example ['vue']
104
- * @default []
105
- */
106
- componentExts?: string[];
121
+ /**
122
+ * Additional extensions for components.
123
+ *
124
+ * @example ['vue']
125
+ * @default []
126
+ */
127
+ componentExts?: string[];
107
128
  }
108
129
  interface OptionsTypeScriptParserOptions {
109
- /**
110
- * Additional parser options for TypeScript.
111
- */
112
- parserOptions?: Partial<ParserOptions>;
130
+ /**
131
+ * Additional parser options for TypeScript.
132
+ */
133
+ parserOptions?: Partial<ParserOptions>;
113
134
  }
114
135
  interface OptionsTypeScriptWithTypes {
115
- /**
116
- * When this options is provided, type aware rules will be enabled.
117
- * @see https://typescript-eslint.io/linting/typed-linting/
118
- */
119
- tsconfigPath?: string;
136
+ /**
137
+ * When this options is provided, type aware rules will be enabled.
138
+ * @see https://typescript-eslint.io/linting/typed-linting/
139
+ */
140
+ tsconfigPath?: string;
120
141
  }
121
142
  interface OptionsHasTypeScript {
122
- typescript?: boolean;
143
+ typescript?: boolean;
123
144
  }
124
145
  interface OptionsConfig extends OptionsComponentExts {
125
- /**
126
- * Enable gitignore support.
127
- * Passing an object to configure the options.
128
- * @default true
129
- */
130
- gitignore?: boolean | FlatGitignoreOptions;
131
- /**
132
- * Enable gitignore support.
133
- * Passing an object to configure the options.
134
- * @default true
135
- */
136
- ignores?: boolean | GetConfigOption<IgnoresConfig>;
137
- /**
138
- * Enable JavaScript support.
139
- * Passing an object to configure the options.
140
- * @default true
141
- */
142
- javascript?: GetConfigOption<JavascriptConfig>;
143
- /**
144
- * Enable TypeScript support.
145
- *
146
- * Passing an object to enable TypeScript Language Server support.
147
- *
148
- * @default false
149
- */
150
- typescript?: boolean | GetConfigOption<TypeScriptConfig>;
151
- /**
152
- * Enable test support.
153
- *
154
- * @default true
155
- */
156
- test?: boolean | GetConfigOption<TestConfig>;
157
- /**
158
- * Enable Vue support.
159
- *
160
- * @default false
161
- */
162
- vue?: boolean | GetConfigOption<VueConfig>;
163
- /**
164
- * Enable React support, Passing an object to enable Next.js support.
165
- *
166
- * @default false
167
- */
168
- react?: boolean | GetConfigOption<ReactConfig>;
169
- /**
170
- * Enable solid support, Passing an object to enable Next.js support.
171
- *
172
- * @default false
173
- */
174
- solid?: boolean;
175
- /**
176
- * Enable JSONC support.
177
- *
178
- * @default true
179
- */
180
- jsonc?: boolean | GetConfigOption<JsoncConfig>;
181
- /**
182
- * Enable YML support.
183
- *
184
- * @default true
185
- */
186
- yml?: boolean | GetConfigOption<YmlConfig>;
187
- /**
188
- * Enable TOML support.
189
- * @default true
190
- */
191
- toml?: boolean | GetConfigOption<TomlConfig>;
192
- /**
193
- * Enable Markdown support.
194
- *
195
- * @default true
196
- */
197
- markdown?: boolean | GetConfigOption<MarkdownConfig>;
198
- /**
199
- * Enable prettier rules.
200
- *
201
- * @default true
202
- */
203
- prettier?: boolean | Omit<GetConfigOption<PrettierConfig>, "tailwindcss">;
204
- /**
205
- * Enable Tailwind CSS support.
206
- *
207
- * if set to "prettier", it will use `prettier-plugin-tailwindcss`
208
- * @see https://github.com/tailwindlabs/prettier-plugin-tailwindcss
209
- *
210
- * @default false
211
- */
212
- tailwindcss?: boolean | "prettier";
146
+ /**
147
+ * Enable gitignore support.
148
+ * Passing an object to configure the options.
149
+ * @default true
150
+ */
151
+ gitignore?: boolean | FlatGitignoreOptions;
152
+ /**
153
+ * Enable gitignore support.
154
+ * Passing an object to configure the options.
155
+ * @default true
156
+ */
157
+ ignores?: boolean | GetConfigOption<IgnoresConfig>;
158
+ /**
159
+ * Enable JavaScript support.
160
+ * Passing an object to configure the options.
161
+ * @default true
162
+ */
163
+ javascript?: GetConfigOption<JavascriptConfig>;
164
+ /**
165
+ * Enable TypeScript support.
166
+ *
167
+ * Passing an object to enable TypeScript Language Server support.
168
+ *
169
+ * @default false
170
+ */
171
+ typescript?: boolean | GetConfigOption<TypeScriptConfig>;
172
+ /**
173
+ * Enable test support.
174
+ *
175
+ * @default true
176
+ */
177
+ test?: boolean | GetConfigOption<TestConfig>;
178
+ /**
179
+ * Enable Vue support.
180
+ *
181
+ * @default false
182
+ */
183
+ vue?: boolean | GetConfigOption<VueConfig>;
184
+ /**
185
+ * Enable React support, Passing an object to enable Next.js support.
186
+ *
187
+ * @default false
188
+ */
189
+ react?: boolean | GetConfigOption<ReactConfig>;
190
+ /**
191
+ * Enable solid support, Passing an object to enable Next.js support.
192
+ *
193
+ * @default false
194
+ */
195
+ solid?: boolean;
196
+ /**
197
+ * Enable JSONC support.
198
+ *
199
+ * @default true
200
+ */
201
+ jsonc?: boolean | GetConfigOption<JsoncConfig>;
202
+ /**
203
+ * Enable YML support.
204
+ *
205
+ * @default true
206
+ */
207
+ yml?: boolean | GetConfigOption<YmlConfig>;
208
+ /**
209
+ * Enable TOML support.
210
+ * @default true
211
+ */
212
+ toml?: boolean | GetConfigOption<TomlConfig>;
213
+ /**
214
+ * Enable Markdown support.
215
+ *
216
+ * @default true
217
+ */
218
+ markdown?: boolean | GetConfigOption<MarkdownConfig>;
219
+ /**
220
+ * Enable prettier rules.
221
+ *
222
+ * @default true
223
+ */
224
+ prettier?: boolean | Omit<GetConfigOption<PrettierConfig>, 'tailwindcss'>;
225
+ /**
226
+ * Enable Tailwind CSS support.
227
+ *
228
+ * if set to "prettier", it will use `prettier-plugin-tailwindcss`
229
+ * @see https://github.com/tailwindlabs/prettier-plugin-tailwindcss
230
+ *
231
+ * @default false
232
+ */
233
+ tailwindcss?: boolean | 'prettier';
213
234
  }
214
-
235
+ //#endregion
236
+ //#region src/factory.d.ts
215
237
  /**
216
238
  * Construct an array of ESLint flat config items.
217
239
  */
218
240
  declare function defineConfig(options?: OptionsConfig, ...userConfigs: ConfigItem[]): Promise<ConfigItem[]>;
219
-
241
+ //#endregion
242
+ //#region src/globs.d.ts
220
243
  declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
221
244
  declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
222
245
  declare const GLOB_JS = "**/*.?([cm])js";
@@ -242,39 +265,40 @@ declare const GLOB_HTML = "**/*.htm?(l)";
242
265
  declare const GLOB_TESTS: string[];
243
266
  declare const GLOB_ALL_SRC: string[];
244
267
  declare const GLOB_EXCLUDE: string[];
245
-
268
+ //#endregion
269
+ //#region src/utils.d.ts
246
270
  declare const parserPlain: {
247
- meta: {
248
- name: string;
271
+ meta: {
272
+ name: string;
273
+ };
274
+ parseForESLint: (code: string) => {
275
+ ast: {
276
+ body: never[];
277
+ comments: never[];
278
+ loc: {
279
+ end: number;
280
+ start: number;
281
+ };
282
+ range: number[];
283
+ tokens: never[];
284
+ type: string;
249
285
  };
250
- parseForESLint: (code: string) => {
251
- ast: {
252
- body: never[];
253
- comments: never[];
254
- loc: {
255
- end: number;
256
- start: number;
257
- };
258
- range: number[];
259
- tokens: never[];
260
- type: string;
261
- };
262
- scopeManager: null;
263
- services: {
264
- isPlain: boolean;
265
- };
266
- visitorKeys: {
267
- Program: never[];
268
- };
286
+ scopeManager: null;
287
+ services: {
288
+ isPlain: boolean;
269
289
  };
290
+ visitorKeys: {
291
+ Program: never[];
292
+ };
293
+ };
270
294
  };
271
295
  /**
272
296
  * Combine array and non-array configs into a single array.
273
297
  */
274
298
  declare function combine(...configs: Awaitable<ConfigItem | ConfigItem[]>[]): Promise<ConfigItem[]>;
275
299
  declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
276
- default: infer U;
300
+ default: infer U;
277
301
  } ? U : T>;
278
302
  declare function getConfigOptions<T>(options: T): {};
279
-
280
- export { type Awaitable, type ConfigFn, type ConfigItem, GLOB_ALL_SRC, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MDX, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type GetConfigOption, type IgnoresConfig, type JavascriptConfig, type JsoncConfig, type MarkdownConfig, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsOverrides, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierConfig, type PrettierRequiredOptions, type TestConfig, type TomlConfig, type TypeScriptConfig, type VueConfig, type YmlConfig, combine, comments, defineConfig as default, defineConfig, getConfigOptions, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, prettier, sortPackageJson, sortTsconfig, test, toml, typescript, unicorn, vue, yml };
303
+ //#endregion
304
+ export { Awaitable, ConfigFn, ConfigItem, GLOB_ALL_SRC, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MDX, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, GetConfigOption, IgnoresConfig, JavascriptConfig, JsoncConfig, MarkdownConfig, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsOverrides, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, PrettierConfig, PrettierRequiredOptions, TestConfig, TomlConfig, TypeScriptConfig, VueConfig, YmlConfig, combine, comments, defineConfig as default, defineConfig, getConfigOptions, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, prettier, sortPackageJson, sortTsconfig, test, toml, typescript, unicorn, vue, yml };