Update Bot

This commit is contained in:
2026-03-15 11:58:43 +01:00
parent b67c111ffc
commit cd99275933
560 changed files with 23173 additions and 55113 deletions

View File

@@ -22,7 +22,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/e6d15e1/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://sentry.io"><img src="https://github.com/getsentry.png" alt="Sentry" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>

View File

@@ -117,7 +117,7 @@ export interface RulesMeta<MessageIds extends string = string, RuleOptions = unk
schema?: JSONSchema4 | JSONSchema4[] | false | undefined;
/**
* Any default options to be recursively merged on top of any user-provided options.
*/
**/
defaultOptions?: RuleOptions;
/**
* The messages that the rule can report.
@@ -371,12 +371,17 @@ export interface RuleTextEdit {
* @param fixer The text editor to apply the fix.
* @returns The fix(es) for the violation.
*/
export type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit> | null;
export interface ViolationReportBase {
type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit> | null;
interface ViolationReportBase {
/**
* The type of node that the violation is for.
* @deprecated May be removed in the future.
*/
nodeType?: string | undefined;
/**
* The data to insert into the message.
*/
data?: Record<string, unknown> | undefined;
data?: Record<string, string> | undefined;
/**
* The fix to be applied for the violation.
*/
@@ -387,28 +392,28 @@ export interface ViolationReportBase {
*/
suggest?: SuggestedEdit[] | null | undefined;
}
export type ViolationMessage<MessageIds = string> = {
type ViolationMessage<MessageIds = string> = {
message: string;
} | {
messageId: MessageIds;
};
export type ViolationLocation<Node> = {
type ViolationLocation<Node> = {
loc: SourceLocation | Position;
} | {
node: Node;
};
export type ViolationReport<Node = unknown, MessageIds = string> = ViolationReportBase & ViolationMessage<MessageIds> & ViolationLocation<Node>;
export interface SuggestedEditBase {
interface SuggestedEditBase {
/**
* The data to insert into the message.
*/
data?: Record<string, unknown> | undefined;
data?: Record<string, string> | undefined;
/**
* The fix to be applied for the suggestion.
*/
fix: RuleFixer;
fix?: RuleFixer | null | undefined;
}
export type SuggestionMessage = {
type SuggestionMessage = {
desc: string;
} | {
messageId: string;
@@ -417,49 +422,6 @@ export type SuggestionMessage = {
* A suggested edit for a rule violation.
*/
export type SuggestedEdit = SuggestedEditBase & SuggestionMessage;
/**
* The normalized version of a lint suggestion.
*/
export interface LintSuggestion {
/** A short description. */
desc: string;
/** Fix result info. */
fix: RuleTextEdit;
/** Id referencing a message for the description. */
messageId?: string | undefined;
}
/**
* The normalized version of a lint violation message.
*/
export interface LintMessage {
/** The 1-based column number. */
column: number;
/** The 1-based line number. */
line: number;
/** The 1-based column number of the end location. */
endColumn?: number | undefined;
/** The 1-based line number of the end location. */
endLine?: number | undefined;
/** The ID of the rule which makes this message. */
ruleId: string | null;
/** The reported message. */
message: string;
/** The ID of the message in the rule's meta. */
messageId?: string | undefined;
/**
* Type of node.
* @deprecated `nodeType` is deprecated and will be removed in the next major version.
*/
nodeType?: string | undefined;
/** If `true` then this is a fatal error. */
fatal?: true | undefined;
/** The severity of this message. */
severity: Exclude<SeverityLevel, 0>;
/** Information for autofix. */
fix?: RuleTextEdit | undefined;
/** Information for suggestions. */
suggestions?: LintSuggestion[] | undefined;
}
/**
* Generic options for the `RuleDefinition` type.
*/
@@ -536,19 +498,6 @@ export type SeverityLevel = 0 | 1 | 2;
* The severity of a rule in a configuration.
*/
export type Severity = SeverityName | SeverityLevel;
/**
* Represents the metadata for an object, such as a plugin or processor.
*/
export interface ObjectMetaProperties {
/** @deprecated Use `meta.name` instead. */
name?: string | undefined;
/** @deprecated Use `meta.version` instead. */
version?: string | undefined;
meta?: {
name?: string | undefined;
version?: string | undefined;
};
}
/**
* Represents the configuration options for the core linter.
*/
@@ -583,285 +532,6 @@ export interface RulesConfig {
export interface SettingsConfig {
[key: string]: unknown;
}
/**
* The configuration for a set of files.
*/
export interface ConfigObject<Rules extends RulesConfig = RulesConfig> {
/**
* A string to identify the configuration object. Used in error messages and
* inspection tools.
*/
name?: string;
/**
* Path to the directory where the configuration object should apply.
* `files` and `ignores` patterns in the configuration object are
* interpreted as relative to this path.
*/
basePath?: string;
/**
* 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
*/
files?: (string | 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
*/
ignores?: string[];
/**
* The name of the language used for linting. This is used to determine the
* parser and other language-specific settings.
* @since 9.7.0
*/
language?: string;
/**
* An object containing settings related to how the language is configured for
* linting.
*/
languageOptions?: LanguageOptions;
/**
* An object containing settings related to the linting process
*/
linterOptions?: LinterOptionsConfig;
/**
* 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").
*/
processor?: string | 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.
*/
plugins?: Record<string, Plugin>;
/**
* An object containing the configured rules. When files or ignores are specified,
* these rule configurations are only available to the matching files.
*/
rules?: Partial<Rules>;
/**
* An object containing name-value pairs of information that should be
* available to all rules.
*/
settings?: Record<string, unknown>;
}
/** @deprecated Only supported in legacy eslintrc config format. */
export type GlobalAccess = boolean | "off" | "readable" | "readonly" | "writable" | "writeable";
/** @deprecated Only supported in legacy eslintrc config format. */
export interface GlobalsConfig {
[name: string]: GlobalAccess;
}
/**
* The ECMAScript version of the code being linted.
* @deprecated Only supported in legacy eslintrc config format.
*/
export type EcmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 | "latest";
/**
* The type of JavaScript source code.
* @deprecated Only supported in legacy eslintrc config format.
*/
export type JavaScriptSourceType = "script" | "module" | "commonjs";
/**
* Parser options.
* @deprecated Only supported in legacy eslintrc config format.
* @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options)
*/
export interface JavaScriptParserOptionsConfig {
/**
* Allow the use of reserved words as identifiers (if `ecmaVersion` is 3).
*
* @default false
*/
allowReserved?: boolean | undefined;
/**
* Accepts any valid ECMAScript version number or `'latest'`:
*
* - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, es14, ..., or
* - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, ..., or
* - `'latest'`
*
* When it's a version or a year, the value must be a number - so do not include the `es` prefix.
*
* Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default
*
* @default 5
*/
ecmaVersion?: EcmaVersion | undefined;
/**
* The type of JavaScript source code. Possible values are "script" for
* traditional script files, "module" for ECMAScript modules (ESM), and
* "commonjs" for CommonJS files.
*
* @default 'script'
*
* @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
*/
sourceType?: JavaScriptSourceType | undefined;
/**
* An object indicating which additional language features you'd like to use.
*
* @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
*/
ecmaFeatures?: {
globalReturn?: boolean | undefined;
impliedStrict?: boolean | undefined;
jsx?: boolean | undefined;
experimentalObjectRestSpread?: boolean | undefined;
[key: string]: any;
} | undefined;
[key: string]: any;
}
/** @deprecated Only supported in legacy eslintrc config format. */
export interface EnvironmentConfig {
/** The definition of global variables. */
globals?: GlobalsConfig | undefined;
/** The parser options that will be enabled under this environment. */
parserOptions?: JavaScriptParserOptionsConfig | undefined;
}
/**
* A configuration object that may have a `rules` block.
*/
export interface HasRules<Rules extends RulesConfig = RulesConfig> {
rules?: Partial<Rules> | undefined;
}
/**
* ESLint legacy configuration.
*
* @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
*/
export interface BaseConfig<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> extends HasRules<Rules> {
$schema?: string | undefined;
/**
* An environment provides predefined global variables.
*
* @see [Environments](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-environments)
*/
env?: {
[name: string]: boolean;
} | undefined;
/**
* Extending configuration files.
*
* @see [Extends](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#extending-configuration-files)
*/
extends?: string | string[] | undefined;
/**
* Specifying globals.
*
* @see [Globals](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-globals)
*/
globals?: GlobalsConfig | undefined;
/**
* Disable processing of inline comments.
*
* @see [Disabling Inline Comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#disabling-inline-comments)
*/
noInlineConfig?: boolean | undefined;
/**
* Overrides can be used to use a differing configuration for matching sub-directories and files.
*
* @see [How do overrides work](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#how-do-overrides-work)
*/
overrides?: ConfigOverride<OverrideRules>[] | undefined;
/**
* Parser.
*
* @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
* @see [Specifying Parser](https://eslint.org/docs/latest/use/configure/parser-deprecated)
*/
parser?: string | undefined;
/**
* Parser options.
*
* @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
* @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options)
*/
parserOptions?: JavaScriptParserOptionsConfig | undefined;
/**
* Which third-party plugins define additional rules, environments, configs, etc. for ESLint to use.
*
* @see [Configuring Plugins](https://eslint.org/docs/latest/use/configure/plugins-deprecated#configure-plugins)
*/
plugins?: string[] | undefined;
/**
* Specifying processor.
*
* @see [processor](https://eslint.org/docs/latest/use/configure/plugins-deprecated#specify-a-processor)
*/
processor?: string | undefined;
/**
* Report unused eslint-disable comments as warning.
*
* @see [Report unused eslint-disable comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#report-unused-eslint-disable-comments)
*/
reportUnusedDisableDirectives?: boolean | undefined;
/**
* Settings.
*
* @see [Settings](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#adding-shared-settings)
*/
settings?: SettingsConfig | undefined;
}
/**
* The overwrites that apply more differing configuration to specific files or directories.
*/
export interface ConfigOverride<Rules extends RulesConfig = RulesConfig> extends BaseConfig<Rules> {
/**
* The glob patterns for excluded files.
*/
excludedFiles?: string | string[] | undefined;
/**
* The glob patterns for target files.
*/
files: string | string[];
}
/**
* ESLint legacy configuration.
*
* @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
*/
export interface LegacyConfigObject<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> extends BaseConfig<Rules, OverrideRules> {
/**
* Tell ESLint to ignore specific files and directories.
*
* @see [Ignore Patterns](https://eslint.org/docs/latest/use/configure/ignore-deprecated#ignorepatterns-in-config-files)
*/
ignorePatterns?: string | string[] | undefined;
/**
* @see [Using Configuration Files](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#using-configuration-files)
*/
root?: boolean | undefined;
}
/**
* File information passed to a processor.
*/
export interface ProcessorFile {
text: string;
filename: string;
}
/**
* A processor is an object that can preprocess and postprocess files.
*/
export interface Processor<T extends string | ProcessorFile = string | ProcessorFile> extends ObjectMetaProperties {
/** If `true` then it means the processor supports autofix. */
supportsAutofix?: boolean | undefined;
/** The function to extract code blocks. */
preprocess?(text: string, filename: string): T[];
/** The function to merge messages. */
postprocess?(messages: LintMessage[][], filename: string): LintMessage[];
}
export interface Plugin extends ObjectMetaProperties {
meta?: ObjectMetaProperties["meta"] & {
namespace?: string | undefined;
};
configs?: Record<string, LegacyConfigObject | ConfigObject | ConfigObject[]> | undefined;
environments?: Record<string, EnvironmentConfig> | undefined;
languages?: Record<string, Language> | undefined;
processors?: Record<string, Processor> | undefined;
rules?: Record<string, RuleDefinition> | undefined;
}
/**
* Generic options for the `Language` type.
*/

View File

@@ -117,7 +117,7 @@ export interface RulesMeta<MessageIds extends string = string, RuleOptions = unk
schema?: JSONSchema4 | JSONSchema4[] | false | undefined;
/**
* Any default options to be recursively merged on top of any user-provided options.
*/
**/
defaultOptions?: RuleOptions;
/**
* The messages that the rule can report.
@@ -371,12 +371,17 @@ export interface RuleTextEdit {
* @param fixer The text editor to apply the fix.
* @returns The fix(es) for the violation.
*/
export type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit> | null;
export interface ViolationReportBase {
type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit> | null;
interface ViolationReportBase {
/**
* The type of node that the violation is for.
* @deprecated May be removed in the future.
*/
nodeType?: string | undefined;
/**
* The data to insert into the message.
*/
data?: Record<string, unknown> | undefined;
data?: Record<string, string> | undefined;
/**
* The fix to be applied for the violation.
*/
@@ -387,28 +392,28 @@ export interface ViolationReportBase {
*/
suggest?: SuggestedEdit[] | null | undefined;
}
export type ViolationMessage<MessageIds = string> = {
type ViolationMessage<MessageIds = string> = {
message: string;
} | {
messageId: MessageIds;
};
export type ViolationLocation<Node> = {
type ViolationLocation<Node> = {
loc: SourceLocation | Position;
} | {
node: Node;
};
export type ViolationReport<Node = unknown, MessageIds = string> = ViolationReportBase & ViolationMessage<MessageIds> & ViolationLocation<Node>;
export interface SuggestedEditBase {
interface SuggestedEditBase {
/**
* The data to insert into the message.
*/
data?: Record<string, unknown> | undefined;
data?: Record<string, string> | undefined;
/**
* The fix to be applied for the suggestion.
*/
fix: RuleFixer;
fix?: RuleFixer | null | undefined;
}
export type SuggestionMessage = {
type SuggestionMessage = {
desc: string;
} | {
messageId: string;
@@ -417,49 +422,6 @@ export type SuggestionMessage = {
* A suggested edit for a rule violation.
*/
export type SuggestedEdit = SuggestedEditBase & SuggestionMessage;
/**
* The normalized version of a lint suggestion.
*/
export interface LintSuggestion {
/** A short description. */
desc: string;
/** Fix result info. */
fix: RuleTextEdit;
/** Id referencing a message for the description. */
messageId?: string | undefined;
}
/**
* The normalized version of a lint violation message.
*/
export interface LintMessage {
/** The 1-based column number. */
column: number;
/** The 1-based line number. */
line: number;
/** The 1-based column number of the end location. */
endColumn?: number | undefined;
/** The 1-based line number of the end location. */
endLine?: number | undefined;
/** The ID of the rule which makes this message. */
ruleId: string | null;
/** The reported message. */
message: string;
/** The ID of the message in the rule's meta. */
messageId?: string | undefined;
/**
* Type of node.
* @deprecated `nodeType` is deprecated and will be removed in the next major version.
*/
nodeType?: string | undefined;
/** If `true` then this is a fatal error. */
fatal?: true | undefined;
/** The severity of this message. */
severity: Exclude<SeverityLevel, 0>;
/** Information for autofix. */
fix?: RuleTextEdit | undefined;
/** Information for suggestions. */
suggestions?: LintSuggestion[] | undefined;
}
/**
* Generic options for the `RuleDefinition` type.
*/
@@ -536,19 +498,6 @@ export type SeverityLevel = 0 | 1 | 2;
* The severity of a rule in a configuration.
*/
export type Severity = SeverityName | SeverityLevel;
/**
* Represents the metadata for an object, such as a plugin or processor.
*/
export interface ObjectMetaProperties {
/** @deprecated Use `meta.name` instead. */
name?: string | undefined;
/** @deprecated Use `meta.version` instead. */
version?: string | undefined;
meta?: {
name?: string | undefined;
version?: string | undefined;
};
}
/**
* Represents the configuration options for the core linter.
*/
@@ -583,285 +532,6 @@ export interface RulesConfig {
export interface SettingsConfig {
[key: string]: unknown;
}
/**
* The configuration for a set of files.
*/
export interface ConfigObject<Rules extends RulesConfig = RulesConfig> {
/**
* A string to identify the configuration object. Used in error messages and
* inspection tools.
*/
name?: string;
/**
* Path to the directory where the configuration object should apply.
* `files` and `ignores` patterns in the configuration object are
* interpreted as relative to this path.
*/
basePath?: string;
/**
* 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
*/
files?: (string | 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
*/
ignores?: string[];
/**
* The name of the language used for linting. This is used to determine the
* parser and other language-specific settings.
* @since 9.7.0
*/
language?: string;
/**
* An object containing settings related to how the language is configured for
* linting.
*/
languageOptions?: LanguageOptions;
/**
* An object containing settings related to the linting process
*/
linterOptions?: LinterOptionsConfig;
/**
* 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").
*/
processor?: string | 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.
*/
plugins?: Record<string, Plugin>;
/**
* An object containing the configured rules. When files or ignores are specified,
* these rule configurations are only available to the matching files.
*/
rules?: Partial<Rules>;
/**
* An object containing name-value pairs of information that should be
* available to all rules.
*/
settings?: Record<string, unknown>;
}
/** @deprecated Only supported in legacy eslintrc config format. */
export type GlobalAccess = boolean | "off" | "readable" | "readonly" | "writable" | "writeable";
/** @deprecated Only supported in legacy eslintrc config format. */
export interface GlobalsConfig {
[name: string]: GlobalAccess;
}
/**
* The ECMAScript version of the code being linted.
* @deprecated Only supported in legacy eslintrc config format.
*/
export type EcmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 | "latest";
/**
* The type of JavaScript source code.
* @deprecated Only supported in legacy eslintrc config format.
*/
export type JavaScriptSourceType = "script" | "module" | "commonjs";
/**
* Parser options.
* @deprecated Only supported in legacy eslintrc config format.
* @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options)
*/
export interface JavaScriptParserOptionsConfig {
/**
* Allow the use of reserved words as identifiers (if `ecmaVersion` is 3).
*
* @default false
*/
allowReserved?: boolean | undefined;
/**
* Accepts any valid ECMAScript version number or `'latest'`:
*
* - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, es14, ..., or
* - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, ..., or
* - `'latest'`
*
* When it's a version or a year, the value must be a number - so do not include the `es` prefix.
*
* Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default
*
* @default 5
*/
ecmaVersion?: EcmaVersion | undefined;
/**
* The type of JavaScript source code. Possible values are "script" for
* traditional script files, "module" for ECMAScript modules (ESM), and
* "commonjs" for CommonJS files.
*
* @default 'script'
*
* @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
*/
sourceType?: JavaScriptSourceType | undefined;
/**
* An object indicating which additional language features you'd like to use.
*
* @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
*/
ecmaFeatures?: {
globalReturn?: boolean | undefined;
impliedStrict?: boolean | undefined;
jsx?: boolean | undefined;
experimentalObjectRestSpread?: boolean | undefined;
[key: string]: any;
} | undefined;
[key: string]: any;
}
/** @deprecated Only supported in legacy eslintrc config format. */
export interface EnvironmentConfig {
/** The definition of global variables. */
globals?: GlobalsConfig | undefined;
/** The parser options that will be enabled under this environment. */
parserOptions?: JavaScriptParserOptionsConfig | undefined;
}
/**
* A configuration object that may have a `rules` block.
*/
export interface HasRules<Rules extends RulesConfig = RulesConfig> {
rules?: Partial<Rules> | undefined;
}
/**
* ESLint legacy configuration.
*
* @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
*/
export interface BaseConfig<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> extends HasRules<Rules> {
$schema?: string | undefined;
/**
* An environment provides predefined global variables.
*
* @see [Environments](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-environments)
*/
env?: {
[name: string]: boolean;
} | undefined;
/**
* Extending configuration files.
*
* @see [Extends](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#extending-configuration-files)
*/
extends?: string | string[] | undefined;
/**
* Specifying globals.
*
* @see [Globals](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-globals)
*/
globals?: GlobalsConfig | undefined;
/**
* Disable processing of inline comments.
*
* @see [Disabling Inline Comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#disabling-inline-comments)
*/
noInlineConfig?: boolean | undefined;
/**
* Overrides can be used to use a differing configuration for matching sub-directories and files.
*
* @see [How do overrides work](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#how-do-overrides-work)
*/
overrides?: ConfigOverride<OverrideRules>[] | undefined;
/**
* Parser.
*
* @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
* @see [Specifying Parser](https://eslint.org/docs/latest/use/configure/parser-deprecated)
*/
parser?: string | undefined;
/**
* Parser options.
*
* @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
* @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options)
*/
parserOptions?: JavaScriptParserOptionsConfig | undefined;
/**
* Which third-party plugins define additional rules, environments, configs, etc. for ESLint to use.
*
* @see [Configuring Plugins](https://eslint.org/docs/latest/use/configure/plugins-deprecated#configure-plugins)
*/
plugins?: string[] | undefined;
/**
* Specifying processor.
*
* @see [processor](https://eslint.org/docs/latest/use/configure/plugins-deprecated#specify-a-processor)
*/
processor?: string | undefined;
/**
* Report unused eslint-disable comments as warning.
*
* @see [Report unused eslint-disable comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#report-unused-eslint-disable-comments)
*/
reportUnusedDisableDirectives?: boolean | undefined;
/**
* Settings.
*
* @see [Settings](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#adding-shared-settings)
*/
settings?: SettingsConfig | undefined;
}
/**
* The overwrites that apply more differing configuration to specific files or directories.
*/
export interface ConfigOverride<Rules extends RulesConfig = RulesConfig> extends BaseConfig<Rules> {
/**
* The glob patterns for excluded files.
*/
excludedFiles?: string | string[] | undefined;
/**
* The glob patterns for target files.
*/
files: string | string[];
}
/**
* ESLint legacy configuration.
*
* @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
*/
export interface LegacyConfigObject<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> extends BaseConfig<Rules, OverrideRules> {
/**
* Tell ESLint to ignore specific files and directories.
*
* @see [Ignore Patterns](https://eslint.org/docs/latest/use/configure/ignore-deprecated#ignorepatterns-in-config-files)
*/
ignorePatterns?: string | string[] | undefined;
/**
* @see [Using Configuration Files](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#using-configuration-files)
*/
root?: boolean | undefined;
}
/**
* File information passed to a processor.
*/
export interface ProcessorFile {
text: string;
filename: string;
}
/**
* A processor is an object that can preprocess and postprocess files.
*/
export interface Processor<T extends string | ProcessorFile = string | ProcessorFile> extends ObjectMetaProperties {
/** If `true` then it means the processor supports autofix. */
supportsAutofix?: boolean | undefined;
/** The function to extract code blocks. */
preprocess?(text: string, filename: string): T[];
/** The function to merge messages. */
postprocess?(messages: LintMessage[][], filename: string): LintMessage[];
}
export interface Plugin extends ObjectMetaProperties {
meta?: ObjectMetaProperties["meta"] & {
namespace?: string | undefined;
};
configs?: Record<string, LegacyConfigObject | ConfigObject | ConfigObject[]> | undefined;
environments?: Record<string, EnvironmentConfig> | undefined;
languages?: Record<string, Language> | undefined;
processors?: Record<string, Processor> | undefined;
rules?: Record<string, RuleDefinition> | undefined;
}
/**
* Generic options for the `Language` type.
*/

View File

@@ -1,6 +1,6 @@
{
"name": "@eslint/core",
"version": "0.17.0",
"version": "0.15.2",
"description": "Runtime-agnostic core of ESLint",
"type": "module",
"types": "./dist/esm/types.d.ts",