This repository was archived by the owner on Mar 7, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathindex.d.ts
89 lines (78 loc) · 3.72 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import type { ESLint, Linter } from 'eslint';
import type { Rules as AllRules } from '../rules';
import type { RuleConfig } from '../rules/rule-config';
import type { LanguageOptions } from './language-options';
import type { LinterOptions } from './linter-options';
/**
* Flat ESLint Configuration.
*
* @see [Configuration Files (New)](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new)
*/
export interface FlatESLintConfigItem<
Rules extends Record<string, RuleConfig> = AllRules,
Strict extends boolean = false,
> {
/**
* 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.
*
* @see [Ignore Patterns](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#excluding-files-with-ignores)
*/
files?: string[];
/**
* 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.
*
* @see [Ignore Patterns](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#excluding-files-with-ignores)
*/
ignores?: string[];
/**
* An object containing settings related to how JavaScript is configured for linting.
*
* @see [Configuring language options](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#configuring-language-options)
*/
languageOptions?: LanguageOptions;
/**
* An object containing settings related to the linting process.
*/
linterOptions?: LinterOptions;
/**
* 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"`).
*
* @see [Using processors](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-processors)
*/
processor?: string | Linter.Processor;
/**
* 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.
*
* @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
*/
plugins?: Record<string, ESLint.Plugin>;
/**
* An object containing the configured rules. When `files` or `ignores` are specified, these rule configurations are only available to the matching files.
*
* @see [Configuring rules](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#configuring-rules)
*/
rules?: Strict extends true
? Partial<Rules>
: Partial<Rules & Record<string, RuleConfig>>;
/**
* An object containing name-value pairs of information that should be available to all rules.
*
* @see [Configuring shared settings](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#configuring-shared-settings)
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
settings?: Record<string, any>;
}
/**
* Predefined configurations.
*
* @see [Using predefined configurations](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-predefined-configurations)
*
* @deprecated The predefined string configurations are deprecated and will be replaced by the @eslint/js package.
*/
export type PredefinedConfig = 'eslint:recommended' | 'eslint:all';
export type FlatESLintConfig<
Rules extends Record<string, RuleConfig> = AllRules,
Strict extends boolean = false,
> = FlatESLintConfigItem<Rules, Strict> | PredefinedConfig;
export * from './language-options';
export * from './linter-options';