eslint not working vscode eslint extension

eslint works inside docker ofc but not outside. i have the follwing eslint.config.mjs
// @ts-check
import withNuxt from './.nuxt/eslint.config.mjs'

export default withNuxt(
// Your custom configs here
)
// @ts-check
import withNuxt from './.nuxt/eslint.config.mjs'

export default withNuxt(
// Your custom configs here
)
9 Replies
kapa.ai
kapa.ai2d ago
Hi @pearbender. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Your ESLint setup for Nuxt 3 using the flat config format looks correct:
// @ts-check
import withNuxt from './.nuxt/eslint.config.mjs'

export default withNuxt(
// Your custom configs here
)
// @ts-check
import withNuxt from './.nuxt/eslint.config.mjs'

export default withNuxt(
// Your custom configs here
)
If ESLint works inside Docker but not in your local VS Code, the issue is likely with your VS Code ESLint extension configuration, not with your Nuxt or ESLint setup. Key things to check: 1. VS Code ESLint Extension Version - ESLint v9.x (and the flat config format) is only supported in the VS Code ESLint extension (vscode-eslint) version 3.0.10 and above. - If you are using an older version, you must enable flat config support manually in your .vscode/settings.json:
{
// Required in vscode-eslint < v3.0.10 only
"eslint.useFlatConfig": true
}

{
// Required in vscode-eslint < v3.0.10 only
"eslint.useFlatConfig": true
}

- If possible, update your VS Code ESLint extension to the latest version, which supports flat config out of the box ESLint Module Recipes. 2. ESLint Installed Locally - Make sure you have eslint installed in your local project (not just in Docker). 3. VS Code Uses the Correct Node Environment - Sometimes, VS Code may use a different Node.js version or environment than your Docker container. Make sure your local environment matches what works in Docker. 4. Check for Errors in the VS Code Output Panel - Open the "Output" panel in VS Code, select "ESLint" from the dropdown, and look for any errors or warnings that might indicate what's wrong. 5. Project Structure - Ensure that your eslint.config.mjs is at the project root and that VS Code is opening the correct folder. Summary:
Update your VS Code ESLint extension to v3.0.10 or later, or set "eslint.useFlatConfig": true in your .vscode/settings.json if you are on an older version. This should resolve issues with ESLint not working outside Docker when using the new flat config format with Nuxt 3 ESLint Module Recipes. If you continue to have issues, please provide any error messages from the VS Code ESLint output for further troubleshooting. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2d ago
<@779279431419559947> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
pearbender
pearbenderOP2d ago
@kapa.ai my eslint.config.mjs is not at the root but inside frontend
kapa.ai
kapa.ai2d ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- If your eslint.config.mjs is inside a subfolder (e.g., frontend/) and not at the project root, this may cause issues with the VS Code ESLint extension detecting and applying your configuration. The knowledge sources do not explicitly state support for placing eslint.config.mjs in a subdirectory; all examples and documentation assume it is at the project root. For example, the Nuxt ESLint module documentation says:
Once you start your Nuxt app, a eslint.config.mjs file will be generated under your project root. You can customize it as needed.
ESLint Module Therefore, to ensure proper detection by both Nuxt and the VS Code ESLint extension, you should place your eslint.config.mjs at the root of your project (the same level as your package.json and nuxt.config.ts). If you keep it inside frontend/, VS Code and some tooling may not find or apply your ESLint configuration correctly. Recommendation:
Move eslint.config.mjs to your project root for best compatibility with Nuxt and VS Code ESLint integration. If you need to support a monorepo or custom structure, the knowledge sources do not provide explicit guidance for that scenario. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2d ago
<@779279431419559947> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
pearbender
pearbenderOP2d ago
@kapa.ai i'm seeing
[Error - 11:42:08 PM] Calculating config file for file:///c%3A/Users/user/code/project/frontend/tsconfig.json) failed.
Error: Failed to load native binding
at Object.<anonymous> (C:\Users\user\code\project\frontend\node_modules\unrs-resolver\index.js:372:11)
at Module._compile (node:internal/modules/cjs/loader:1484:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1564:10)
at Module.load (node:internal/modules/cjs/loader:1295:32)
at Module._load (node:internal/modules/cjs/loader:1111:12)
at c._load (node:electron/js2c/node_init:2:16955)
at cjsLoader (node:internal/modules/esm/translators:350:17)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:286:7)
at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
[Error - 11:42:08 PM] Calculating config file for file:///c%3A/Users/user/code/project/frontend/tsconfig.json) failed.
Error: Failed to load native binding
at Object.<anonymous> (C:\Users\user\code\project\frontend\node_modules\unrs-resolver\index.js:372:11)
at Module._compile (node:internal/modules/cjs/loader:1484:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1564:10)
at Module.load (node:internal/modules/cjs/loader:1295:32)
at Module._load (node:internal/modules/cjs/loader:1111:12)
at c._load (node:electron/js2c/node_init:2:16955)
at cjsLoader (node:internal/modules/esm/translators:350:17)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:286:7)
at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
kapa.ai
kapa.ai2d ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- I'm sorry, but the knowledge sources provided do not contain information about the specific error message related to "Failed to load native binding" from unrs-resolver or how to resolve it in the context of Nuxt or its ESLint integration. The documentation covers ESLint configuration, flat config usage, and VS Code integration, but does not mention this error or the unrs-resolver package. If you need further assistance, please provide more context or consult the documentation for the specific package mentioned in the error. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2d ago
<@779279431419559947> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
pearbender
pearbenderOP2d ago
the problem is a mismatch between my node version outside and inside docker. the native module will not work outside because it was compiled for a different version even installing the same node version inside and out of docker eslint fails outside of docker bc i'm sharing node_modules and windows and node alpine use different c runtimes. need to not share node_moduels

Did you find this page helpful?