Registry / testing / eslint-plugin-nuxt

eslint-plugin-nuxt

JSON →
library4.0.0jsnpmunverified

ESLint plugin providing Nuxt.js-specific linting rules, including checks for environment variables, lifecycle hooks, and correct usage of asyncData/fetch. Current stable version is 4.0.0, released in 2022. Maintained by the Nuxt team, it enforces best practices for Nuxt 2 and Nuxt 3 projects. Key differentiators: rules like no-env-in-context and no-this-in-fetch-data that catch common Nuxt pitfalls. Supports ESLint 8 and requires eslint-plugin-vue and vue-eslint-parser. Release cadence is sporadic with major version bumps aligning with Nuxt ecosystem updates.

npm install eslint-plugin-nuxt
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-NUXT
E
eslint-plugin-nuxt
testingjavascriptv4.0.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin:nuxt/recommended
✓ "extends": ["plugin:nuxt/recommended"]
✗ "extends": ["nuxt/recommended"]
Must include 'plugin:' prefix in extends config
plugins
✓ "plugins": ["nuxt"]
✗ "plugins": ["eslint-plugin-nuxt"]
ESLint automatically adds 'eslint-plugin-' prefix
nuxt/rule-name
✓ "rules": { "nuxt/no-env-in-context": "error" }
✗ "rules": { "no-env-in-context": "error" }
Rules must be prefixed with 'nuxt/'

Shows how to configure ESLint with eslint-plugin-nuxt using the recommended preset and add a custom rule.

// .eslintrc.json { "extends": ["plugin:nuxt/recommended"], "rules": { "nuxt/no-env-in-context": "error" } } // Install dependencies: // npm install --save-dev eslint eslint-plugin-nuxt eslint-plugin-vue vue-eslint-parser
Debug
Known issues
breakingNode.js 12 support dropped in v4.0.0
fix
Use Node.js 14 or later
affects: >=4.0.0
breakingESLint 7 dropped in v3.0.0, requires ESLint 8
fix
Update ESLint to 8.x
affects: >=3.0.0
breakingvue-eslint-parser v9 required in v4.0.0
fix
Update vue-eslint-parser to v9
affects: >=4.0.0
breakingeslint-plugin-vue v9 required in v4.0.0
fix
Update eslint-plugin-vue to v9
affects: >=4.0.0
deprecatedNode 10 support dropped in v3.0.0
fix
Use Node.js 12+ (but for v4, use Node 14+)
affects: >=3.0.0
Errors
Common errors & fixes
Error: Failed to load plugin 'nuxt': Cannot find module 'eslint-plugin-nuxt'
eslint-plugin-nuxt not installed
fix
npm install --save-dev eslint-plugin-nuxt
Parsing error: The keyword 'import' is reserved
Missing vue-eslint-parser or incorrect parser
fix
Add 'parser: vue-eslint-parser' to .eslintrc if not using presets
Definition for rule 'nuxt/no-this-in-fetch-data' was not found
The rule name might be misspelled or the version is too old
fix
Use correct rule name like 'nuxt/no-this-in-fetch-data' and ensure eslint-plugin-nuxt >=0.4
Upgrade
Version history
4.0.0latest on npm
Audit
Dependencies
eslint-plugin-vuerequiredRequired for Vue-related rules
vue-eslint-parserrequiredParses .vue files
Agent activity
6 hits · last 30 days
node
6
Resources
eslint-plugin-nuxt — npm install eslint-plugin-nuxt · libregistry