{"id":19978,"library":"eslint-plugin-vue","title":"eslint-plugin-vue","description":"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+).","status":"active","version":"10.9.0","language":"javascript","source_language":"en","source_url":"https://github.com/vuejs/eslint-plugin-vue","tags":["javascript","eslint","eslint-plugin","eslint-config","vue","vuejs","rules","typescript"],"install":[{"cmd":"npm install eslint-plugin-vue","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-vue","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-vue","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required to parse Vue SFC and generate enhanced AST","package":"vue-eslint-parser","optional":false},{"reason":"Required for stylistic rules (e.g., indent, quotes) when using recommended configs","package":"@stylistic/eslint-plugin","optional":true},{"reason":"Optional but required for TypeScript support in Vue SFC","package":"@typescript-eslint/parser","optional":true}],"imports":[{"note":"Flat config (ESLint >=9) uses plugin's configs['flat/...'] object; legacy eslintrc uses string extends. Since v10, flat config is preferred.","wrong":"module.exports = { extends: ['plugin:vue/vue3-recommended'] }","symbol":"flat config","correct":"import pluginVue from 'eslint-plugin-vue'\nexport default [pluginVue.configs['flat/recommended']]"},{"note":"CommonJS require returns the plugin object directly, without .default. TypeScript users can import * as pluginVue from 'eslint-plugin-vue'.","wrong":"const eslintPluginVue = require('eslint-plugin-vue').default","symbol":"plugin","correct":"const { rules } = require('eslint-plugin-vue')"},{"note":"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.","wrong":"const parser = require('vue-eslint-parser').default","symbol":"vue-eslint-parser","correct":"import parser from 'vue-eslint-parser'\nexport default [{ ... }, { languageOptions: { parser } }]"}],"quickstart":{"code":"// eslint.config.js (flat config, ESLint 9+)\nimport pluginVue from 'eslint-plugin-vue'\nimport parser from 'vue-eslint-parser'\n\nexport default [\n  pluginVue.configs['flat/recommended'],\n  {\n    rules: {\n      'vue/multi-word-component-names': 'warn',\n    },\n    languageOptions: {\n      parser,\n    },\n  },\n]","lang":"typescript","description":"Flat ESLint configuration using eslint-plugin-vue's recommended rules and vue-eslint-parser for a Vue 3 project."},"warnings":[{"fix":"Upgrade eslint-plugin-vue to >=10.8.0 and vue-eslint-parser to >=10.3.0.","message":"ESLint 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'.","severity":"breaking","affected_versions":"<10.8.0"},{"fix":"Use flat config syntax: import pluginVue from 'eslint-plugin-vue'; export default [pluginVue.configs['flat/recommended']];","message":"Flat config (ESLint 9+) replaces the legacy extends format. Configs are now accessed via pluginVue.configs['flat/recommended'] instead of 'plugin:vue/vue3-recommended'.","severity":"breaking","affected_versions":">=9.0.0"},{"fix":"Use import or dynamic import; if using CommonJS, use require('vue-eslint-parser') (no .default).","message":"vue-eslint-parser v10 drops CommonJS support; require() may fail if not handled correctly.","severity":"breaking","affected_versions":">=10.0.0"},{"fix":"Switch to flat config format (ESLint 9+).","message":"Legacy eslintrc configuration (extends: 'plugin:vue/recommended') is deprecated in favor of flat config. The plugin will remove legacy support in a future major version.","severity":"deprecated","affected_versions":">=10.0.0"},{"fix":"Use tilde range (e.g., ^9.0.0) in package.json to limit minor updates, or pin exact version.","message":"Minor releases may introduce new rules that cause additional lint errors. The plugin does not follow ESLint's semantic versioning policy for configs.","severity":"gotcha","affected_versions":">=9.0.0"},{"fix":"Set parser: 'vue-eslint-parser' globally and use parserOptions.parser: '@typescript-eslint/parser'.","message":"When 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.","severity":"gotcha","affected_versions":">=7.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install --save-dev eslint-plugin-vue (and required peer deps vue-eslint-parser, etc.).","cause":"The plugin is not installed or not in the project's node_modules.","error":"Error: Failed to load plugin 'vue' declared in 'plugins': Cannot find module 'eslint-plugin-vue'"},{"fix":"Install vue-eslint-parser and import it: import parser from 'vue-eslint-parser'; then set languageOptions: { parser }.","cause":"vue-eslint-parser is missing or using wrong parser path in flat config.","error":"Error: Failed to load parser 'vue-eslint-parser' declared in 'languageOptions.parser'"},{"fix":"Rename file to .mjs or add 'type': 'module' to package.json, or use require() syntax.","cause":"Using ESM import syntax in a CommonJS config file (e.g., .js file with no type: module).","error":"Parsing error: The keyword 'import' is reserved"},{"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.","cause":"Using pluginVue.configs['flat/recommended'] in an array without spreading the config object correctly.","error":"TypeError: pluginVue.configs is not iterable"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}