@jsse/eslint-config 0.1.0 → 0.1.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/dist/index.d.cts CHANGED
@@ -1,36 +1,38 @@
1
- import { MergeIntersection, RenamePrefix, TypeScriptRules, VitestRules, YmlRules, NRules, ImportRules, EslintRules, JsoncRules, VueRules, UnicornRules, EslintCommentsRules, RuleConfig, FlatESLintConfigItem } from '@antfu/eslint-define-config';
1
+ import { MergeIntersection, TypeScriptRules, VitestRules, YmlRules, NRules, ImportRules, EslintRules, JsoncRules, UnicornRules, EslintCommentsRules, RuleConfig, FlatESLintConfigItem } from '@antfu/eslint-define-config';
2
2
  import { ParserOptions } from '@typescript-eslint/parser';
3
3
  import * as parser from '@typescript-eslint/parser';
4
4
  export { parser as parserTs };
5
5
  import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
6
6
  export { default as pluginStylistic } from '@stylistic/eslint-plugin';
7
7
  export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
8
+ export { default as pluginAntfu } from 'eslint-plugin-antfu';
8
9
  export { default as pluginEslintComments } from 'eslint-plugin-eslint-comments';
9
10
  import * as eslintPluginI from 'eslint-plugin-i';
10
11
  export { eslintPluginI as pluginImport };
11
12
  export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
12
13
  import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
13
14
  export { eslintPluginJsonc as pluginJsonc };
14
- export { default as pluginNode } from 'eslint-plugin-n';
15
+ export { default as pluginMarkdown } from 'eslint-plugin-markdown';
16
+ export { default as pluginN } from 'eslint-plugin-n';
15
17
  export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests';
18
+ export { default as pluginPerfectionist } from 'eslint-plugin-perfectionist';
16
19
  export { default as pluginReact } from 'eslint-plugin-react';
17
20
  export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
18
21
  import * as eslintPluginReactRefresh from 'eslint-plugin-react-refresh';
19
22
  export { eslintPluginReactRefresh as pluginReactRefresh };
20
23
  import * as eslintPluginSortKeys from 'eslint-plugin-sort-keys';
21
24
  export { eslintPluginSortKeys as pluginSortKeys };
25
+ export { default as pluginTailwind } from 'eslint-plugin-tailwindcss';
22
26
  export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
23
27
  export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
24
- export { default as pluginTailwind } from 'eslint-plugin-tailwindcss';
25
28
  export { default as pluginVitest } from 'eslint-plugin-vitest';
26
29
  export { default as parserJsonc } from 'jsonc-eslint-parser';
27
- export { default as pluginMarkdown } from 'eslint-plugin-markdown';
28
- export { default as pluginPerfectionist } from 'eslint-plugin-perfectionist';
29
30
 
