-
Notifications
You must be signed in to change notification settings - Fork 76
Closed
Labels
Description
Environment
- Operating System: macOS 15.6
- Node Version: 24.3.0
- Nuxt Version: 4.0.3
- Package Manager: npm
- @nuxt/eslint Version: 1.8.0
Package
@nuxt/eslint
Reproduction
- Create a fresh Nuxt project:
npm create nuxt@latest my-app - Add ESLint module:
npx nuxi module add eslint - Rename
nuxt.config.tstonuxt.config.js - add
eslint . --max-warnings=0to npm script - Run the eslint script
- See the error:
'defineNuxtConfig' is not defined.eslint(no-undef)
Describe the bug
When using @nuxt/eslint module with a JavaScript configuration file (nuxt.config.js), ESLint reports 'defineNuxtConfig' is not defined error due to the no-undef rule. However, the same configuration works fine when using TypeScript (nuxt.config.ts).
Investigation
After examining the generated .nuxt/eslint.config.mjs file, I discovered that defineNuxtConfig is missing from the globals list, while other Nuxt globals are present:
// .nuxt/eslint.config.mjs
{
name: 'nuxt/import-globals',
languageOptions: {
globals: Object.fromEntries([
"defineAppConfig",
"__buildAssetsURL",
// ... many other globals ...
"defineNuxtPlugin",
"definePayloadPlugin",
// defineNuxtConfig is MISSING here!
].map(i => [i, 'readonly'])),
},
}Additional context
No response