There appears to be an issue with custom config presets like Antfu's eslint-config crashing the ESLint server in VSCode any time the config changes after initialization. I have set it up like the docs instruct and it works perfectly until something changes.
The linked reproduction has a simple way to spot the issue. In App.vue there's a line with an unused variable. ESLint will call it out. Now change something in eslint.config.mjs, even if it's just adding a space. The ESLint server will crash with this error:
ConfigError: Config "antfu/test/setup": Key "plugins": Cannot redefine plugin "test".
at rethrowConfigError (/Users/me/development/project/node_modules/@humanwhocodes/config-array/api.js:225:8)
at /Users/me/development/project/node_modules/@humanwhocodes/config-array/api.js:1018:5
at Array.reduce (<anonymous>)
at FlatConfigArray.getConfig (/Users/me/development/project/node_modules/@humanwhocodes/config-array/api.js:1014:39)
at ESLint.calculateConfigForFile (/Users/me/development/project/node_modules/eslint/lib/eslint/eslint.js:1175:24)
at async ESLint.isPathIgnored (/Users/me/development/project/node_modules/eslint/lib/eslint/eslint.js:1197:24)
at async ESLint.lintText (/Users/me/development/project/node_modules/eslint/lib/eslint/eslint.js:1034:33)
at async /Users/me/.vscode-insiders/extensions/dbaeumer.vscode-eslint-3.0.5/server/out/eslintServer.js:1:26928
at async M (/Users/me/.vscode-insiders/extensions/dbaeumer.vscode-eslint-3.0.5/server/out/eslintServer.js:1:19754)
at async /Users/me/.vscode-insiders/extensions/dbaeumer.vscode-eslint-3.0.5/server/out/eslintServer.js:1:233425
It's not a huge issue, but I wanted to report it anyway because Nuxt usually doesn't require restarting services to adapt to changes in config files.
Environment
Darwin
v18.18.2
3.11.2
3.11.1
2.9.6
pnpm@8.15.3
-
devtools
,modules
,eslint
@nuxt/eslint@0.3.4
-
Package
@nuxt/eslint
Reproduction
https://github.com/Ragura/antfu-eslint-config-repro
Describe the bug
There appears to be an issue with custom config presets like Antfu's eslint-config crashing the ESLint server in VSCode any time the config changes after initialization. I have set it up like the docs instruct and it works perfectly until something changes. The linked reproduction has a simple way to spot the issue. In
App.vue
there's a line with an unused variable. ESLint will call it out. Now change something ineslint.config.mjs
, even if it's just adding a space. The ESLint server will crash with this error:It's not a huge issue, but I wanted to report it anyway because Nuxt usually doesn't require restarting services to adapt to changes in config files.
Additional context
No response
Logs
No response