N
Nuxtβ€’4mo ago
Omnislash

ES Lint breaks when upgading

Hello, If I upgrade from nuxt 3.16.2 to 3.17.4, ESLint is suddenly not available anymore in vscode Is it a known problem ? how to fix it ? Thanks πŸ™‚
6 Replies
kapa.ai
kapa.aiβ€’4mo ago
Hi @Omnislash. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- There is no explicit mention in the provided knowledge sources of a widespread or officially recognized issue where ESLint becomes unavailable in VSCode specifically after upgrading from Nuxt 3.16.2 to 3.17.4. However, there are a few relevant points and recommendations that may help you resolve the problem: 1. ESLint Flat Config Migration: Nuxt 3 recommends using the new @nuxt/eslint module, which generates a project-aware ESLint flat config. The legacy .eslintrc format is not supported by this module, and migration to the flat config is highly recommended for future compatibility, especially since ESLint v9+ uses flat config by default. If your project is still using the old config, this could cause issues after upgrading Nuxt or ESLint versions. You can set up the recommended config with:
npx nuxi module add eslint

npx nuxi module add eslint

This will generate an eslint.config.mjs file at your project root, which you can customize as needed. Make sure to remove any legacy .eslintrc files to avoid conflicts.
Nuxt Code Style Guide
ESLint Module Docs 2. VSCode Integration: If ESLint is not working in VSCode, ensure that: - The ESLint extension for VSCode is installed and enabled. - Your project contains a valid ESLint config file (eslint.config.mjs for flat config). - All required dependencies (eslint, @nuxt/eslint, etc.) are installed in your project. 3. Dependency Compatibility: Upgrading Nuxt may also upgrade or change dependencies, including ESLint and TypeScript. If you see warnings about unsupported TypeScript versions or peer dependency conflicts (as described in the Stack Overflow post), you may need to update related packages manually:
npm install -D @typescript-eslint/eslint-plugin @typescript-eslint/parser --legacy-peer-deps

npm install -D @typescript-eslint/eslint-plugin @typescript-eslint/parser --legacy-peer-deps

This can help resolve version mismatches that might prevent ESLint from running properly in your editor
Stack Overflow: TypeScript/ESLint Issue 4. Known Issues: There is no direct mention of a bug in Nuxt 3.17.x that disables ESLint in VSCode, but dependency changes and the move to flat config are common sources of such issues. Summary:
- Ensure you are using the new flat config (eslint.config.mjs) with @nuxt/eslint. - Remove legacy .eslintrc files. - Check that all dependencies are up to date and compatible. - Restart VSCode after making changes. If you continue to experience issues, please provide any error messages from the VSCode output or ESLint logs for more targeted troubleshooting. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.aiβ€’4mo ago
<@305772639438503936> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Adam
Adamβ€’4mo ago
Is your eslint on the latest version?
Omnislash
OmnislashOPβ€’4mo ago
yup, I updated it 1.3.0 to 1.4.1 at the same time If I update esling without updating nuxt it works well
Adam
Adamβ€’4mo ago
There is maybe a big change in eslint between those versions, if I were you I would look into that Otherwise I heard somewhere else similar issues that were related to breaking changes in eslint, but i don't know if there would be any between two patches
Omnislash
OmnislashOPβ€’4mo ago
perplexity gave me some things to add in the vscode settings.json, but other updates add an other warning so... I just reverted everything for now ^^" maybe the flat config with the .mjs ? But it's what I'm using already I'll probably wait for this one to be resolved in a later update : https://ptb.discord.com/channels/473401852243869706/1378646939595440128 Then I'll see if it's just a settings.json conf ^^

Did you find this page helpful?