antfu / eslint-config

Anthony's ESLint config preset
https://eslint-config.antfu.me/
MIT License
3.81k stars 426 forks source link

with Nuxt: Error: Key "plugins": Cannot redefine plugin "import" #482

Closed GaborTorma closed 4 months ago

GaborTorma commented 4 months ago

Describe the bug

I got a following error when I use @anftu/eslint-config with @nuxt/eslint:

Error: Key "plugins": Cannot redefine plugin "import".
    at new WrapperError (/home/projects/github-6rwuyx-aqu4ru/node_modules/@humanwhocodes/object-schema/src/object-schema.js:123:9)
    at eval (/home/projects/github-6rwuyx-aqu4ru/node_modules/@humanwhocodes/object-schema/src/object-schema.js:250:27)
    at ObjectSchema.merge (/home/projects/github-6rwuyx-aqu4ru/node_modules/@humanwhocodes/object-schema/src/object-schema.js:237:24)
    at eval (/home/projects/github-6rwuyx-aqu4ru/node_modules/@humanwhocodes/config-array/api.js:935:42)
    at FlatConfigArray.getConfig (/home/projects/github-6rwuyx-aqu4ru/node_modules/@humanwhocodes/config-array/api.js:934:39)
    at FlatConfigArray.isFileIgnored (/home/projects/github-6rwuyx-aqu4ru/node_modules/@humanwhocodes/config-array/api.js:962:15)
    at eval (/home/projects/github-6rwuyx-aqu4ru/node_modules/eslint/lib/eslint/eslint-helpers.js:312:49)

Reproduction

https://stackblitz.com/edit/github-6rwuyx-aqu4ru

System Info

System:
    OS: Linux 5.15 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (32) x64 Intel(R) Core(TM) i9-14900KS
    Memory: 19.34 GB / 31.22 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 20.13.1 - /usr/bin/node
    npm: 10.8.0 - /usr/bin/npm
    pnpm: 9.1.2 - /usr/bin/pnpm
  Browsers:
    Chrome: 125.0.6422.60

Used Package Manager

pnpm

Validations

GaborTorma commented 4 months ago

I tried with older version of @humanwhocodes/config-array and @humanwhocodes/object-schema, but the result is same.

GaborTorma commented 4 months ago

The problem is when merging antfu/imports/rules 2024-05-22_08-30-50

Dimava commented 4 months ago

Duplicate of #473

You should set standalone to false

Tho I guess that should be added to Readme


[tick] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate

Why do you think you are requested to check it. Make sure to search everywhere (erasing is:issue is:open before entering search term) next time.

GaborTorma commented 4 months ago

It works, thanx!