📄 FlatESLint.ts
¶
📊 Analysis Summary¶
Metric | Count |
---|---|
🔧 Functions | 2 |
🧱 Classes | 2 |
📦 Imports | 2 |
📐 Interfaces | 1 |
📑 Type Aliases | 13 |
📚 Table of Contents¶
🛠️ File Location:¶
📂 packages/utils/src/ts-eslint/eslint/FlatESLint.ts
📦 Imports¶
Name | Source |
---|---|
ESLintFlatESLint |
eslint/use-at-your-own-risk |
FlatConfig |
../Config |
Functions¶
FlatESLintBase.calculateConfigForFile(filePath: string): Promise<FlatConfig.ConfigArray>
¶
-
JSDoc:
/** * Returns a configuration object for the given file based on the CLI options. * This is the same logic used by the ESLint CLI executable to determine * configuration for each file it processes. * @param filePath The path of the file to retrieve a config object for. * @returns A configuration object for the file or `undefined` if there is no configuration data for the object. */
-
Parameters:
filePath: string
- Return Type:
Promise<FlatConfig.ConfigArray>
FlatESLintBase.findConfigFile(): Promise<string | undefined>
¶
-
JSDoc:
-
Return Type:
Promise<string | undefined>
Classes¶
FlatESLintBase
¶
Class Code
declare class FlatESLintBase extends Shared.ESLintBase<
FlatConfig.ConfigArray,
FlatESLint.ESLintOptions
> {
static readonly configType: 'flat';
/**
* Returns a configuration object for the given file based on the CLI options.
* This is the same logic used by the ESLint CLI executable to determine
* configuration for each file it processes.
* @param filePath The path of the file to retrieve a config object for.
* @returns A configuration object for the file or `undefined` if there is no configuration data for the object.
*/
calculateConfigForFile(filePath: string): Promise<FlatConfig.ConfigArray>;
/**
* Finds the config file being used by this instance based on the options
* passed to the constructor.
* @returns The path to the config file being used or `undefined` if no config file is being used.
*/
findConfigFile(): Promise<string | undefined>;
}
Methods¶
calculateConfigForFile(filePath: string): Promise<FlatConfig.ConfigArray>
¶
findConfigFile(): Promise<string | undefined>
¶
FlatESLint
¶
Interfaces¶
ESLintOptions
¶
Interface Code
export interface ESLintOptions
extends Shared.ESLintOptions<FlatConfig.ConfigArray> {
/**
* If false is present, the eslint.lintFiles() method doesn't respect `ignorePatterns` ignorePatterns in your configuration.
* @default true
*/
ignore?: boolean;
/**
* Ignore file patterns to use in addition to config ignores. These patterns are relative to cwd.
* @default null
*/
ignorePatterns?: string[] | null;
/**
* The path to a configuration file, overrides all configurations used with this instance.
* The options.overrideConfig option is applied after this option is applied.
* Searches for default config file when falsy; doesn't do any config file lookup when `true`; considered to be a config filename when a string.
* @default false
*/
overrideConfigFile?: boolean | string;
/**
* A predicate function that filters rules to be run.
* This function is called with an object containing `ruleId` and `severity`, and returns `true` if the rule should be run.
* @default () => true
*/
ruleFilter?: RuleFilter;
/**
* When set to true, additional statistics are added to the lint results.
* @see {@link https://eslint.org/docs/latest/extend/stats}
* @default false
*/
stats?: boolean;
/**
* Show warnings when the file list includes ignored files.
* @default true
*/
warnIgnored?: boolean;
}
Properties¶
Name | Type | Optional | Description |
---|---|---|---|
ignore |
boolean |
✓ | |
ignorePatterns |
string[] | null |
✓ | |
overrideConfigFile |
boolean | string |
✓ | |
ruleFilter |
RuleFilter |
✓ | |
stats |
boolean |
✓ | |
warnIgnored |
boolean |
✓ |