30
- 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 & {
31
- "test/no-only-tests": RuleConfig;
31
+ type Awaitable<T> = T | Promise<T>;
32
+ type Rules = MergeIntersection<TypeScriptRules & VitestRules & YmlRules & NRules & ImportRules & EslintRules & JsoncRules & UnicornRules & EslintCommentsRules & {
33
+ "no-only-tests/no-only-tests": RuleConfig;
32
34
  }>;
33
- type ConfigItem = Omit<FlatESLintConfigItem<Rules, false>, "plugins"> & {
35
+ type FlatConfigItem = Omit<FlatESLintConfigItem<Rules, false>, "plugins"> & {
34
36
  /**
35
37
  * Custom name of each config item
36
38
  */
@@ -60,6 +62,14 @@ type OptionsComponentExts = {
60
62
  */
61
63
  componentExts?: string[];
62
64
  };
65
+ type PromiseFlatConfigItem = Promise<FlatConfigItem[]>;
66
+ type EslintConfigFn<T = undefined> = (options?: T) => PromiseFlatConfigItem;
67
+ type OptionsFiles = {
68
+ /**
69
+ * Override the `files` option to provide custom globs.
70
+ */
71
+ files?: string[];
72
+ };
63
73
  type OptionsTypeScriptParserOptions = {
64
74
  /**
65
75
  * Additional parser options for TypeScript.
@@ -92,7 +102,7 @@ type OptionsPrefix = {
92
102
  };
93
103
  };
94
104
  type OptionsOverrides = {
95
- overrides?: ConfigItem["rules"];
105
+ overrides?: FlatConfigItem["rules"];
96
106
  };
97
107
  type OptionsIsInEditor = {
98
108
  isInEditor?: boolean;
@@ -111,6 +121,10 @@ type OptionsConfig = {
111
121
  off?: string[];
112
122
  fast?: boolean;
113
123
  prettier?: boolean;
124
+ /**
125
+ * Optional function to run before the final config is returned.
126
+ */
127
+ preReturn?: (configs: FlatConfigItem[]) => FlatConfigItem[] | Awaitable<FlatConfigItem[]>;
114
128
  /**
115
129
  * Enable gitignore support.
116
130
  *
@@ -179,37 +193,46 @@ type OptionsConfig = {
179
193
  * Provide overrides for rules for each integration.
180
194
  */
181
195
  overrides?: {
182
- javascript?: ConfigItem["rules"];
183
- typescript?: ConfigItem["rules"];
184
- test?: ConfigItem["rules"];
185
- jsonc?: ConfigItem["rules"];
186
- markdown?: ConfigItem["rules"];
187
- yaml?: ConfigItem["rules"];
196
+ javascript?: FlatConfigItem["rules"];
197
+ typescript?: FlatConfigItem["rules"];
198
+ test?: FlatConfigItem["rules"];
199
+ jsonc?: FlatConfigItem["rules"];
200
+ markdown?: FlatConfigItem["rules"];
201
+ yaml?: FlatConfigItem["rules"];
188
202
  };
189
203
  } & OptionsComponentExts;
190
204
 
191
- declare function comments(): ConfigItem[];
205
+ declare const comments: EslintConfigFn;
192
206
 
193
- declare function ignores(): ConfigItem[];
207
+ declare const ignores: EslintConfigFn;
194
208
 
195
- declare function imports(options?: OptionsStylistic): ConfigItem[];
209
+ declare const imports: EslintConfigFn<OptionsStylistic>;
196
210
 
197
- declare function javascript(options?: OptionsIsInEditor & OptionsOverrides & {
211
+ type JavascriptOptions = OptionsIsInEditor & OptionsOverrides & {
198
212
  reportUnusedDisableDirectives?: boolean;
199
- }): ConfigItem[];
213
+ };
214
+ declare const javascript: EslintConfigFn<JavascriptOptions>;
200
215
 
201
- declare function jsdoc(options?: OptionsStylistic): ConfigItem[];
216
+ declare const jsdoc: EslintConfigFn;
202
217
 
203
- declare function jsonc(options?: OptionsStylistic & OptionsOverrides): ConfigItem[];
218
+ type JsoncOptions = OptionsStylistic & OptionsOverrides;
219
+ declare const jsonc: EslintConfigFn<JsoncOptions>;
204
220
 
205
- declare function node(): ConfigItem[];
221
+ declare const n: EslintConfigFn;
222
+
223
+ /**
224
+ * Optional perfectionist plugin for props and items sorting.
225
+ *
226
+ * @see https://github.com/azat-io/eslint-plugin-perfectionist
227
+ */
228
+ declare const perfectionist: EslintConfigFn;
206
229
 
207
230
  /**
208
231
  * Copied from https://raw.githubusercontent.com/prettier/eslint-config-prettier/main/index.js
209
232
  * Main difference is we exclude rules we don't care about.... (flow/babel/etc)
210
233
  */
211
- declare function eslintConfigPrettierRules(): ConfigItem["rules"];
212
- declare function prettier(): ConfigItem[];
234
+ declare function eslintConfigPrettierRules(): FlatConfigItem["rules"];
235
+ declare const prettier: EslintConfigFn;
213
236
 
214
237
  declare function reactRules(): {
215
238
  "react-hooks/exhaustive-deps": string;
@@ -339,38 +362,33 @@ declare function reactHooks(): {
339
362
  "react-hooks/rules-of-hooks": string;
340
363
  };
341
364
  }[];
342
- declare function react(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsReact): ConfigItem[];
365
+ type ReactOptions = OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsReact;
366
+ declare const react: EslintConfigFn<ReactOptions>;
343
367
 
344
368
  /**
345
369
  * Sort package.json
346
370
  *
347
371
  * Requires `jsonc` config
348
372
  */
349
- declare function sortPackageJson(): ConfigItem[];
373
+ declare const sortPackageJson: EslintConfigFn;
350
374
  /**
351
375
  * Sort tsconfig.json
352
376
  *
353
377
  * Requires `jsonc` config
354
378
  */
355
- declare function sortTsconfig(): ConfigItem[];
379
+ declare const sortTsconfig: EslintConfigFn;
356
380
 
357
- declare function test(options?: OptionsIsInEditor & OptionsOverrides): ConfigItem[];
381
+ type TestOptions = OptionsIsInEditor & OptionsOverrides;
382
+ declare const test: EslintConfigFn<TestOptions>;
358
383
 
359
- declare function typescript(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsReact & OptionsPrefix): ConfigItem[];
384
+ declare function typescript(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsReact & OptionsPrefix): Promise<FlatConfigItem[]>;
360
385
 
361
- declare function unicorn(): ConfigItem[];
362
-
363
- /**
364
- * Optional perfectionist plugin for props and items sorting.
365
- *
366
- * @see https://github.com/azat-io/eslint-plugin-perfectionist
367
- */
368
- declare function perfectionist(): ConfigItem[];
386
+ declare const unicorn: EslintConfigFn;
369
387
 
370
388
  /**
371
389
  * Construct an array of ESLint flat config items.
372
390
  */
373
- declare function jsse(options?: OptionsConfig & ConfigItem, ...userConfigs: (ConfigItem | ConfigItem[])[]): ConfigItem[];
391
+ declare function jsse(options?: OptionsConfig & FlatConfigItem, ...userConfigs: (FlatConfigItem | FlatConfigItem[])[]): Promise<FlatConfigItem[]>;
374
392
 
375
393
  declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
376
394
  declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
@@ -396,12 +414,19 @@ declare const GLOB_EXCLUDE: string[];
396
414
  /**
397
415
  * Combine array and non-array configs into a single array.
398
416
  */
399
- declare function combine(...configs: (ConfigItem | ConfigItem[])[]): ConfigItem[];
417
+ declare function combine(...configs: (FlatConfigItem | FlatConfigItem[])[]): FlatConfigItem[];
418
+ /**
419
+ * Combine array and non-array configs into a single array.
420
+ */
421
+ declare function combineAsync<T>(...configs: Awaitable<T | T[]>[]): Promise<T[]>;
400
422
  declare function renameRules<TRule = unknown>(rules: Record<string, TRule>, from: string, to: string): Record<string, TRule>;
423
+ declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
424
+ default: infer U;
425
+ } ? U : T>;
401
426
  declare function isCI(): boolean;
402
427
  declare function isInEditor(): boolean;
403
428
 
404
- declare function jssestd(): ConfigItem[];
405
- declare function jsseReact(): ConfigItem[];
429
+ declare function jssestd(): Promise<FlatConfigItem[]>;
430
+ declare function jsseReact(): Promise<FlatConfigItem[]>;
406
431
 
407
- export { type 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, type OptionsCommon, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsPrefix, type OptionsReact, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type Rules, type StylisticConfig, combine, comments, jsse as default, eslintConfigPrettierRules, ignores, imports, isCI, isInEditor, javascript, jsdoc, jsonc, jsse, jsseReact, jssestd, node, perfectionist, prettier, react, reactHooks, reactRules, renameRules, sortPackageJson, sortTsconfig, test, typescript, unicorn };
432
+ export { type Awaitable, type EslintConfigFn, type FlatConfigItem, 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, type OptionsCommon, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsPrefix, type OptionsReact, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PromiseFlatConfigItem, type Rules, type StylisticConfig, combine, combineAsync, comments, jsse as default, eslintConfigPrettierRules, ignores, imports, interopDefault, isCI, isInEditor, javascript, jsdoc, jsonc, jsse, jsseReact, jssestd, n, perfectionist, prettier, react, reactHooks, reactRules, renameRules, sortPackageJson, sortTsconfig, test, typescript, unicorn };
package/dist/index.d.ts CHANGED
@@ -1,36 +1,38 @@
1
- import { MergeIntersection, RenamePrefix, TypeScriptRules, VitestRules, YmlRules, NRules, ImportRules, EslintRules, JsoncRules, VueRules, UnicornRules, EslintCommentsRules, RuleConfig, FlatESLintConfigItem } from '@antfu/eslint-define-config';
1
+ import { MergeIntersection, TypeScriptRules, VitestRules, YmlRules, NRules, ImportRules, EslintRules, JsoncRules, UnicornRules, EslintCommentsRules, RuleConfig, FlatESLintConfigItem } from '@antfu/eslint-define-config';
2
2
  import { ParserOptions } from '@typescript-eslint/parser';
3
3
  import * as parser from '@typescript-eslint/parser';
4
4
  export { parser as parserTs };
5
5
  import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
6
6
  export { default as pluginStylistic } from '@stylistic/eslint-plugin';
7
7
  export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
8
+ export { default as pluginAntfu } from 'eslint-plugin-antfu';
8
9
  export { default as pluginEslintComments } from 'eslint-plugin-eslint-comments';
9
10
  import * as eslintPluginI from 'eslint-plugin-i';
10
11
  export { eslintPluginI as pluginImport };
11
12
  export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
12
13
  import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
13
14
  export { eslintPluginJsonc as pluginJsonc };
14
- export { default as pluginNode } from 'eslint-plugin-n';
15
+ export { default as pluginMarkdown } from 'eslint-plugin-markdown';
16
+ export { default as pluginN } from 'eslint-plugin-n';
15
17
  export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests';
18
+ export { default as pluginPerfectionist } from 'eslint-plugin-perfectionist';
16
19
  export { default as pluginReact } from 'eslint-plugin-react';
17
20
  export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
18
21
  import * as eslintPluginReactRefresh from 'eslint-plugin-react-refresh';
19
22
  export { eslintPluginReactRefresh as pluginReactRefresh };
20
23
  import * as eslintPluginSortKeys from 'eslint-plugin-sort-keys';
21
24
  export { eslintPluginSortKeys as pluginSortKeys };
25
+ export { default as pluginTailwind } from 'eslint-plugin-tailwindcss';
22
26
  export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
23
27
  export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
24
- export { default as pluginTailwind } from 'eslint-plugin-tailwindcss';
25
28
  export { default as pluginVitest } from 'eslint-plugin-vitest';
26
29
  export { default as parserJsonc } from 'jsonc-eslint-parser';
27
- export { default as pluginMarkdown } from 'eslint-plugin-markdown';
28
- export { default as pluginPerfectionist } from 'eslint-plugin-perfectionist';
29
30
 
30
- 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 & {
31
- "test/no-only-tests": RuleConfig;
31
+ type Awaitable<T> = T | Promise<T>;
32
+ type Rules = MergeIntersection<TypeScriptRules & VitestRules & YmlRules & NRules & ImportRules & EslintRules & JsoncRules & UnicornRules & EslintCommentsRules & {
33
+ "no-only-tests/no-only-tests": RuleConfig;
32
34
  }>;
33
- type ConfigItem = Omit<FlatESLintConfigItem<Rules, false>, "plugins"> & {
35
+ type FlatConfigItem = Omit<FlatESLintConfigItem<Rules, false>, "plugins"> & {
34
36
  /**
35
37
  * Custom name of each config item
36
38
  */
@@ -60,6 +62,14 @@ type OptionsComponentExts = {
60
62
  */
61
63
  componentExts?: string[];
62
64
  };
65
+ type PromiseFlatConfigItem = Promise<FlatConfigItem[]>;
66
+ type EslintConfigFn<T = undefined> = (options?: T) => PromiseFlatConfigItem;
67
+ type OptionsFiles = {
68
+ /**
69
+ * Override the `files` option to provide custom globs.
70
+ */
71
+ files?: string[];
72
+ };
63
73
  type OptionsTypeScriptParserOptions = {
64
74
  /**
65
75
  * Additional parser options for TypeScript.
@@ -92,7 +102,7 @@ type OptionsPrefix = {
92
102
  };
93
103
  };
94
104
  type OptionsOverrides = {
95
- overrides?: ConfigItem["rules"];
105
+ overrides?: FlatConfigItem["rules"];
96
106
  };
97
107
  type OptionsIsInEditor = {
98
108
  isInEditor?: boolean;
@@ -111,6 +121,10 @@ type OptionsConfig = {
111
121
  off?: string[];
112
122
  fast?: boolean;
113
123
  prettier?: boolean;
124
+ /**
125
+ * Optional function to run before the final config is returned.
126
+ */
127
+ preReturn?: (configs: FlatConfigItem[]) => FlatConfigItem[] | Awaitable<FlatConfigItem[]>;
114
128
  /**
115
129
  * Enable gitignore support.
116
130
  *
@@ -179,37 +193,46 @@ type OptionsConfig = {
179
193
  * Provide overrides for rules for each integration.
180
194
  */
181
195
  overrides?: {
182
- javascript?: ConfigItem["rules"];
183
- typescript?: ConfigItem["rules"];
184
- test?: ConfigItem["rules"];
185
- jsonc?: ConfigItem["rules"];
186
- markdown?: ConfigItem["rules"];
187
- yaml?: ConfigItem["rules"];
196
+ javascript?: FlatConfigItem["rules"];
197
+ typescript?: FlatConfigItem["rules"];
198
+ test?: FlatConfigItem["rules"];
199
+ jsonc?: FlatConfigItem["rules"];
200
+ markdown?: FlatConfigItem["rules"];
201
+ yaml?: FlatConfigItem["rules"];
188
202
  };
189
203
  } & OptionsComponentExts;
190
204
 
191
- declare function comments(): ConfigItem[];
205
+ declare const comments: EslintConfigFn;
192
206
 
193
- declare function ignores(): ConfigItem[];
207
+ declare const ignores: EslintConfigFn;
194
208
 
195
- declare function imports(options?: OptionsStylistic): ConfigItem[];
209
+ declare const imports: EslintConfigFn<OptionsStylistic>;
196
210
 
197
- declare function javascript(options?: OptionsIsInEditor & OptionsOverrides & {
211
+ type JavascriptOptions = OptionsIsInEditor & OptionsOverrides & {
198
212
  reportUnusedDisableDirectives?: boolean;
199
- }): ConfigItem[];
213
+ };
214
+ declare const javascript: EslintConfigFn<JavascriptOptions>;
200
215
 
201
- declare function jsdoc(options?: OptionsStylistic): ConfigItem[];
216
+ declare const jsdoc: EslintConfigFn;
202
217
 
203
- declare function jsonc(options?: OptionsStylistic & OptionsOverrides): ConfigItem[];
218
+ type JsoncOptions = OptionsStylistic & OptionsOverrides;
219
+ declare const jsonc: EslintConfigFn<JsoncOptions>;
204
220
 
205
- declare function node(): ConfigItem[];
221
+ declare const n: EslintConfigFn;
222
+
223
+ /**
224
+ * Optional perfectionist plugin for props and items sorting.
225
+ *
226
+ * @see https://github.com/azat-io/eslint-plugin-perfectionist
227
+ */
228
+ declare const perfectionist: EslintConfigFn;
206
229
 
207
230
  /**
208
231
  * Copied from https://raw.githubusercontent.com/prettier/eslint-config-prettier/main/index.js
209
232
  * Main difference is we exclude rules we don't care about.... (flow/babel/etc)
210
233
  */
211
- declare function eslintConfigPrettierRules(): ConfigItem["rules"];
212
- declare function prettier(): ConfigItem[];
234
+ declare function eslintConfigPrettierRules(): FlatConfigItem["rules"];
235
+ declare const prettier: EslintConfigFn;
213
236
 
214
237
  declare function reactRules(): {
215
238
  "react-hooks/exhaustive-deps": string;
@@ -339,38 +362,33 @@ declare function reactHooks(): {
339
362
  "react-hooks/rules-of-hooks": string;
340
363
  };
341
364
  }[];
342
- declare function react(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsReact): ConfigItem[];
365
+ type ReactOptions = OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsReact;
366
+ declare const react: EslintConfigFn<ReactOptions>;
343
367
 
344
368
  /**
345
369
  * Sort package.json
346
370
  *
347
371
  * Requires `jsonc` config
348
372
  */
349
- declare function sortPackageJson(): ConfigItem[];
373
+ declare const sortPackageJson: EslintConfigFn;
350
374
  /**
351
375
  * Sort tsconfig.json
352
376
  *
353
377
  * Requires `jsonc` config
354
378
  */
355
- declare function sortTsconfig(): ConfigItem[];
379
+ declare const sortTsconfig: EslintConfigFn;
356
380
 
357
- declare function test(options?: OptionsIsInEditor & OptionsOverrides): ConfigItem[];
381
+ type TestOptions = OptionsIsInEditor & OptionsOverrides;
382
+ declare const test: EslintConfigFn<TestOptions>;
358
383
 
359
- declare function typescript(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsReact & OptionsPrefix): ConfigItem[];
384
+ declare function typescript(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsReact & OptionsPrefix): Promise<FlatConfigItem[]>;
360
385
 
361
- declare function unicorn(): ConfigItem[];
362
-
363
- /**
364
- * Optional perfectionist plugin for props and items sorting.
365
- *
366
- * @see https://github.com/azat-io/eslint-plugin-perfectionist
367
- */
368
- declare function perfectionist(): ConfigItem[];
386
+ declare const unicorn: EslintConfigFn;
369
387
 
370
388
  /**
371
389
  * Construct an array of ESLint flat config items.
372
390
  */
373
- declare function jsse(options?: OptionsConfig & ConfigItem, ...userConfigs: (ConfigItem | ConfigItem[])[]): ConfigItem[];
391
+ declare function jsse(options?: OptionsConfig & FlatConfigItem, ...userConfigs: (FlatConfigItem | FlatConfigItem[])[]): Promise<FlatConfigItem[]>;
374
392
 
375
393
  declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
376
394
  declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
@@ -396,12 +414,19 @@ declare const GLOB_EXCLUDE: string[];
396
414
  /**
397
415
  * Combine array and non-array configs into a single array.
398
416
  */
399
- declare function combine(...configs: (ConfigItem | ConfigItem[])[]): ConfigItem[];
417
+ declare function combine(...configs: (FlatConfigItem | FlatConfigItem[])[]): FlatConfigItem[];
418
+ /**
419
+ * Combine array and non-array configs into a single array.
420
+ */
421
+ declare function combineAsync<T>(...configs: Awaitable<T | T[]>[]): Promise<T[]>;
400
422
  declare function renameRules<TRule = unknown>(rules: Record<string, TRule>, from: string, to: string): Record<string, TRule>;
423
+ declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
424
+ default: infer U;
425
+ } ? U : T>;
401
426
  declare function isCI(): boolean;
402
427
  declare function isInEditor(): boolean;
403
428
 
404
- declare function jssestd(): ConfigItem[];
405
- declare function jsseReact(): ConfigItem[];
429
+ declare function jssestd(): Promise<FlatConfigItem[]>;
430
+ declare function jsseReact(): Promise<FlatConfigItem[]>;
406
431
 
407
- export { type 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, type OptionsCommon, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsPrefix, type OptionsReact, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type Rules, type StylisticConfig, combine, comments, jsse as default, eslintConfigPrettierRules, ignores, imports, isCI, isInEditor, javascript, jsdoc, jsonc, jsse, jsseReact, jssestd, node, perfectionist, prettier, react, reactHooks, reactRules, renameRules, sortPackageJson, sortTsconfig, test, typescript, unicorn };
432
+ export { type Awaitable, type EslintConfigFn, type FlatConfigItem, 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, type OptionsCommon, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsPrefix, type OptionsReact, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PromiseFlatConfigItem, type Rules, type StylisticConfig, combine, combineAsync, comments, jsse as default, eslintConfigPrettierRules, ignores, imports, interopDefault, isCI, isInEditor, javascript, jsdoc, jsonc, jsse, jsseReact, jssestd, n, perfectionist, prettier, react, reactHooks, reactRules, renameRules, sortPackageJson, sortTsconfig, test, typescript, unicorn };