Skip to content

Type Regression in 5.5.0 Build #426

@Kenneth-Sills

Description

@Kenneth-Sills

If you view the lib/index.d.ts generated for the 5.4.1 release, you will find the exported configs object typed out as:

    configs: {
        base: {
            plugins: string[];
            overrides: {
                files: string[];
                parser: string;
            }[];
        };
        recommended: {
            extends: string[];
            rules: {
                "json-schema-validator/no-invalid": string;
            };
        };
        "flat/base": import("eslint").Linter.FlatConfig[];
        "flat/recommended": import("eslint").Linter.FlatConfig[];
    };

But in the latest 5.5.0 build (which only changes the lookup URLs), the resolved type for configs['flat/*'] has been changed:

    configs: {
        base: {
            plugins: string[];
            overrides: {
                files: string[];
                parser: string;
            }[];
        };
        recommended: {
            extends: string[];
            rules: {
                "json-schema-validator/no-invalid": string;
            };
        };
        "flat/base": import("eslint").Linter.FlatConfig<import("@eslint/core").RulesConfig>[];
        "flat/recommended": import("eslint").Linter.FlatConfig<import("@eslint/core").RulesConfig>[];
    };

In my project, with ESLint 8.57.1 (in flat config mode) and Typescript 5.9.3, this fails to resolve correctly and the typing comes out as any[] for both properties. As a result, linting fails.

The simple workaround is to just force the typing, so not a big deal. 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions