⬅️ Back to Table of Contents
📄 ts-eslint/Config
📊 Analysis Summary
| Metric |
Count |
| 📦 Imports |
4 |
| 📐 Interfaces |
12 |
| 📑 Type Aliases |
38 |
📚 Table of Contents
🛠️ File Location:
📂 packages/utils/src/ts-eslint/Config.ts
📦 Imports
| Name |
Source |
ParserType |
./Parser |
ProcessorType |
./Processor |
LooseRuleDefinition |
./Rule |
SharedConfigurationSettings |
./Rule |
Interfaces
GlobalsConfig
Interface Code
export interface GlobalsConfig {
[name: string]: GlobalVariableOption;
}
EnvironmentConfig
Interface Code
export interface EnvironmentConfig {
[name: string]: boolean;
}
Interface Code
export interface PluginMeta {
/**
* The meta.name property should match the npm package name for your plugin.
*/
name: string;
/**
* If you followed the classic style to name your package
* (e.g. `eslint-plugin-X`, `@X/eslint-plugin`, or `@X/eslint-plugin-Y`),
* then this should match the classic namespace inferred for your package
* (e.g. `X`, `@X`, or `@X/Y`, respectively).
*/
namespace?: string;
/**
* The meta.version property should match the npm package version for your plugin.
*/
version: string;
}
Properties
| Name |
Type |
Optional |
Description |
name |
string |
✗ |
not shown |
namespace |
string |
✓ |
not shown |
version |
string |
✗ |
not shown |
BaseConfig
Interface Code
interface BaseConfig {
$schema?: string;
/**
* The environment settings.
*/
env?: EnvironmentConfig;
/**
* The path to other config files or the package name of shareable configs.
*/
extends?: string | string[];
/**
* The global variable settings.
*/
globals?: GlobalsConfig;
/**
* The flag that disables comment directives.
*/
noInlineConfig?: boolean;
/**
* The override settings per kind of files.
*/
overrides?: ConfigOverride[];
/**
* The path to a parser or the package name of a parser.
*/
parser?: string | null;
/**
* The parser options.
*/
parserOptions?: ParserOptions;
/**
* The plugin specifiers.
*/
plugins?: string[];
/**
* The processor specifier.
*/
processor?: string;
/**
* The flag to report unused `eslint-disable` comments.
*/
reportUnusedDisableDirectives?: boolean;
/**
* The rule settings.
*/
rules?: RulesRecord;
/**
* The shared settings.
*/
settings?: SharedConfigurationSettings;
}
Properties
| Name |
Type |
Optional |
Description |
$schema |
string |
✓ |
not shown |
env |
EnvironmentConfig |
✓ |
not shown |
extends |
string \| string[] |
✓ |
not shown |
globals |
GlobalsConfig |
✓ |
not shown |
noInlineConfig |
boolean |
✓ |
not shown |
overrides |
ConfigOverride[] |
✓ |
not shown |
parser |
string \| null |
✓ |
not shown |
parserOptions |
ParserOptions |
✓ |
not shown |
plugins |
string[] |
✓ |
not shown |
processor |
string |
✓ |
not shown |
reportUnusedDisableDirectives |
boolean |
✓ |
not shown |
rules |
RulesRecord |
✓ |
not shown |
settings |
SharedConfigurationSettings |
✓ |
not shown |
ConfigOverride
Interface Code
export interface ConfigOverride extends BaseConfig {
excludedFiles?: string | string[];
files: string | string[];
}
Properties
| Name |
Type |
Optional |
Description |
excludedFiles |
string \| string[] |
✓ |
not shown |
files |
string \| string[] |
✗ |
not shown |
Config
Interface Code
export interface Config extends BaseConfig {
/**
* The glob patterns that ignore to lint.
*/
ignorePatterns?: string | string[];
/**
* The root flag.
*/
root?: boolean;
}
Properties
| Name |
Type |
Optional |
Description |
ignorePatterns |
string \| string[] |
✓ |
not shown |
root |
boolean |
✓ |
not shown |
SharedConfigs
Interface Code
export interface SharedConfigs {
[key: string]: Config | ConfigArray;
}
Plugin
Interface Code
export interface Plugin {
/**
* Shared configurations bundled with the plugin.
* Users will reference these directly in their config (i.e. `plugin.configs.recommended`).
*/
configs?: SharedConfigs;
/**
* Metadata about your plugin for easier debugging and more effective caching of plugins.
*/
meta?: { [K in keyof PluginMeta]?: PluginMeta[K] | undefined };
/**
* The definition of plugin processors.
* Users can stringly reference the processor using the key in their config (i.e., `"pluginName/processorName"`).
*/
processors?: Partial<Record<string, Processor>> | undefined;
/**
* The definition of plugin rules.
* The key must be the name of the rule that users will use
* Users can stringly reference the rule using the key they registered the plugin under combined with the rule name.
* i.e. for the user config `plugins: { foo: pluginReference }` - the reference would be `"foo/ruleName"`.
*/
rules?: Record<string, LooseRuleDefinition> | undefined;
}
Properties
| Name |
Type |
Optional |
Description |
configs |
SharedConfigs |
✓ |
not shown |
meta |
{ [K in keyof PluginMeta]?: PluginMeta[K] \| undefined } |
✓ |
not shown |
processors |
Partial<Record<string, Processor>> \| undefined |
✓ |
not shown |
rules |
Record<string, LooseRuleDefinition> \| undefined |
✓ |
not shown |
Plugins
Interface Code
export interface Plugins {
/**
* We intentionally omit the `configs` key from this object because it avoids
* type conflicts with old plugins that haven't updated their configs to flat configs yet.
* It's valid to reference these old plugins because ESLint won't access the
* `.config` property of a plugin when evaluating a flat config.
*/
[pluginAlias: string]: Omit<Plugin, 'configs'>;
}
LinterOptions
Interface Code
export interface LinterOptions {
/**
* A Boolean value indicating if inline configuration is allowed.
*/
noInlineConfig?: boolean;
/**
* A severity string indicating if and how unused disable and enable
* directives should be tracked and reported. For legacy compatibility, `true`
* is equivalent to `"warn"` and `false` is equivalent to `"off"`.
* @default "warn"
*/
reportUnusedDisableDirectives?:
boolean | SharedConfig.Severity | SharedConfig.SeverityString;
/**
* A severity string indicating if and how unused inline directives
* should be tracked and reported.
*
* since ESLint 9.19.0
* @default "off"
*/
reportUnusedInlineConfigs?:
SharedConfig.Severity | SharedConfig.SeverityString;
}
Properties
| Name |
Type |
Optional |
Description |
noInlineConfig |
boolean |
✓ |
not shown |
reportUnusedDisableDirectives |
boolean \| SharedConfig.Severity \| SharedConfig.SeverityString |
✓ |
not shown |
reportUnusedInlineConfigs |
SharedConfig.Severity \| SharedConfig.SeverityString |
✓ |
not shown |
LanguageOptions
Interface Code
export interface LanguageOptions {
/**
* 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.
* @default "latest"
*/
ecmaVersion?: EcmaVersion | undefined;
/**
* An object specifying additional objects that should be added to the global scope during linting.
*/
globals?: GlobalsConfig | undefined;
/**
* An object containing a `parse()` method or a `parseForESLint()` method.
* @default
* ```
* // https://github.com/eslint/espree
* require('espree')
* ```
*/
parser?: Parser | undefined;
/**
* An object specifying additional options that are passed directly to the parser.
* The available options are parser-dependent.
*/
parserOptions?: ParserOptions | 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
* ```
* // for `.js` and `.mjs` files
* "module"
* // for `.cjs` files
* "commonjs"
* ```
*/
sourceType?: SourceType | undefined;
}
Properties
| Name |
Type |
Optional |
Description |
ecmaVersion |
EcmaVersion \| undefined |
✓ |
not shown |
globals |
GlobalsConfig \| undefined |
✓ |
not shown |
parser |
Parser \| undefined |
✓ |
not shown |
parserOptions |
ParserOptions \| undefined |
✓ |
not shown |
sourceType |
SourceType \| undefined |
✓ |
not shown |
Config
Interface Code
export interface Config {
/**
* The base path for files and ignores.
*
* Note that this is not permitted inside an `extends` array.
*
* Since ESLint 9.30.0
*/
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 matched by any other configuration object.
*/
files?: (
| string
| string[] // yes, a single layer of array nesting is supported
)[];
/**
* 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[];
/**
* Language specifier in the form `namespace/language-name` where `namespace` is a plugin name set in the `plugins` field.
*/
language?: string;
/**
* An object containing settings related to how JavaScript is configured for linting.
*/
languageOptions?: LanguageOptions;
/**
* An object containing settings related to the linting process.
*/
linterOptions?: LinterOptions;
/**
* An string to identify the configuration object. Used in error messages and inspection tools.
*/
name?: string;
/**
* 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?: Plugins;
/**
* 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 the configured rules.
* When `files` or `ignores` are specified, these rule configurations are only available to the matching files.
*/
rules?: Rules;
/**
* An object containing name-value pairs of information that should be available to all rules.
*/
settings?: Settings;
}
Properties
| Name |
Type |
Optional |
Description |
basePath |
string |
✓ |
not shown |
files |
( \| string \| string[] // yes, a single layer of array nesting is supported )[] |
✓ |
not shown |
ignores |
string[] |
✓ |
not shown |
language |
string |
✓ |
not shown |
languageOptions |
LanguageOptions |
✓ |
not shown |
linterOptions |
LinterOptions |
✓ |
not shown |
name |
string |
✓ |
not shown |
plugins |
Plugins |
✓ |
not shown |
processor |
string \| Processor |
✓ |
not shown |
rules |
Rules |
✓ |
not shown |
settings |
Settings |
✓ |
not shown |
Type Aliases
Severity
type Severity = 0 | 1 | 2;
SeverityString
type SeverityString = 'error' | 'off' | 'warn';
RuleLevel
type RuleLevel = Severity | SeverityString;
RuleLevelAndOptions
type RuleLevelAndOptions = [RuleLevel, ...unknown[]];
RuleEntry
type RuleEntry = RuleLevel | RuleLevelAndOptions;
RulesRecord
type RulesRecord = Partial<Record<string, RuleEntry>>;
GlobalVariableOptionBase
type GlobalVariableOptionBase = | 'off'
| /** @deprecated use `'readonly'` */ 'readable'
| 'readonly'
| 'writable'
| /** @deprecated use `'writable'` */ 'writeable';
GlobalVariableOptionBoolean
type GlobalVariableOptionBoolean = | /** @deprecated use `'readonly'` */ false
| /** @deprecated use `'writable'` */ true;
GlobalVariableOption
type GlobalVariableOption = GlobalVariableOptionBase | GlobalVariableOptionBoolean;
ParserOptions
type ParserOptions = ParserOptionsTypes.ParserOptions;
EnvironmentConfig
type EnvironmentConfig = SharedConfig.EnvironmentConfig;
GlobalsConfig
type GlobalsConfig = SharedConfig.GlobalsConfig;
GlobalVariableOption
type GlobalVariableOption = SharedConfig.GlobalVariableOption;
GlobalVariableOptionBase
type GlobalVariableOptionBase = SharedConfig.GlobalVariableOptionBase;
ParserOptions
type ParserOptions = SharedConfig.ParserOptions;
RuleEntry
type RuleEntry = SharedConfig.RuleEntry;
RuleLevel
type RuleLevel = SharedConfig.RuleLevel;
RuleLevelAndOptions
type RuleLevelAndOptions = SharedConfig.RuleLevelAndOptions;
RulesRecord
type RulesRecord = SharedConfig.RulesRecord;
Severity
type Severity = SharedConfig.Severity;
SeverityString
type SeverityString = SharedConfig.SeverityString;
EcmaVersion
type EcmaVersion = ParserOptionsTypes.EcmaVersion;
GlobalsConfig
type GlobalsConfig = SharedConfig.GlobalsConfig;
Parser
type Parser = ParserType.LooseParserModule;
ParserOptions
type ParserOptions = SharedConfig.ParserOptions;
type PluginMeta = SharedConfig.PluginMeta;
Processor
type Processor = ProcessorType.LooseProcessorModule;
RuleEntry
type RuleEntry = SharedConfig.RuleEntry;
RuleLevel
type RuleLevel = SharedConfig.RuleLevel;
RuleLevelAndOptions
type RuleLevelAndOptions = SharedConfig.RuleLevelAndOptions;
Rules
type Rules = SharedConfig.RulesRecord;
Settings
type Settings = SharedConfigurationSettings;
Severity
type Severity = SharedConfig.Severity;
SeverityString
type SeverityString = SharedConfig.SeverityString;
SourceType
type SourceType = 'commonjs' | ParserOptionsTypes.SourceType;
ConfigArray
type ConfigArray = Config[];
ConfigPromise
type ConfigPromise = Promise<ConfigArray>;
ConfigFile
type ConfigFile = ConfigArray | ConfigPromise;
Generated by Syntax Scribe