Registry / testing / eslint-plugin-vue

eslint-plugin-vue

JSON →
library10.9.0jsnpmunverified

Official ESLint plugin for Vue.js providing over 100 rules for Vue 2 and Vue 3 single-file components (SFC). Current stable version is 10.9.0, released monthly with minor updates that may add new rules and default config changes (not strictly semver-major). It requires vue-eslint-parser, optional @typescript-eslint/parser for TypeScript, and @stylistic/eslint-plugin for stylistic rules. Over 100 rules cover template syntax, script setup, component options, and best practices. The plugin ships sharable configs (recommended, strongly-recommended) and supports both legacy eslintrc and flat config (ESLint v9+).

npm install eslint-plugin-vue
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-VUE
E
eslint-plugin-vue
testingjavascriptv10.9.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

flat config
import pluginVue from 'eslint-plugin-vue' export default [pluginVue.configs['flat/recommended']]
module.exports = { extends: ['plugin:vue/vue3-recommended'] }
Flat config (ESLint >=9) uses plugin's configs['flat/...'] object; legacy eslintrc uses string extends. Since v10, flat config is preferred.
plugin
const { rules } = require('eslint-plugin-vue')
const eslintPluginVue = require('eslint-plugin-vue').default
CommonJS require returns the plugin object directly, without .default. TypeScript users can import * as pluginVue from 'eslint-plugin-vue'.
vue-eslint-parser
import parser from 'vue-eslint-parser' export default [{ ... }, { languageOptions: { parser } }]
const parser = require('vue-eslint-parser').default
vue-eslint-parser is ESM-only since v10; use import or require('vue-eslint-parser') (no .default). It must be set as the parser in ESLint configuration.

Flat ESLint configuration using eslint-plugin-vue's recommended rules and vue-eslint-parser for a Vue 3 project.

// eslint.config.js (flat config, ESLint 9+) import pluginVue from 'eslint-plugin-vue' import parser from 'vue-eslint-parser' export default [ pluginVue.configs['flat/recommended'], { rules: { 'vue/multi-word-component-names': 'warn', }, languageOptions: { parser, }, }, ]
Debug
Known issues
breakingESLint v10 support requires vue-eslint-parser >=10.3.0 and eslint-plugin-vue >=10.8.0. Using older versions will fail with 'Failed to load plugin vue'.
fix
Upgrade eslint-plugin-vue to >=10.8.0 and vue-eslint-parser to >=10.3.0.
affects: <10.8.0
breakingFlat config (ESLint 9+) replaces the legacy extends format. Configs are now accessed via pluginVue.configs['flat/recommended'] instead of 'plugin:vue/vue3-recommended'.
fix
Use flat config syntax: import pluginVue from 'eslint-plugin-vue'; export default [pluginVue.configs['flat/recommended']];
affects: >=9.0.0
breakingvue-eslint-parser v10 drops CommonJS support; require() may fail if not handled correctly.
fix
Use import or dynamic import; if using CommonJS, use require('vue-eslint-parser') (no .default).
affects: >=10.0.0
deprecatedLegacy eslintrc configuration (extends: 'plugin:vue/recommended') is deprecated in favor of flat config. The plugin will remove legacy support in a future major version.
fix
Switch to flat config format (ESLint 9+).
affects: >=10.0.0
gotchaMinor releases may introduce new rules that cause additional lint errors. The plugin does not follow ESLint's semantic versioning policy for configs.
fix
Use tilde range (e.g., ^9.0.0) in package.json to limit minor updates, or pin exact version.
affects: >=9.0.0
gotchaWhen using TypeScript, you must install @typescript-eslint/parser and use parser: '@typescript-eslint/parser' for .ts files, while vue-eslint-parser remains the primary parser for .vue files.
fix
Set parser: 'vue-eslint-parser' globally and use parserOptions.parser: '@typescript-eslint/parser'.
affects: >=7.0.0
Errors
Common errors & fixes
Error: Failed to load plugin 'vue' declared in 'plugins': Cannot find module 'eslint-plugin-vue'
The plugin is not installed or not in the project's node_modules.
fix
Run npm install --save-dev eslint-plugin-vue (and required peer deps vue-eslint-parser, etc.).
Error: Failed to load parser 'vue-eslint-parser' declared in 'languageOptions.parser'
vue-eslint-parser is missing or using wrong parser path in flat config.
fix
Install vue-eslint-parser and import it: import parser from 'vue-eslint-parser'; then set languageOptions: { parser }.
Parsing error: The keyword 'import' is reserved
Using ESM import syntax in a CommonJS config file (e.g., .js file with no type: module).
fix
Rename file to .mjs or add 'type': 'module' to package.json, or use require() syntax.
TypeError: pluginVue.configs is not iterable
Using pluginVue.configs['flat/recommended'] in an array without spreading the config object correctly.
fix
Ensure you spread the config: export default [ ...pluginVue.configs['flat/recommended'], { ... } ] or use pluginVue.configs['flat/recommended'] as a single entry in the array.
Upgrade
Version history
10.9.0latest on npm
Audit
Dependencies
vue-eslint-parserrequiredRequired to parse Vue SFC and generate enhanced AST
@stylistic/eslint-pluginoptionalRequired for stylistic rules (e.g., indent, quotes) when using recommended configs
@typescript-eslint/parseroptionalOptional but required for TypeScript support in Vue SFC
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-vue — npm install eslint-plugin-vue · libregistry