Skip to content

Several built-in Nuxt globals are not defined in ESLint config, causing linter to error in JS files #461

@adamreisnz

Description

@adamreisnz

Environment

  • Operating System: Darwin
  • Node Version: v22.1.0
  • Nuxt Version: 3.12.2
  • CLI Version: 3.12.0
  • Nitro Version: 2.9.6
  • Package Manager: yarn@4.3.1
  • Builder: -
  • User Config: devtools, modules
  • Runtime Modules: @nuxt/eslint@0.3.13
  • Build Modules: -

Package

None

Reproduction

https://github.com/adamreisnz/nuxt-eslint-reproduction/tree/issue-461

Describe the bug

Several built-in Nuxt globals are showing up as undefined, despite using the Nuxt ESLint module.
For example, check the files:

nuxt.config.ts --> defineNuxtConfig is marked by ESLint as not defined
server/test.js --> defineEventHandler and readBody are marked by ESLint as not defined

This list is probably non-exhaustive, it's just the methods I've used so far.

Additional context

This is with a brand new Nuxt app with module enabled, and some additional globals

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions