Skip to content

Bug: Type errors with @types/eslint__eslintrc after upgrading to 9.20.0 #177

@benedictleejh

Description

@benedictleejh

Environment

Node version: v18.20.3
pnpm version: v8.15.6
Local ESLint version: v9.20.0 (Currently used)
Global ESLint version: Not found
Operating System: linux 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36

This the environment in the Stackblitz reproduction.

What parser are you using?

Default (Espree)

What did you do?

After upgrading to ESLint 9.20.0, eslintrc's FlatCompat.extends() fails typechecking against Linter.Config[]

Type 'FlatConfig[]' does not satisfy the expected type 'Config<RulesRecord>[]'.
  Type 'FlatConfig' is not assignable to type 'Config<RulesRecord>'.
    Types of property 'languageOptions' are incompatible.
      Type 'import("/home/projects/vitejs-vite-pwrystkr/node_modules/.pnpm/@[email protected]/node_modules/@types/eslint/index").Linter.LanguageOptions' is not assignable to type 'import("/home/projects/vitejs-vite-pwrystkr/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint/lib/types/index").Linter.LanguageOptions'.
        Index signature for type 'string' is missing in type 'LanguageOptions'.

What did you expect to happen?

Typechecking would pass, like when using 9.19.0

What actually happened?

Typechecking failed

Link to Minimal Reproducible Example

https://stackblitz.com/edit/vitejs-vite-pwrystkr

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

This seems to be related to eslint/eslint#19414 and eslint/eslint#19418, where the types broke after ESLint synced its types with @eslint/core in eslint/eslint#19157. I had to use pnpm to replicate this issue, npm seems to hide this issue somehow.

Metadata

Metadata

Assignees

Labels

acceptedbugSomething isn't workingrepro:yesIssues with a reproducible example

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions