eslint
- Version 9.14.0
- Published
- 3.34 MB
- 35 dependencies
- MIT license
Install
npm i eslint
yarn add eslint
pnpm add eslint
Overview
An AST-based pattern checker for JavaScript.
Index
Functions
Classes
SourceCode
- ast
- commentsExistBetween()
- getAllComments()
- getAncestors()
- getCommentsAfter()
- getCommentsBefore()
- getCommentsInside()
- getDeclaredVariables()
- getFirstToken
- getFirstTokenBetween
- getFirstTokens
- getFirstTokensBetween
- getIndexFromLoc()
- getJSDocComment()
- getLastToken
- getLastTokenBetween
- getLastTokens
- getLastTokensBetween
- getLines()
- getLocFromIndex()
- getNodeByRangeIndex()
- getScope()
- getText()
- getTokenAfter
- getTokenBefore
- getTokenByRangeStart()
- getTokens
- getTokensAfter
- getTokensBefore
- getTokensBetween
- hasBOM
- isSpaceBetween()
- isSpaceBetweenTokens()
- lines
- markVariableAsUsed()
- parserServices
- scopeManager
- splitLines()
- text
- visitorKeys
Namespaces
Linter
- BaseConfig
- Config
- ConfigOverride
- EcmaVersion
- ESLintParseResult
- ESTreeParser
- FixOptions
- FixReport
- FlatConfig
- GlobalConf
- Globals
- HasRules
- LanguageOptions
- LegacyConfig
- LinterOptions
- LintMessage
- LintOptions
- LintSuggestion
- LintSuppression
- NonESTreeParser
- Parser
- ParserOptions
- Processor
- ProcessorFile
- RuleEntry
- RuleSeverity
- RuleSeverityAndOptions
- RulesRecord
- Severity
- SourceType
- Stats
- StringSeverity
- SuppressedLintMessage
- TimePass
Rule
- CodePath
- CodePathOrigin
- CodePathSegment
- Fix
- Node
- NodeListener
- NodeParentExtension
- NodeTypes
- ReportDescriptor
- ReportDescriptorLocation
- ReportDescriptorMessage
- ReportDescriptorOptions
- ReportDescriptorOptionsBase
- ReportFixer
- RuleContext
- RuleFixer
- RuleListener
- RuleMetaData
- RuleModule
- SuggestionDescriptorMessage
- SuggestionReportDescriptor
- SuggestionReportOptions
Functions
function loadESLint
loadESLint: { (options: { useFlatConfig: true }): Promise<typeof ESLint>; (options: { useFlatConfig: false }): Promise<typeof LegacyESLint>; (options?: { useFlatConfig?: boolean }): Promise< typeof ESLint | typeof LegacyESLint >;};
Classes
class ESLint
class ESLint {}
constructor
constructor(options?: ESLint.Options);
property configType
static configType: string;
property defaultConfig
static readonly defaultConfig: Linter.Config<Linter.RulesRecord>[];
The default configuration that ESLint uses internally. This is provided for tooling that wants to calculate configurations using the same defaults as ESLint. Keep in mind that the default configuration may change from version to version, so you shouldn't rely on any particular keys or values to be present.
property version
static readonly version: string;
method calculateConfigForFile
calculateConfigForFile: (filePath: string) => Promise<any>;
method findConfigFile
findConfigFile: () => Promise<string | undefined>;
method getErrorResults
static getErrorResults: (results: ESLint.LintResult[]) => ESLint.LintResult[];
method getRulesMetaForResults
getRulesMetaForResults: ( results: ESLint.LintResult[]) => ESLint.LintResultData['rulesMeta'];
method hasFlag
hasFlag: (flag: string) => boolean;
method isPathIgnored
isPathIgnored: (filePath: string) => Promise<boolean>;
method lintFiles
lintFiles: (patterns: string | string[]) => Promise<ESLint.LintResult[]>;
method lintText
lintText: ( code: string, options?: { filePath?: string | undefined; warnIgnored?: boolean | undefined; }) => Promise<ESLint.LintResult[]>;
method loadFormatter
loadFormatter: (nameOrPath?: string) => Promise<ESLint.LoadedFormatter>;
method outputFixes
static outputFixes: (results: ESLint.LintResult[]) => Promise<void>;
class Linter
class Linter {}
constructor
constructor(options?: { cwd?: string | undefined; configType?: 'flat' | 'eslintrc';});
property version
static readonly version: string;
property version
version: string;
method defineParser
defineParser: (name: string, parser: Linter.Parser) => void;
method defineRule
defineRule: (name: string, rule: Rule.RuleModule) => void;
method defineRules
defineRules: (rules: { [name: string]: Rule.RuleModule }) => void;
method getFixPassCount
getFixPassCount: () => Linter.Stats['fixPasses'];
method getRules
getRules: () => Map<string, Rule.RuleModule>;
method getSourceCode
getSourceCode: () => SourceCode;
method getTimes
getTimes: () => Linter.Stats['times'];
method verify
verify: { ( code: SourceCode | string, config: Linter.LegacyConfig | Linter.Config | Linter.Config[], filename?: string ): Linter.LintMessage[]; ( code: string | SourceCode, config: | Linter.LegacyConfig<Linter.RulesRecord, Linter.RulesRecord> | Linter.Config<Linter.RulesRecord> | Linter.Config<Linter.RulesRecord>[], options: Linter.LintOptions ): Linter.LintMessage[];};
method verifyAndFix
verifyAndFix: { ( code: string, config: Linter.LegacyConfig | Linter.Config | Linter.Config[], filename?: string ): Linter.FixReport; ( code: string, config: | Linter.LegacyConfig<Linter.RulesRecord, Linter.RulesRecord> | Linter.Config<Linter.RulesRecord> | Linter.Config<Linter.RulesRecord>[], options: Linter.FixOptions ): Linter.FixReport;};
class RuleTester
class RuleTester {}
constructor
constructor(config?: Linter.Config<Linter.RulesRecord>);
property describe
static describe: (...args: any) => any;
property it
static it: (...args: any) => any;
property itOnly
static itOnly: (...args: any) => any;
method only
static only: ( item: string | RuleTester.ValidTestCase | RuleTester.InvalidTestCase) => RuleTester.ValidTestCase | RuleTester.InvalidTestCase;
method run
run: ( name: string, rule: Rule.RuleModule, tests: { valid: Array<string | RuleTester.ValidTestCase>; invalid: RuleTester.InvalidTestCase[]; }) => void;
class SourceCode
class SourceCode {}
constructor
constructor(text: string, ast: AST.Program);
constructor
constructor(config: SourceCode.Config);
property ast
ast: AST.Program;
property getFirstToken
getFirstToken: SourceCode.UnaryNodeCursorWithSkipOptions;
property getFirstTokenBetween
getFirstTokenBetween: SourceCode.BinaryCursorWithSkipOptions;
property getFirstTokens
getFirstTokens: SourceCode.UnaryNodeCursorWithCountOptions;
property getFirstTokensBetween
getFirstTokensBetween: SourceCode.BinaryCursorWithCountOptions;
property getLastToken
getLastToken: SourceCode.UnaryNodeCursorWithSkipOptions;
property getLastTokenBetween
getLastTokenBetween: SourceCode.BinaryCursorWithSkipOptions;
property getLastTokens
getLastTokens: SourceCode.UnaryNodeCursorWithCountOptions;
property getLastTokensBetween
getLastTokensBetween: SourceCode.BinaryCursorWithCountOptions;
property getTokenAfter
getTokenAfter: SourceCode.UnaryCursorWithSkipOptions;
property getTokenBefore
getTokenBefore: SourceCode.UnaryCursorWithSkipOptions;
property getTokens
getTokens: (( node: ESTree.Node, beforeCount?: number, afterCount?: number) => AST.Token[]) & SourceCode.UnaryNodeCursorWithCountOptions;
property getTokensAfter
getTokensAfter: SourceCode.UnaryCursorWithCountOptions;
property getTokensBefore
getTokensBefore: SourceCode.UnaryCursorWithCountOptions;
property getTokensBetween
getTokensBetween: SourceCode.BinaryCursorWithCountOptions;
property hasBOM
hasBOM: boolean;
property lines
lines: string[];
property parserServices
parserServices: any;
property scopeManager
scopeManager: Scope.ScopeManager;
property text
text: string;
property visitorKeys
visitorKeys: SourceCode.VisitorKeys;
method commentsExistBetween
commentsExistBetween: ( left: ESTree.Node | AST.Token | ESTree.Comment, right: ESTree.Node | AST.Token | ESTree.Comment) => boolean;
method getAllComments
getAllComments: () => ESTree.Comment[];
method getAncestors
getAncestors: (node: ESTree.Node) => ESTree.Node[];
method getCommentsAfter
getCommentsAfter: (nodeOrToken: ESTree.Node | AST.Token) => ESTree.Comment[];
method getCommentsBefore
getCommentsBefore: (nodeOrToken: ESTree.Node | AST.Token) => ESTree.Comment[];
method getCommentsInside
getCommentsInside: (node: ESTree.Node) => ESTree.Comment[];
method getDeclaredVariables
getDeclaredVariables: (node: ESTree.Node) => Scope.Variable[];
method getIndexFromLoc
getIndexFromLoc: (location: ESTree.Position) => number;
method getJSDocComment
getJSDocComment: (node: ESTree.Node) => ESTree.Comment | null;
method getLines
getLines: () => string[];
method getLocFromIndex
getLocFromIndex: (index: number) => ESTree.Position;
method getNodeByRangeIndex
getNodeByRangeIndex: (index: number) => ESTree.Node | null;
method getScope
getScope: (node: ESTree.Node) => Scope.Scope;
method getText
getText: ( node?: ESTree.Node, beforeCount?: number, afterCount?: number) => string;
method getTokenByRangeStart
getTokenByRangeStart: { (offset: number, options?: { includeComments: false }): AST.Token | null; (offset: number, options: { includeComments: boolean }): any;};
method isSpaceBetween
isSpaceBetween: ( first: ESTree.Node | AST.Token, second: ESTree.Node | AST.Token) => boolean;
method isSpaceBetweenTokens
isSpaceBetweenTokens: (first: AST.Token, second: AST.Token) => boolean;
method markVariableAsUsed
markVariableAsUsed: (name: string, refNode?: ESTree.Node) => boolean;
method splitLines
static splitLines: (text: string) => string[];
Namespaces
namespace AST
namespace AST {}
interface Program
interface Program extends ESTree.Program {}
interface SourceLocation
interface SourceLocation {}
interface Token
interface Token {}
type Range
type Range = [number, number];
type TokenType
type TokenType = | 'Boolean' | 'Null' | 'Identifier' | 'Keyword' | 'Punctuator' | 'JSXIdentifier' | 'JSXText' | 'Numeric' | 'String' | 'RegularExpression';
namespace ESLint
namespace ESLint {}
interface DeprecatedRuleUse
interface DeprecatedRuleUse {}
property replacedBy
replacedBy: string[];
property ruleId
ruleId: string;
interface Environment
interface Environment {}
property globals
globals?: Linter.Globals | undefined;
property parserOptions
parserOptions?: Linter.ParserOptions | undefined;
interface LegacyOptions
interface LegacyOptions {}
property allowInlineConfig
allowInlineConfig?: boolean | undefined;
property baseConfig
baseConfig?: Linter.LegacyConfig | undefined;
property cache
cache?: boolean | undefined;
property cacheLocation
cacheLocation?: string | undefined;
property cacheStrategy
cacheStrategy?: CacheStrategy | undefined;
property cwd
cwd?: string | undefined;
property errorOnUnmatchedPattern
errorOnUnmatchedPattern?: boolean | undefined;
property extensions
extensions?: string[] | undefined;
property fix
fix?: boolean | ((message: Linter.LintMessage) => boolean) | undefined;
property fixTypes
fixTypes?: FixType[] | undefined;
property flags
flags?: string[] | undefined;
property globInputPaths
globInputPaths?: boolean | undefined;
property ignore
ignore?: boolean | undefined;
property ignorePath
ignorePath?: string | undefined;
property overrideConfig
overrideConfig?: Linter.LegacyConfig | undefined;
property overrideConfigFile
overrideConfigFile?: string | undefined;
property plugins
plugins?: Record<string, Plugin> | undefined;
property reportUnusedDisableDirectives
reportUnusedDisableDirectives?: Linter.StringSeverity | undefined;
property resolvePluginsRelativeTo
resolvePluginsRelativeTo?: string | undefined;
property rulePaths
rulePaths?: string[] | undefined;
property useEslintrc
useEslintrc?: boolean | undefined;
interface LintResult
interface LintResult {}
property errorCount
errorCount: number;
property fatalErrorCount
fatalErrorCount: number;
property filePath
filePath: string;
property fixableErrorCount
fixableErrorCount: number;
property fixableWarningCount
fixableWarningCount: number;
property messages
messages: Linter.LintMessage[];
property output
output?: string | undefined;
property source
source?: string | undefined;
property stats
stats?: Linter.Stats | undefined;
property suppressedMessages
suppressedMessages: Linter.SuppressedLintMessage[];
property usedDeprecatedRules
usedDeprecatedRules: DeprecatedRuleUse[];
property warningCount
warningCount: number;
interface LintResultData
interface LintResultData {}
property cwd
cwd: string;
property maxWarningsExceeded
maxWarningsExceeded?: MaxWarningsExceeded | undefined;
property rulesMeta
rulesMeta: { [ruleId: string]: Rule.RuleMetaData;};
interface LoadedFormatter
interface LoadedFormatter {}
The type of an object resolved by ESLint.loadFormatter.
method format
format: ( results: LintResult[], resultsMeta?: ResultsMeta) => string | Promise<string>;
Used to call the underlying formatter.
Parameter results
An array of lint results to format.
Parameter resultsMeta
An object with an optional
maxWarningsExceeded
property that will be passed to the underlying formatter function along with other properties set by ESLint. This argument can be omitted ifmaxWarningsExceeded
is not needed. The formatter output.
interface MaxWarningsExceeded
interface MaxWarningsExceeded {}
property foundWarnings
foundWarnings: number;
Number of warnings found while linting.
property maxWarnings
maxWarnings: number;
Number of warnings to trigger nonzero exit code.
interface ObjectMetaProperties
interface ObjectMetaProperties {}
interface Options
interface Options {}
property allowInlineConfig
allowInlineConfig?: boolean | undefined;
property baseConfig
baseConfig?: Linter.Config | Linter.Config[] | null | undefined;
property cache
cache?: boolean | undefined;
property cacheLocation
cacheLocation?: string | undefined;
property cacheStrategy
cacheStrategy?: CacheStrategy | undefined;
property cwd
cwd?: string | undefined;
property errorOnUnmatchedPattern
errorOnUnmatchedPattern?: boolean | undefined;
property fix
fix?: boolean | ((message: Linter.LintMessage) => boolean) | undefined;
property fixTypes
fixTypes?: FixType[] | undefined;
property flags
flags?: string[] | undefined;
property globInputPaths
globInputPaths?: boolean | undefined;
property ignore
ignore?: boolean | undefined;
property ignorePatterns
ignorePatterns?: string[] | null | undefined;
property overrideConfig
overrideConfig?: Linter.Config | Linter.Config[] | null | undefined;
property overrideConfigFile
overrideConfigFile?: string | boolean | undefined;
property passOnNoPatterns
passOnNoPatterns?: boolean | undefined;
property plugins
plugins?: Record<string, Plugin> | null | undefined;
property ruleFilter
ruleFilter?: | ((arg: { ruleId: string; severity: Exclude<Linter.Severity, 0>; }) => boolean) | undefined;
property stats
stats?: boolean | undefined;
property warnIgnored
warnIgnored?: boolean | undefined;
interface Plugin
interface Plugin extends ObjectMetaProperties {}
property configs
configs?: | Record<string, Linter.LegacyConfig | Linter.Config | Linter.Config[]> | undefined;
property environments
environments?: Record<string, Environment> | undefined;
property languages
languages?: Record<string, Language> | undefined;
property processors
processors?: Record<string, Linter.Processor> | undefined;
property rules
rules?: Record<string, Rule.RuleModule> | undefined;
interface ResultsMeta
interface ResultsMeta {}
property maxWarningsExceeded
maxWarningsExceeded?: MaxWarningsExceeded | undefined;
type CacheStrategy
type CacheStrategy = 'content' | 'metadata';
type ConfigData
type ConfigData<Rules extends Linter.RulesRecord = Linter.RulesRecord> = Omit< Linter.LegacyConfig<Rules>, '$schema'>;
type EditInfo
type EditInfo = Rule.Fix;
type FixType
type FixType = 'directive' | 'problem' | 'suggestion' | 'layout';
type Formatter
type Formatter = LoadedFormatter;
type FormatterFunction
type FormatterFunction = ( results: LintResult[], context: LintResultData) => string | Promise<string>;
The expected signature of a custom formatter.
Parameter results
An array of lint results to format.
Parameter context
Additional information for the formatter. The formatter output.
namespace Linter
namespace Linter {}
interface BaseConfig
interface BaseConfig< Rules extends RulesRecord = RulesRecord, OverrideRules extends RulesRecord = Rules> extends HasRules<Rules> {}
ESLint legacy configuration.
See Also
[ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
property $schema
$schema?: string | undefined;
property env
env?: { [name: string]: boolean } | undefined;
An environment provides predefined global variables.
See Also
[Environments](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-environments)
property extends
extends?: string | string[] | undefined;
Extending configuration files.
See Also
[Extends](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#extending-configuration-files)
property globals
globals?: Linter.Globals | undefined;
Specifying globals.
See Also
[Globals](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-globals)
property noInlineConfig
noInlineConfig?: boolean | undefined;
Disable processing of inline comments.
See Also
[Disabling Inline Comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#disabling-inline-comments)
property overrides
overrides?: Array<ConfigOverride<OverrideRules>> | undefined;
Overrides can be used to use a differing configuration for matching sub-directories and files.
See Also
[How do overrides work](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#how-do-overrides-work)
property parser
parser?: string | undefined;
Parser.
See Also
[Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
[Specifying Parser](https://eslint.org/docs/latest/use/configure/parser-deprecated)
property parserOptions
parserOptions?: ParserOptions | undefined;
Parser options.
See Also
[Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
[Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options)
property plugins
plugins?: string[] | undefined;
Which third-party plugins define additional rules, environments, configs, etc. for ESLint to use.
See Also
[Configuring Plugins](https://eslint.org/docs/latest/use/configure/plugins-deprecated#configure-plugins)
property processor
processor?: string | undefined;
Specifying processor.
See Also
[processor](https://eslint.org/docs/latest/use/configure/plugins-deprecated#specify-a-processor)
property reportUnusedDisableDirectives
reportUnusedDisableDirectives?: boolean | undefined;
Report unused eslint-disable comments as warning.
See Also
[Report unused eslint-disable comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#report-unused-eslint-disable-comments)
property settings
settings?: { [name: string]: any } | undefined;
Settings.
See Also
[Settings](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#adding-shared-settings)
interface Config
interface Config<Rules extends RulesRecord = RulesRecord> {}
property files
files?: Array<string | 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
property ignores
ignores?: 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
property language
language?: string;
The name of the language used for linting. This is used to determine the parser and other language-specific settings. 9.7.0
property languageOptions
languageOptions?: LanguageOptions;
An object containing settings related to how JavaScript is configured for linting.
property linterOptions
linterOptions?: LinterOptions;
An object containing settings related to the linting process
property name
name?: string;
An string to identify the configuration object. Used in error messages and inspection tools.
property plugins
plugins?: Record<string, ESLint.Plugin>;
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.
property processor
processor?: string | Processor;
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").
property rules
rules?: Partial<Rules>;
An object containing the configured rules. When files or ignores are specified, these rule configurations are only available to the matching files.
property settings
settings?: Record<string, unknown>;
An object containing name-value pairs of information that should be available to all rules.
interface ConfigOverride
interface ConfigOverride<Rules extends RulesRecord = RulesRecord> extends BaseConfig<Rules> {}
The overwrites that apply more differing configuration to specific files or directories.
property excludedFiles
excludedFiles?: string | string[] | undefined;
The glob patterns for excluded files.
property files
files: string | string[];
The glob patterns for target files.
interface ESLintParseResult
interface ESLintParseResult {}
property ast
ast: AST.Program;
property parserServices
parserServices?: SourceCode.ParserServices | undefined;
property scopeManager
scopeManager?: Scope.ScopeManager | undefined;
property visitorKeys
visitorKeys?: SourceCode.VisitorKeys | undefined;
interface FixOptions
interface FixOptions extends LintOptions {}
property fix
fix?: boolean | undefined;
interface FixReport
interface FixReport {}
interface Globals
interface Globals {}
index signature
[name: string]: GlobalConf;
interface HasRules
interface HasRules<Rules extends RulesRecord = RulesRecord> {}
A configuration object that may have a
rules
block.
property rules
rules?: Partial<Rules> | undefined;
interface LanguageOptions
interface LanguageOptions {}
property ecmaVersion
ecmaVersion?: EcmaVersion | undefined;
The version of ECMAScript to support. May be any year (i.e., 2022) or version (i.e., 5). Set to "latest" for the most recent supported version. "latest"
property globals
globals?: Globals | undefined;
An object specifying additional objects that should be added to the global scope during linting.
property parser
parser?: Parser | undefined;
An object containing a parse() or parseForESLint() method. If not configured, the default ESLint parser (Espree) will be used.
property parserOptions
parserOptions?: Linter.ParserOptions | undefined;
An object specifying additional options that are passed directly to the parser() method on the parser. The available options are parser-dependent
property sourceType
sourceType?: SourceType | 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: "module" for .js and .mjs files; "commonjs" for .cjs files)
interface LegacyConfig
interface LegacyConfig< Rules extends RulesRecord = RulesRecord, OverrideRules extends RulesRecord = Rules> extends BaseConfig<Rules, OverrideRules> {}
ESLint legacy configuration.
See Also
[ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
property ignorePatterns
ignorePatterns?: string | string[] | undefined;
Tell ESLint to ignore specific files and directories.
See Also
[Ignore Patterns](https://eslint.org/docs/latest/use/configure/ignore-deprecated#ignorepatterns-in-config-files)
property root
root?: boolean | undefined;
See Also
[Using Configuration Files](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#using-configuration-files)
interface LinterOptions
interface LinterOptions {}
property noInlineConfig
noInlineConfig?: boolean;
A boolean value indicating if inline configuration is allowed.
property reportUnusedDisableDirectives
reportUnusedDisableDirectives?: Severity | StringSeverity | boolean;
A severity value indicating if and how unused disable directives should be tracked and reported.
interface LintMessage
interface LintMessage {}
property column
column: number;
property endColumn
endColumn?: number | undefined;
property endLine
endLine?: number | undefined;
property fatal
fatal?: true | undefined;
property fix
fix?: Rule.Fix | undefined;
property line
line: number;
property message
message: string;
property messageId
messageId?: string | undefined;
property nodeType
nodeType?: string | undefined;
Deprecated
nodeType
is deprecated and will be removed in the next major version.
property ruleId
ruleId: string | null;
property severity
severity: Exclude<Severity, 0>;
property suggestions
suggestions?: LintSuggestion[] | undefined;
interface LintOptions
interface LintOptions {}
property allowInlineConfig
allowInlineConfig?: boolean | undefined;
property disableFixes
disableFixes?: boolean | undefined;
property filename
filename?: string | undefined;
property filterCodeBlock
filterCodeBlock?: boolean | undefined;
property postprocess
postprocess?: ((problemLists: LintMessage[][]) => LintMessage[]) | undefined;
property preprocess
preprocess?: ((code: string) => string[]) | undefined;
property reportUnusedDisableDirectives
reportUnusedDisableDirectives?: boolean | undefined;
interface LintSuggestion
interface LintSuggestion {}
interface LintSuppression
interface LintSuppression {}
property justification
justification: string;
property kind
kind: string;
interface ParserOptions
interface ParserOptions {}
Parser options.
See Also
[Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options)
property ecmaFeatures
ecmaFeatures?: | { globalReturn?: boolean | undefined; impliedStrict?: boolean | undefined; jsx?: boolean | undefined; experimentalObjectRestSpread?: boolean | undefined; [key: string]: any; } | undefined;
An object indicating which additional language features you'd like to use.
See Also
https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
property ecmaVersion
ecmaVersion?: EcmaVersion | 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
5
property sourceType
sourceType?: SourceType | 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.
'script'
See Also
https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
index signature
[key: string]: any;
interface Processor
interface Processor<T extends string | ProcessorFile = string | ProcessorFile> extends ESLint.ObjectMetaProperties {}
property supportsAutofix
supportsAutofix?: boolean | undefined;
method postprocess
postprocess: (messages: LintMessage[][], filename: string) => LintMessage[];
method preprocess
preprocess: (text: string, filename: string) => T[];
interface ProcessorFile
interface ProcessorFile {}
interface RulesRecord
interface RulesRecord {}
The rules config object is a key/value map of rule names and their severity and options.
index signature
[rule: string]: RuleEntry;
interface Stats
interface Stats {}
interface SuppressedLintMessage
interface SuppressedLintMessage extends LintMessage {}
property suppressions
suppressions: LintSuppression[];
interface TimePass
interface TimePass {}
type EcmaVersion
type EcmaVersion = | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 'latest';
The ECMAScript version of the code being linted.
type ESTreeParser
type ESTreeParser = ESLint.ObjectMetaProperties & ( | { parse(text: string, options?: any): AST.Program } | { parseForESLint(text: string, options?: any): ESLintParseResult } );
type FlatConfig
type FlatConfig = Config;
Deprecated
Use
Config
instead ofFlatConfig
type GlobalConf
type GlobalConf = | boolean | 'off' | 'readable' | 'readonly' | 'writable' | 'writeable';
type NonESTreeParser
type NonESTreeParser = Omit<ESTreeParser, 'parseForESLint'> & ( | { parse(text: string, options?: any): unknown; } | { parseForESLint( text: string, options?: any ): Omit<ESLintParseResult, 'ast' | 'scopeManager'> & { ast: unknown; scopeManager?: unknown; }; } );
type Parser
type Parser = NonESTreeParser | ESTreeParser;
type RuleEntry
type RuleEntry<Options extends any[] = any[]> = | RuleSeverity | RuleSeverityAndOptions<Options>;
The severity level for the rule or an array containing the rule severity level, followed by the rule options.
See Also
[Rules](https://eslint.org/docs/latest/use/configure/rules)
type RuleSeverity
type RuleSeverity = Severity | StringSeverity;
The numeric or human readable severity level for a rule.
See Also
[Rule Severities](https://eslint.org/docs/latest/use/configure/rules#rule-severities)
type RuleSeverityAndOptions
type RuleSeverityAndOptions<Options extends any[] = any[]> = [ RuleSeverity, ...Partial<Options>];
An array containing the rule severity level, followed by the rule options.
See Also
[Rules](https://eslint.org/docs/latest/use/configure/rules)
type Severity
type Severity = 0 | 1 | 2;
The numeric severity level for a rule.
-
0
means off. -1
means warn. -2
means error.See Also
[Rule Severities](https://eslint.org/docs/latest/use/configure/rules#rule-severities)
type SourceType
type SourceType = 'script' | 'module' | 'commonjs';
The type of JavaScript source code.
type StringSeverity
type StringSeverity = 'off' | 'warn' | 'error';
The human readable severity level for a rule.
See Also
[Rule Severities](https://eslint.org/docs/latest/use/configure/rules#rule-severities)
namespace Rule
namespace Rule {}
interface CodePath
interface CodePath {}
property childCodePaths
childCodePaths: CodePath[];
property finalSegments
finalSegments: CodePathSegment[];
property id
id: string;
property initialSegment
initialSegment: CodePathSegment;
property origin
origin: CodePathOrigin;
property returnedSegments
returnedSegments: CodePathSegment[];
property thrownSegments
thrownSegments: CodePathSegment[];
property upper
upper: CodePath | null;
interface CodePathSegment
interface CodePathSegment {}
property id
id: string;
property nextSegments
nextSegments: CodePathSegment[];
property prevSegments
prevSegments: CodePathSegment[];
property reachable
reachable: boolean;
interface NodeListener
interface NodeListener {}
property "ArrayExpression:exit"
'ArrayExpression:exit'?: | ((node: ESTree.ArrayExpression & NodeParentExtension) => void) | undefined;
property "ArrayPattern:exit"
'ArrayPattern:exit'?: | ((node: ESTree.ArrayPattern & NodeParentExtension) => void) | undefined;
property "ArrowFunctionExpression:exit"
'ArrowFunctionExpression:exit'?: | ((node: ESTree.ArrowFunctionExpression & NodeParentExtension) => void) | undefined;
property "AssignmentExpression:exit"
'AssignmentExpression:exit'?: | ((node: ESTree.AssignmentExpression & NodeParentExtension) => void) | undefined;
property "AssignmentPattern:exit"
'AssignmentPattern:exit'?: | ((node: ESTree.AssignmentPattern & NodeParentExtension) => void) | undefined;
property "AwaitExpression:exit"
'AwaitExpression:exit'?: | ((node: ESTree.AwaitExpression & NodeParentExtension) => void) | undefined;
property "BinaryExpression:exit"
'BinaryExpression:exit'?: | ((node: ESTree.BinaryExpression & NodeParentExtension) => void) | undefined;
property "BlockStatement:exit"
'BlockStatement:exit'?: | ((node: ESTree.BlockStatement & NodeParentExtension) => void) | undefined;
property "BreakStatement:exit"
'BreakStatement:exit'?: | ((node: ESTree.BreakStatement & NodeParentExtension) => void) | undefined;
property "CallExpression:exit"
'CallExpression:exit'?: | ((node: ESTree.CallExpression & NodeParentExtension) => void) | undefined;
property "CatchClause:exit"
'CatchClause:exit'?: | ((node: ESTree.CatchClause & NodeParentExtension) => void) | undefined;
property "ChainExpression:exit"
'ChainExpression:exit'?: | ((node: ESTree.ChainExpression & NodeParentExtension) => void) | undefined;
property "ClassBody:exit"
'ClassBody:exit'?: | ((node: ESTree.ClassBody & NodeParentExtension) => void) | undefined;
property "ClassDeclaration:exit"
'ClassDeclaration:exit'?: | ((node: ESTree.ClassDeclaration & NodeParentExtension) => void) | undefined;
property "ClassExpression:exit"
'ClassExpression:exit'?: | ((node: ESTree.ClassExpression & NodeParentExtension) => void) | undefined;
property "ConditionalExpression:exit"
'ConditionalExpression:exit'?: | ((node: ESTree.ConditionalExpression & NodeParentExtension) => void) | undefined;
property "ContinueStatement:exit"
'ContinueStatement:exit'?: | ((node: ESTree.ContinueStatement & NodeParentExtension) => void) | undefined;
property "DebuggerStatement:exit"
'DebuggerStatement:exit'?: | ((node: ESTree.DebuggerStatement & NodeParentExtension) => void) | undefined;
property "DoWhileStatement:exit"
'DoWhileStatement:exit'?: | ((node: ESTree.DoWhileStatement & NodeParentExtension) => void) | undefined;
property "EmptyStatement:exit"
'EmptyStatement:exit'?: | ((node: ESTree.EmptyStatement & NodeParentExtension) => void) | undefined;
property "ExportAllDeclaration:exit"
'ExportAllDeclaration:exit'?: | ((node: ESTree.ExportAllDeclaration & NodeParentExtension) => void) | undefined;
property "ExportDefaultDeclaration:exit"
'ExportDefaultDeclaration:exit'?: | ((node: ESTree.ExportDefaultDeclaration & NodeParentExtension) => void) | undefined;
property "ExportNamedDeclaration:exit"
'ExportNamedDeclaration:exit'?: | ((node: ESTree.ExportNamedDeclaration & NodeParentExtension) => void) | undefined;
property "ExportSpecifier:exit"
'ExportSpecifier:exit'?: | ((node: ESTree.ExportSpecifier & NodeParentExtension) => void) | undefined;
property "ExpressionStatement:exit"
'ExpressionStatement:exit'?: | ((node: ESTree.ExpressionStatement & NodeParentExtension) => void) | undefined;
property "ForInStatement:exit"
'ForInStatement:exit'?: | ((node: ESTree.ForInStatement & NodeParentExtension) => void) | undefined;
property "ForOfStatement:exit"
'ForOfStatement:exit'?: | ((node: ESTree.ForOfStatement & NodeParentExtension) => void) | undefined;
property "ForStatement:exit"
'ForStatement:exit'?: | ((node: ESTree.ForStatement & NodeParentExtension) => void) | undefined;
property "FunctionDeclaration:exit"
'FunctionDeclaration:exit'?: | ((node: ESTree.FunctionDeclaration & NodeParentExtension) => void) | undefined;
property "FunctionExpression:exit"
'FunctionExpression:exit'?: | ((node: ESTree.FunctionExpression & NodeParentExtension) => void) | undefined;
property "Identifier:exit"
'Identifier:exit'?: | ((node: ESTree.Identifier & NodeParentExtension) => void) | undefined;
property "IfStatement:exit"
'IfStatement:exit'?: | ((node: ESTree.IfStatement & NodeParentExtension) => void) | undefined;
property "ImportDeclaration:exit"
'ImportDeclaration:exit'?: | ((node: ESTree.ImportDeclaration & NodeParentExtension) => void) | undefined;
property "ImportDefaultSpecifier:exit"
'ImportDefaultSpecifier:exit'?: | ((node: ESTree.ImportDefaultSpecifier & NodeParentExtension) => void) | undefined;
property "ImportExpression:exit"
'ImportExpression:exit'?: | ((node: ESTree.ImportExpression & NodeParentExtension) => void) | undefined;
property "ImportNamespaceSpecifier:exit"
'ImportNamespaceSpecifier:exit'?: | ((node: ESTree.ImportNamespaceSpecifier & NodeParentExtension) => void) | undefined;
property "ImportSpecifier:exit"
'ImportSpecifier:exit'?: | ((node: ESTree.ImportSpecifier & NodeParentExtension) => void) | undefined;
property "LabeledStatement:exit"
'LabeledStatement:exit'?: | ((node: ESTree.LabeledStatement & NodeParentExtension) => void) | undefined;
property "Literal:exit"
'Literal:exit'?: | ((node: ESTree.Literal & NodeParentExtension) => void) | undefined;
property "LogicalExpression:exit"
'LogicalExpression:exit'?: | ((node: ESTree.LogicalExpression & NodeParentExtension) => void) | undefined;
property "MemberExpression:exit"
'MemberExpression:exit'?: | ((node: ESTree.MemberExpression & NodeParentExtension) => void) | undefined;
property "MetaProperty:exit"
'MetaProperty:exit'?: | ((node: ESTree.MetaProperty & NodeParentExtension) => void) | undefined;
property "MethodDefinition:exit"
'MethodDefinition:exit'?: | ((node: ESTree.MethodDefinition & NodeParentExtension) => void) | undefined;
property "NewExpression:exit"
'NewExpression:exit'?: | ((node: ESTree.NewExpression & NodeParentExtension) => void) | undefined;
property "ObjectExpression:exit"
'ObjectExpression:exit'?: | ((node: ESTree.ObjectExpression & NodeParentExtension) => void) | undefined;
property "ObjectPattern:exit"
'ObjectPattern:exit'?: | ((node: ESTree.ObjectPattern & NodeParentExtension) => void) | undefined;
property "PrivateIdentifier:exit"
'PrivateIdentifier:exit'?: | ((node: ESTree.PrivateIdentifier & NodeParentExtension) => void) | undefined;
property "Program:exit"
'Program:exit'?: ((node: ESTree.Program) => void) | undefined;
property "Property:exit"
'Property:exit'?: | ((node: ESTree.Property & NodeParentExtension) => void) | undefined;
property "PropertyDefinition:exit"
'PropertyDefinition:exit'?: | ((node: ESTree.PropertyDefinition & NodeParentExtension) => void) | undefined;
property "RestElement:exit"
'RestElement:exit'?: | ((node: ESTree.RestElement & NodeParentExtension) => void) | undefined;
property "ReturnStatement:exit"
'ReturnStatement:exit'?: | ((node: ESTree.ReturnStatement & NodeParentExtension) => void) | undefined;
property "SequenceExpression:exit"
'SequenceExpression:exit'?: | ((node: ESTree.SequenceExpression & NodeParentExtension) => void) | undefined;
property "SpreadElement:exit"
'SpreadElement:exit'?: | ((node: ESTree.SpreadElement & NodeParentExtension) => void) | undefined;
property "StaticBlock:exit"
'StaticBlock:exit'?: | ((node: ESTree.StaticBlock & NodeParentExtension) => void) | undefined;
property "Super:exit"
'Super:exit'?: ((node: ESTree.Super & NodeParentExtension) => void) | undefined;
property "SwitchCase:exit"
'SwitchCase:exit'?: | ((node: ESTree.SwitchCase & NodeParentExtension) => void) | undefined;
property "SwitchStatement:exit"
'SwitchStatement:exit'?: | ((node: ESTree.SwitchStatement & NodeParentExtension) => void) | undefined;
property "TaggedTemplateExpression:exit"
'TaggedTemplateExpression:exit'?: | ((node: ESTree.TaggedTemplateExpression & NodeParentExtension) => void) | undefined;
property "TemplateElement:exit"
'TemplateElement:exit'?: | ((node: ESTree.TemplateElement & NodeParentExtension) => void) | undefined;
property "TemplateLiteral:exit"
'TemplateLiteral:exit'?: | ((node: ESTree.TemplateLiteral & NodeParentExtension) => void) | undefined;
property "ThisExpression:exit"
'ThisExpression:exit'?: | ((node: ESTree.ThisExpression & NodeParentExtension) => void) | undefined;
property "ThrowStatement:exit"
'ThrowStatement:exit'?: | ((node: ESTree.ThrowStatement & NodeParentExtension) => void) | undefined;
property "TryStatement:exit"
'TryStatement:exit'?: | ((node: ESTree.TryStatement & NodeParentExtension) => void) | undefined;
property "UnaryExpression:exit"
'UnaryExpression:exit'?: | ((node: ESTree.UnaryExpression & NodeParentExtension) => void) | undefined;
property "UpdateExpression:exit"
'UpdateExpression:exit'?: | ((node: ESTree.UpdateExpression & NodeParentExtension) => void) | undefined;
property "VariableDeclaration:exit"
'VariableDeclaration:exit'?: | ((node: ESTree.VariableDeclaration & NodeParentExtension) => void) | undefined;
property "VariableDeclarator:exit"
'VariableDeclarator:exit'?: | ((node: ESTree.VariableDeclarator & NodeParentExtension) => void) | undefined;
property "WhileStatement:exit"
'WhileStatement:exit'?: | ((node: ESTree.WhileStatement & NodeParentExtension) => void) | undefined;
property "WithStatement:exit"
'WithStatement:exit'?: | ((node: ESTree.WithStatement & NodeParentExtension) => void) | undefined;
property "YieldExpression:exit"
'YieldExpression:exit'?: | ((node: ESTree.YieldExpression & NodeParentExtension) => void) | undefined;
property ArrayExpression
ArrayExpression?: | ((node: ESTree.ArrayExpression & NodeParentExtension) => void) | undefined;
property ArrayPattern
ArrayPattern?: | ((node: ESTree.ArrayPattern & NodeParentExtension) => void) | undefined;
property ArrowFunctionExpression
ArrowFunctionExpression?: | ((node: ESTree.ArrowFunctionExpression & NodeParentExtension) => void) | undefined;
property AssignmentExpression
AssignmentExpression?: | ((node: ESTree.AssignmentExpression & NodeParentExtension) => void) | undefined;
property AssignmentPattern
AssignmentPattern?: | ((node: ESTree.AssignmentPattern & NodeParentExtension) => void) | undefined;
property AwaitExpression
AwaitExpression?: | ((node: ESTree.AwaitExpression & NodeParentExtension) => void) | undefined;
property BinaryExpression
BinaryExpression?: | ((node: ESTree.BinaryExpression & NodeParentExtension) => void) | undefined;
property BlockStatement
BlockStatement?: | ((node: ESTree.BlockStatement & NodeParentExtension) => void) | undefined;
property BreakStatement
BreakStatement?: | ((node: ESTree.BreakStatement & NodeParentExtension) => void) | undefined;
property CallExpression
CallExpression?: | ((node: ESTree.CallExpression & NodeParentExtension) => void) | undefined;
property CatchClause
CatchClause?: | ((node: ESTree.CatchClause & NodeParentExtension) => void) | undefined;
property ChainExpression
ChainExpression?: | ((node: ESTree.ChainExpression & NodeParentExtension) => void) | undefined;
property ClassBody
ClassBody?: ((node: ESTree.ClassBody & NodeParentExtension) => void) | undefined;
property ClassDeclaration
ClassDeclaration?: | ((node: ESTree.ClassDeclaration & NodeParentExtension) => void) | undefined;
property ClassExpression
ClassExpression?: | ((node: ESTree.ClassExpression & NodeParentExtension) => void) | undefined;
property ConditionalExpression
ConditionalExpression?: | ((node: ESTree.ConditionalExpression & NodeParentExtension) => void) | undefined;
property ContinueStatement
ContinueStatement?: | ((node: ESTree.ContinueStatement & NodeParentExtension) => void) | undefined;
property DebuggerStatement
DebuggerStatement?: | ((node: ESTree.DebuggerStatement & NodeParentExtension) => void) | undefined;
property DoWhileStatement
DoWhileStatement?: | ((node: ESTree.DoWhileStatement & NodeParentExtension) => void) | undefined;
property EmptyStatement
EmptyStatement?: | ((node: ESTree.EmptyStatement & NodeParentExtension) => void) | undefined;
property ExportAllDeclaration
ExportAllDeclaration?: | ((node: ESTree.ExportAllDeclaration & NodeParentExtension) => void) | undefined;
property ExportDefaultDeclaration
ExportDefaultDeclaration?: | ((node: ESTree.ExportDefaultDeclaration & NodeParentExtension) => void) | undefined;
property ExportNamedDeclaration
ExportNamedDeclaration?: | ((node: ESTree.ExportNamedDeclaration & NodeParentExtension) => void) | undefined;
property ExportSpecifier
ExportSpecifier?: | ((node: ESTree.ExportSpecifier & NodeParentExtension) => void) | undefined;
property ExpressionStatement
ExpressionStatement?: | ((node: ESTree.ExpressionStatement & NodeParentExtension) => void) | undefined;
property ForInStatement
ForInStatement?: | ((node: ESTree.ForInStatement & NodeParentExtension) => void) | undefined;
property ForOfStatement
ForOfStatement?: | ((node: ESTree.ForOfStatement & NodeParentExtension) => void) | undefined;
property ForStatement
ForStatement?: | ((node: ESTree.ForStatement & NodeParentExtension) => void) | undefined;
property FunctionDeclaration
FunctionDeclaration?: | ((node: ESTree.FunctionDeclaration & NodeParentExtension) => void) | undefined;
property FunctionExpression
FunctionExpression?: | ((node: ESTree.FunctionExpression & NodeParentExtension) => void) | undefined;
property Identifier
Identifier?: | ((node: ESTree.Identifier & NodeParentExtension) => void) | undefined;
property IfStatement
IfStatement?: | ((node: ESTree.IfStatement & NodeParentExtension) => void) | undefined;
property ImportDeclaration
ImportDeclaration?: | ((node: ESTree.ImportDeclaration & NodeParentExtension) => void) | undefined;
property ImportDefaultSpecifier
ImportDefaultSpecifier?: | ((node: ESTree.ImportDefaultSpecifier & NodeParentExtension) => void) | undefined;
property ImportExpression
ImportExpression?: | ((node: ESTree.ImportExpression & NodeParentExtension) => void) | undefined;
property ImportNamespaceSpecifier
ImportNamespaceSpecifier?: | ((node: ESTree.ImportNamespaceSpecifier & NodeParentExtension) => void) | undefined;
property ImportSpecifier
ImportSpecifier?: | ((node: ESTree.ImportSpecifier & NodeParentExtension) => void) | undefined;
property LabeledStatement
LabeledStatement?: | ((node: ESTree.LabeledStatement & NodeParentExtension) => void) | undefined;
property Literal
Literal?: ((node: ESTree.Literal & NodeParentExtension) => void) | undefined;
property LogicalExpression
LogicalExpression?: | ((node: ESTree.LogicalExpression & NodeParentExtension) => void) | undefined;
property MemberExpression
MemberExpression?: | ((node: ESTree.MemberExpression & NodeParentExtension) => void) | undefined;
property MetaProperty
MetaProperty?: | ((node: ESTree.MetaProperty & NodeParentExtension) => void) | undefined;
property MethodDefinition
MethodDefinition?: | ((node: ESTree.MethodDefinition & NodeParentExtension) => void) | undefined;
property NewExpression
NewExpression?: | ((node: ESTree.NewExpression & NodeParentExtension) => void) | undefined;
property ObjectExpression
ObjectExpression?: | ((node: ESTree.ObjectExpression & NodeParentExtension) => void) | undefined;
property ObjectPattern
ObjectPattern?: | ((node: ESTree.ObjectPattern & NodeParentExtension) => void) | undefined;
property PrivateIdentifier
PrivateIdentifier?: | ((node: ESTree.PrivateIdentifier & NodeParentExtension) => void) | undefined;
property Program
Program?: ((node: ESTree.Program) => void) | undefined;
property Property
Property?: ((node: ESTree.Property & NodeParentExtension) => void) | undefined;
property PropertyDefinition
PropertyDefinition?: | ((node: ESTree.PropertyDefinition & NodeParentExtension) => void) | undefined;
property RestElement
RestElement?: | ((node: ESTree.RestElement & NodeParentExtension) => void) | undefined;
property ReturnStatement
ReturnStatement?: | ((node: ESTree.ReturnStatement & NodeParentExtension) => void) | undefined;
property SequenceExpression
SequenceExpression?: | ((node: ESTree.SequenceExpression & NodeParentExtension) => void) | undefined;
property SpreadElement
SpreadElement?: | ((node: ESTree.SpreadElement & NodeParentExtension) => void) | undefined;
property StaticBlock
StaticBlock?: | ((node: ESTree.StaticBlock & NodeParentExtension) => void) | undefined;
property Super
Super?: ((node: ESTree.Super & NodeParentExtension) => void) | undefined;
property SwitchCase
SwitchCase?: | ((node: ESTree.SwitchCase & NodeParentExtension) => void) | undefined;
property SwitchStatement
SwitchStatement?: | ((node: ESTree.SwitchStatement & NodeParentExtension) => void) | undefined;
property TaggedTemplateExpression
TaggedTemplateExpression?: | ((node: ESTree.TaggedTemplateExpression & NodeParentExtension) => void) | undefined;
property TemplateElement
TemplateElement?: | ((node: ESTree.TemplateElement & NodeParentExtension) => void) | undefined;
property TemplateLiteral
TemplateLiteral?: | ((node: ESTree.TemplateLiteral & NodeParentExtension) => void) | undefined;
property ThisExpression
ThisExpression?: | ((node: ESTree.ThisExpression & NodeParentExtension) => void) | undefined;
property ThrowStatement
ThrowStatement?: | ((node: ESTree.ThrowStatement & NodeParentExtension) => void) | undefined;
property TryStatement
TryStatement?: | ((node: ESTree.TryStatement & NodeParentExtension) => void) | undefined;
property UnaryExpression
UnaryExpression?: | ((node: ESTree.UnaryExpression & NodeParentExtension) => void) | undefined;
property UpdateExpression
UpdateExpression?: | ((node: ESTree.UpdateExpression & NodeParentExtension) => void) | undefined;
property VariableDeclaration
VariableDeclaration?: | ((node: ESTree.VariableDeclaration & NodeParentExtension) => void) | undefined;
property VariableDeclarator
VariableDeclarator?: | ((node: ESTree.VariableDeclarator & NodeParentExtension) => void) | undefined;
property WhileStatement
WhileStatement?: | ((node: ESTree.WhileStatement & NodeParentExtension) => void) | undefined;
property WithStatement
WithStatement?: | ((node: ESTree.WithStatement & NodeParentExtension) => void) | undefined;
property YieldExpression
YieldExpression?: | ((node: ESTree.YieldExpression & NodeParentExtension) => void) | undefined;
interface NodeParentExtension
interface NodeParentExtension {}
property parent
parent: Node;
interface ReportDescriptorOptions
interface ReportDescriptorOptions extends ReportDescriptorOptionsBase {}
property suggest
suggest?: SuggestionReportDescriptor[] | null | undefined;
interface ReportDescriptorOptionsBase
interface ReportDescriptorOptionsBase {}
interface RuleContext
interface RuleContext {}
property cwd
cwd: string;
property filename
filename: string;
property id
id: string;
property languageOptions
languageOptions: Linter.LanguageOptions;
property options
options: any[];
property parserOptions
parserOptions: Linter.ParserOptions;
property parserPath
parserPath: string | undefined;
property physicalFilename
physicalFilename: string;
property settings
settings: { [name: string]: any };
property sourceCode
sourceCode: SourceCode;
method getAncestors
getAncestors: () => ESTree.Node[];
method getCwd
getCwd: () => string;
Deprecated
Use property
cwd
directly instead
method getDeclaredVariables
getDeclaredVariables: (node: ESTree.Node) => Scope.Variable[];
method getFilename
getFilename: () => string;
Deprecated
Use property
filename
directly instead
method getPhysicalFilename
getPhysicalFilename: () => string;
Deprecated
Use property
physicalFilename
directly instead
method getScope
getScope: () => Scope.Scope;
method getSourceCode
getSourceCode: () => SourceCode;
Deprecated
Use property
sourceCode
directly instead
method markVariableAsUsed
markVariableAsUsed: (name: string) => boolean;
method report
report: (descriptor: ReportDescriptor) => void;
interface RuleFixer
interface RuleFixer {}
method insertTextAfter
insertTextAfter: (nodeOrToken: ESTree.Node | AST.Token, text: string) => Fix;
method insertTextAfterRange
insertTextAfterRange: (range: AST.Range, text: string) => Fix;
method insertTextBefore
insertTextBefore: (nodeOrToken: ESTree.Node | AST.Token, text: string) => Fix;
method insertTextBeforeRange
insertTextBeforeRange: (range: AST.Range, text: string) => Fix;
method remove
remove: (nodeOrToken: ESTree.Node | AST.Token) => Fix;
method removeRange
removeRange: (range: AST.Range) => Fix;
method replaceText
replaceText: (nodeOrToken: ESTree.Node | AST.Token, text: string) => Fix;
method replaceTextRange
replaceTextRange: (range: AST.Range, text: string) => Fix;
interface RuleListener
interface RuleListener extends NodeListener {}
method onCodePathEnd
onCodePathEnd: (codePath: CodePath, node: Node) => void;
method onCodePathSegmentEnd
onCodePathSegmentEnd: (segment: CodePathSegment, node: Node) => void;
method onCodePathSegmentLoop
onCodePathSegmentLoop: ( fromSegment: CodePathSegment, toSegment: CodePathSegment, node: Node) => void;
method onCodePathSegmentStart
onCodePathSegmentStart: (segment: CodePathSegment, node: Node) => void;
method onCodePathStart
onCodePathStart: (codePath: CodePath, node: Node) => void;
index signature
[key: string]: | ((codePath: CodePath, node: Node) => void) | ((segment: CodePathSegment, node: Node) => void) | (( fromSegment: CodePathSegment, toSegment: CodePathSegment, node: Node ) => void) | ((node: Node) => void) | NodeListener[keyof NodeListener] | undefined;
interface RuleMetaData
interface RuleMetaData {}
property deprecated
deprecated?: boolean | undefined;
Indicates whether the rule has been deprecated. Omit if not deprecated.
property docs
docs?: | { /** Provides a short description of the rule. Commonly used when generating lists of rules. */ description?: string | undefined; /** Historically used by some plugins that divide rules into categories in their documentation. */ category?: string | undefined; /** Historically used by some plugins to indicate a rule belongs in their `recommended` configuration. */ recommended?: boolean | undefined; /** Specifies the URL at which the full documentation can be accessed. Code editors often use this to provide a helpful link on highlighted rule violations. */ url?: string | undefined; } | undefined;
Properties often used for documentation generation and tooling.
property fixable
fixable?: 'code' | 'whitespace' | undefined;
Specifies if the
--fix
option on the command line automatically fixes problems reported by the rule. Mandatory for fixable rules.
property hasSuggestions
hasSuggestions?: boolean | undefined;
Specifies whether the rule can return suggestions (defaults to
false
if omitted). Mandatory for rules that provide suggestions.
property messages
messages?: { [messageId: string]: string } | undefined;
Violation and suggestion messages.
property replacedBy
replacedBy?: readonly string[];
The name of the rule(s) this rule was replaced by, if it was deprecated.
property schema
schema?: JSONSchema4 | JSONSchema4[] | false | undefined;
Specifies the [options](https://eslint.org/docs/latest/extend/custom-rules#options-schemas) so ESLint can prevent invalid [rule configurations](https://eslint.org/docs/latest/use/configure/rules#configuring-rules). Mandatory for rules with options.
property type
type?: 'problem' | 'suggestion' | 'layout' | undefined;
Indicates the type of rule: -
"problem"
means the rule is identifying code that either will cause an error or may cause a confusing behavior. Developers should consider this a high priority to resolve. -"suggestion"
means the rule is identifying something that could be done in a better way but no errors will occur if the code isn’t changed. -"layout"
means the rule cares primarily about whitespace, semicolons, commas, and parentheses, all the parts of the program that determine how the code looks rather than how it executes. These rules work on parts of the code that aren’t specified in the AST.
interface RuleModule
interface RuleModule {}
interface SuggestionReportOptions
interface SuggestionReportOptions {}
type CodePathOrigin
type CodePathOrigin = | 'program' | 'function' | 'class-field-initializer' | 'class-static-block';
type Node
type Node = ESTree.Node & NodeParentExtension;
type NodeTypes
type NodeTypes = ESTree.Node['type'];
type ReportDescriptor
type ReportDescriptor = ReportDescriptorMessage & ReportDescriptorLocation & ReportDescriptorOptions;
type ReportDescriptorLocation
type ReportDescriptorLocation = | { node: ESTree.Node } | { loc: AST.SourceLocation | { line: number; column: number } };
type ReportDescriptorMessage
type ReportDescriptorMessage = { message: string } | { messageId: string };
type ReportFixer
type ReportFixer = (fixer: RuleFixer) => null | Fix | IterableIterator<Fix> | Fix[];
type SuggestionDescriptorMessage
type SuggestionDescriptorMessage = { desc: string } | { messageId: string };
type SuggestionReportDescriptor
type SuggestionReportDescriptor = SuggestionDescriptorMessage & SuggestionReportOptions;
namespace RuleTester
namespace RuleTester {}
interface InvalidTestCase
interface InvalidTestCase extends ValidTestCase {}
interface SuggestionOutput
interface SuggestionOutput {}
interface TestCaseError
interface TestCaseError {}
property column
column?: number | undefined;
property data
data?: any;
property endColumn
endColumn?: number | undefined;
property endLine
endLine?: number | undefined;
property line
line?: number | undefined;
property message
message?: string | RegExp;
property messageId
messageId?: string;
property suggestions
suggestions?: SuggestionOutput[] | undefined;
property type
type?: string | undefined;
Deprecated
type
is deprecated and will be removed in the next major version.
interface ValidTestCase
interface ValidTestCase {}
namespace Scope
namespace Scope {}
interface Reference
interface Reference {}
property from
from: Scope;
property identifier
identifier: ESTree.Identifier;
property init
init: boolean;
property resolved
resolved: Variable | null;
property writeExpr
writeExpr: ESTree.Node | null;
method isRead
isRead: () => boolean;
method isReadOnly
isReadOnly: () => boolean;
method isReadWrite
isReadWrite: () => boolean;
method isWrite
isWrite: () => boolean;
method isWriteOnly
isWriteOnly: () => boolean;
interface Scope
interface Scope {}
property block
block: ESTree.Node;
property childScopes
childScopes: Scope[];
property functionExpressionScope
functionExpressionScope: boolean;
property isStrict
isStrict: boolean;
property references
references: Reference[];
property set
set: Map<string, Variable>;
property through
through: Reference[];
property type
type: | 'block' | 'catch' | 'class' | 'for' | 'function' | 'function-expression-name' | 'global' | 'module' | 'switch' | 'with' | 'TDZ';
property upper
upper: Scope | null;
property variables
variables: Variable[];
property variableScope
variableScope: Scope;
interface ScopeManager
interface ScopeManager {}
property globalScope
globalScope: Scope | null;
property scopes
scopes: Scope[];
method acquire
acquire: (node: ESTree.Node, inner?: boolean) => Scope | null;
method getDeclaredVariables
getDeclaredVariables: (node: ESTree.Node) => Variable[];
interface Variable
interface Variable {}
property defs
defs: Definition[];
property identifiers
identifiers: ESTree.Identifier[];
property name
name: string;
property references
references: Reference[];
property scope
scope: Scope;
type Definition
type Definition = DefinitionType & { name: ESTree.Identifier };
type DefinitionType
type DefinitionType = | { type: 'CatchClause'; node: ESTree.CatchClause; parent: null } | { type: 'ClassName'; node: ESTree.ClassDeclaration | ESTree.ClassExpression; parent: null; } | { type: 'FunctionName'; node: ESTree.FunctionDeclaration | ESTree.FunctionExpression; parent: null; } | { type: 'ImplicitGlobalVariable'; node: ESTree.Program; parent: null } | { type: 'ImportBinding'; node: | ESTree.ImportSpecifier | ESTree.ImportDefaultSpecifier | ESTree.ImportNamespaceSpecifier; parent: ESTree.ImportDeclaration; } | { type: 'Parameter'; node: | ESTree.FunctionDeclaration | ESTree.FunctionExpression | ESTree.ArrowFunctionExpression; parent: null; } | { type: 'TDZ'; node: any; parent: null } | { type: 'Variable'; node: ESTree.VariableDeclarator; parent: ESTree.VariableDeclaration; };
namespace SourceCode
namespace SourceCode {}
interface BinaryCursorWithCountOptions
interface BinaryCursorWithCountOptions {}
call signature
<T extends AST.Token>( left: ESTree.Node | AST.Token | ESTree.Comment, right: ESTree.Node | AST.Token | ESTree.Comment, options: | ((token: AST.Token) => token is T) | { filter: (token: AST.Token) => token is T; includeComments?: false | undefined; count?: number | undefined; }): T[];
call signature
<T extends AST.Token | ESTree.Comment>( left: ESTree.Node | AST.Token | ESTree.Comment, right: ESTree.Node | AST.Token | ESTree.Comment, options: { filter: ( tokenOrComment: AST.Token | ESTree.Comment ) => tokenOrComment is T; includeComments: boolean; count?: number | undefined; }): T[];
call signature
( left: ESTree.Node | AST.Token | ESTree.Comment, right: ESTree.Node | AST.Token | ESTree.Comment, options?: | { filter?: ((token: AST.Token) => boolean) | undefined; includeComments?: false | undefined; count?: number | undefined; } | ((token: AST.Token) => boolean) | number): AST.Token[];
call signature
( left: ESTree.Node | AST.Token | ESTree.Comment, right: ESTree.Node | AST.Token | ESTree.Comment, options: { filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; includeComments: boolean; count?: number | undefined; }): Array<AST.Token | ESTree.Comment>;
interface BinaryCursorWithSkipOptions
interface BinaryCursorWithSkipOptions {}
call signature
<T extends AST.Token>( left: ESTree.Node | AST.Token | ESTree.Comment, right: ESTree.Node | AST.Token | ESTree.Comment, options: | ((token: AST.Token) => token is T) | { filter: (token: AST.Token) => token is T; includeComments?: false | undefined; skip?: number | undefined; }): T | null;
call signature
<T extends AST.Token | ESTree.Comment>( left: ESTree.Node | AST.Token | ESTree.Comment, right: ESTree.Node | AST.Token | ESTree.Comment, options: { filter: ( tokenOrComment: AST.Token | ESTree.Comment ) => tokenOrComment is T; includeComments: boolean; skip?: number | undefined; }): T | null;
call signature
( left: ESTree.Node | AST.Token | ESTree.Comment, right: ESTree.Node | AST.Token | ESTree.Comment, options?: | { filter?: ((token: AST.Token) => boolean) | undefined; includeComments?: false | undefined; skip?: number | undefined; } | ((token: AST.Token) => boolean) | number): AST.Token | null;
call signature
( left: ESTree.Node | AST.Token | ESTree.Comment, right: ESTree.Node | AST.Token | ESTree.Comment, options: { filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; includeComments: boolean; skip?: number | undefined; }): AST.Token | ESTree.Comment | null;
interface Config
interface Config {}
property ast
ast: AST.Program;
property parserServices
parserServices?: ParserServices | undefined;
property scopeManager
scopeManager?: Scope.ScopeManager | undefined;
property text
text: string;
property visitorKeys
visitorKeys?: VisitorKeys | undefined;
interface UnaryCursorWithCountOptions
interface UnaryCursorWithCountOptions {}
call signature
<T extends AST.Token>( node: ESTree.Node | AST.Token | ESTree.Comment, options: | ((token: AST.Token) => token is T) | { filter: (token: AST.Token) => token is T; includeComments?: false | undefined; count?: number | undefined; }): T[];
call signature
<T extends AST.Token | ESTree.Comment>( node: ESTree.Node | AST.Token | ESTree.Comment, options: { filter: ( tokenOrComment: AST.Token | ESTree.Comment ) => tokenOrComment is T; includeComments: boolean; count?: number | undefined; }): T[];
call signature
( node: ESTree.Node | AST.Token | ESTree.Comment, options?: | { filter?: ((token: AST.Token) => boolean) | undefined; includeComments?: false | undefined; count?: number | undefined; } | ((token: AST.Token) => boolean) | number): AST.Token[];
call signature
( node: ESTree.Node | AST.Token | ESTree.Comment, options: { filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; includeComments: boolean; count?: number | undefined; }): Array<AST.Token | ESTree.Comment>;
interface UnaryCursorWithSkipOptions
interface UnaryCursorWithSkipOptions {}
call signature
<T extends AST.Token>( node: ESTree.Node | AST.Token | ESTree.Comment, options: | ((token: AST.Token) => token is T) | { filter: (token: AST.Token) => token is T; includeComments?: false | undefined; skip?: number | undefined; }): T | null;
call signature
<T extends AST.Token | ESTree.Comment>( node: ESTree.Node | AST.Token | ESTree.Comment, options: { filter: ( tokenOrComment: AST.Token | ESTree.Comment ) => tokenOrComment is T; includeComments: boolean; skip?: number | undefined; }): T | null;
call signature
( node: ESTree.Node | AST.Token | ESTree.Comment, options?: | { filter?: ((token: AST.Token) => boolean) | undefined; includeComments?: false | undefined; skip?: number | undefined; } | ((token: AST.Token) => boolean) | number): AST.Token | null;
call signature
( node: ESTree.Node | AST.Token | ESTree.Comment, options: { filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; includeComments: boolean; skip?: number | undefined; }): AST.Token | ESTree.Comment | null;
interface UnaryNodeCursorWithCountOptions
interface UnaryNodeCursorWithCountOptions {}
call signature
<T extends AST.Token>( node: ESTree.Node, options: | ((token: AST.Token) => token is T) | { filter: (token: AST.Token) => token is T; includeComments?: false | undefined; count?: number | undefined; }): T[];
call signature
<T extends AST.Token | ESTree.Comment>( node: ESTree.Node, options: { filter: ( tokenOrComment: AST.Token | ESTree.Comment ) => tokenOrComment is T; includeComments: boolean; count?: number | undefined; }): T[];
call signature
( node: ESTree.Node, options?: | { filter?: ((token: AST.Token) => boolean) | undefined; includeComments?: false | undefined; count?: number | undefined; } | ((token: AST.Token) => boolean) | number): AST.Token[];
call signature
( node: ESTree.Node, options: { filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; includeComments: boolean; count?: number | undefined; }): Array<AST.Token | ESTree.Comment>;
interface UnaryNodeCursorWithSkipOptions
interface UnaryNodeCursorWithSkipOptions {}
call signature
<T extends AST.Token>( node: ESTree.Node, options: | ((token: AST.Token) => token is T) | { filter: (token: AST.Token) => token is T; includeComments?: false | undefined; skip?: number | undefined; }): T | null;
call signature
<T extends AST.Token | ESTree.Comment>( node: ESTree.Node, options: { filter: ( tokenOrComment: AST.Token | ESTree.Comment ) => tokenOrComment is T; includeComments: boolean; skip?: number | undefined; }): T | null;
call signature
( node: ESTree.Node, options?: | { filter?: ((token: AST.Token) => boolean) | undefined; includeComments?: false | undefined; skip?: number | undefined; } | ((token: AST.Token) => boolean) | number): AST.Token | null;
call signature
( node: ESTree.Node, options: { filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; includeComments: boolean; skip?: number | undefined; }): AST.Token | ESTree.Comment | null;
interface VisitorKeys
interface VisitorKeys {}
index signature
[nodeType: string]: string[];
type ParserServices
type ParserServices = any;
Package Files (1)
Dependencies (35)
- @eslint-community/eslint-utils
- @eslint-community/regexpp
- @eslint/config-array
- @eslint/core
- @eslint/eslintrc
- @eslint/js
- @eslint/plugin-kit
- @humanfs/node
- @humanwhocodes/module-importer
- @humanwhocodes/retry
- @types/estree
- @types/json-schema
- ajv
- chalk
- cross-spawn
- debug
- escape-string-regexp
- eslint-scope
- eslint-visitor-keys
- espree
- esquery
- esutils
- fast-deep-equal
- file-entry-cache
- find-up
- glob-parent
- ignore
- imurmurhash
- is-glob
- json-stable-stringify-without-jsonify
- lodash.merge
- minimatch
- natural-compare
- optionator
- text-table
Dev Dependencies (63)
- @arethetypeswrong/cli
- @babel/core
- @babel/preset-env
- @eslint/json
- @trunkio/launcher
- @types/node
- @typescript-eslint/parser
- @wdio/browser-runner
- @wdio/cli
- @wdio/concise-reporter
- @wdio/mocha-framework
- babel-loader
- c8
- chai
- cheerio
- common-tags
- core-js
- ejs
- eslint
- eslint-config-eslint
- eslint-plugin-eslint-plugin
- eslint-plugin-expect-type
- eslint-plugin-yml
- eslint-release
- eslint-rule-composer
- eslump
- esprima
- fast-glob
- fs-teardown
- glob
- globals
- got
- gray-matter
- jiti
- knip
- lint-staged
- load-perf
- markdown-it
- markdown-it-container
- marked
- metascraper
- metascraper-description
- metascraper-image
- metascraper-logo
- metascraper-logo-favicon
- metascraper-title
- mocha
- node-polyfill-webpack-plugin
- npm-license
- pirates
- progress
- proxyquire
- recast
- regenerator-runtime
- rollup-plugin-node-polyfills
- semver
- shelljs
- sinon
- typescript
- vite-plugin-commonjs
- webpack
- webpack-cli
- yorkie
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/eslint
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/eslint)
- HTML<a href="https://www.jsdocs.io/package/eslint"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 8482 ms. - Missing or incorrect documentation? Open an issue for this package.