Override eslint flat config issue

Not sure if this is a bug or if I'm doing it wrong since I'm new to eslint 9.0 flat configs, but... I'm using the new nuxt eslint config (https://eslint.nuxt.com/) and I'm trying to override the no-unused-vars rule in my eslint.config.mjs file like this:
withNuxt().override('nuxt/javascript', {
rules: {
'no-unused-vars': [
'error',
{ args: 'after-used', ignoreRestSiblings: true, caughtErrors: 'none' },
],
},
})
withNuxt().override('nuxt/javascript', {
rules: {
'no-unused-vars': [
'error',
{ args: 'after-used', ignoreRestSiblings: true, caughtErrors: 'none' },
],
},
})
However, when I run eslint . on my project I get an error saying: 'Error: ESLintFlatConfigUtils: Failed to locate config with name "nuxt/javascript"'. I can fix this problem by changing the override name to @eslint/js/recommended, but this causes nuxt dev tools to show an error: 'Error: ESLintFlatConfigUtils: Failed to locate config with name "@eslint/js/recommended"'. It seems like dev tools and eslint are opposed with the names available, possibly due to some kind of aliasing under the hood? For reference, these are the available names in nuxt dev tools:
Available names are: nuxt/javascript, nuxt/typescript/setup, nuxt/typescript/rules, nuxt/vue/setup, nuxt/vue/rules, nuxt/import/rules, nuxt/configs, nuxt/vue/single-root, nuxt/rules, nuxt/disables/routes, nuxt/import-globals
Available names are: nuxt/javascript, nuxt/typescript/setup, nuxt/typescript/rules, nuxt/vue/setup, nuxt/vue/rules, nuxt/import/rules, nuxt/configs, nuxt/vue/single-root, nuxt/rules, nuxt/disables/routes, nuxt/import-globals
And these are the available names to eslint from the CLI:
Available names are: @eslint/js/recommended, nuxt/typescript/setup, nuxt/typescript/rules, nuxt/vue/setup, nuxt/vue/rules, nuxt/import/rules, nuxt/configs, nuxt/vue/single-root, nuxt/rules, nuxt/disables/routes, nuxt/import-globals
Available names are: @eslint/js/recommended, nuxt/typescript/setup, nuxt/typescript/rules, nuxt/vue/setup, nuxt/vue/rules, nuxt/import/rules, nuxt/configs, nuxt/vue/single-root, nuxt/rules, nuxt/disables/routes, nuxt/import-globals
Nuxt ESLint
Nuxt ESLint
Collection of ESLint-related packages for Nuxt
1 Reply
Mark Brouch
Mark BrouchOP7mo ago
GitHub
Error when overriding nuxt/javascript config · Issue #408 · nuxt/...
Environment Operating System: Darwin Node Version: v18.16.1 Nuxt Version: 3.11.1 CLI Version: 3.11.1 Nitro Version: 2.9.4 Package Manager: [email protected] Builder: - User Config: rootDir, devtools, type...
Want results from more Discord servers?
Add your server