Repository: eslint/eslint
File: lib/types/index.d.ts (TypeScript)

Code before:

        /**
         * The times spent on (parsing, fixing, linting) a file, where the linting refers to the timing information for each rule.
         */
        times: { passes: TimePass[] };
    }

    interface TimePass {
        parse: { total: number };
        rules?: Record<string, { total: number }>;
        fix: { total: number };
        total: number;
    }
}

// #endregion

// #region ESLint

export class ESLint {
    static configType: "flat";

    static readonly version: string;

    /**
     * The default configuration that ESLint uses internally. This can change between versions, so it's not recommended to rely on this object.
     */
    static readonly defaultConfig: Linter.Config[];

    static outputFixes(results: ESLint.LintResult[]): Promise<void>;

    static getErrorResults(results: ESLint.LintResult[]): ESLint.LintResult[];

    constructor(options?: ESLint.Options);

    lintFiles(patterns: string | string[]): Promise<ESLint.LintResult[]>;

    lintText(
        code: string,
        options?: { filePath?: string | undefined; warnIgnored?: boolean | undefined },
    ): Promise<ESLint.LintResult[]>;

    getRulesMetaForResults(results: ESLint.LintResult[]): ESLint.LintResultData["rulesMeta"];

    hasFlag(flag: string): boolean;

    calculateConfigForFile(filePath: string): Promise<any>;

    findConfigFile(): Promise<string | undefined>;

    isPathIgnored(filePath: string): Promise<boolean>;

Review comment (suggestion):
```suggestion
     * The default configuration that ESLint uses internally. This can change between versions, so relying on this object is not recommended.
```


Code after:

        /**
         * The times spent on (parsing, fixing, linting) a file, where the linting refers to the timing information for each rule.
         */
        times: { passes: TimePass[] };
    }

    interface TimePass {
        parse: { total: number };
        rules?: Record<string, { total: number }>;
        fix: { total: number };
        total: number;
    }
}

// #endregion

// #region ESLint

export class ESLint {
    static configType: "flat";

    static readonly version: string;

    /**
     * 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.
     */
    static readonly defaultConfig: Linter.Config[];

    static outputFixes(results: ESLint.LintResult[]): Promise<void>;

    static getErrorResults(results: ESLint.LintResult[]): ESLint.LintResult[];

    constructor(options?: ESLint.Options);

    lintFiles(patterns: string | string[]): Promise<ESLint.LintResult[]>;

    lintText(
        code: string,
        options?: { filePath?: string | undefined; warnIgnored?: boolean | undefined },
    ): Promise<ESLint.LintResult[]>;

    getRulesMetaForResults(results: ESLint.LintResult[]): ESLint.LintResultData["rulesMeta"];

    hasFlag(flag: string): boolean;

    calculateConfigForFile(filePath: string): Promise<any>;

    findConfigFile(): Promise<string | undefined>;