Skip to content

Bug: ConfigError: Config (unnamed): Key "plugins": Cannot redefine plugin "@". when using ESLint class API with overrideConfigFile: true #19722

@JounQin

Description

@JounQin

Environment

Node version: v20.19.1
npm version: v10.8.2
Local ESLint version: v9.26.0 (Currently used)
Global ESLint version: Not found
Operating System: darwin 24.4.0

What parser are you using?

Default (Espree)

What did you do?

API usage
await eslint.lintText(text, {
  filePath,
  warnIgnored: true,
})

What did you expect to happen?

No error without delete eslintConfig.overrideConfig.plugins;

What actually happened?

ConfigError: Config (unnamed): Key "plugins": Cannot redefine plugin "@".

Link to Minimal Reproducible Example

prettier/prettier-eslint#1190

Reproduce steps:

yarn install
# remove `delete eslintConfig.overrideConfig.plugins;` at src/index.ts#L250
yarn format

Participation

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

Additional comments

I'm adding eslint v9 support for https://github.com/prettier/prettier-eslint at prettier/prettier-eslint#1190

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugESLint is working incorrectlyrepro:neededThis issue should include a reproducible example

    Type

    No type

    Projects

    Status

    Complete

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions