eslint-plugin-vue

vuejsMIT活跃维护

Vue.js 官方 ESLint 插件,用来检查 .vue 单文件组件和模板语法,帮你提前发现代码错误和风格问题。

Official ESLint plugin for Vue.js

v10.12.0发布于 2026-10-26 13:42 UTC4,588star734fork同步于 2026-11-10 23:38 UTC

怎么上手

由 README 提炼,执行前请确认
npm install --save-dev eslint eslint-plugin-vue
硬件要求按 README 说明

README 未说明,纯 Node.js 工具,无 GPU 或显存要求

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Vue.js 官方 ESLint 插件,为 .vue 单文件组件提供模板与脚本的静态检查规则

Vue.js 官方 ESLint 插件,用来检查 .vue 单文件组件和模板语法,帮你提前发现代码错误和风格问题。

核心能力

  • 提供 Vue 模板与 <script> 的官方 lint 规则集
  • 内置多套可共享配置,按 Vue 版本选用
  • 借助 vue-eslint-parser 解析 SFC 生成增强 AST
  • 支持 defineTemplateBodyVisitor 遍历模板节点

容易踩的坑

版本策略不遵循 ESLint 语义化版本,minor 升级可能报出更多错误,建议用 ~ 锁定版本;解析 .vue 文件需依赖 vue-eslint-parser,默认 JS 解析器不适用;具体配置与规则文档在官网 eslint.vuejs.org,README 未展开

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v10.12.0
  1. v10.12.0最新正式版2026-10-26 · 2026-10-26 13:42 UTC

    New rules

    New rule options

    Fixed false negatives (may result in more lint issues)

    Fixed false positives (may result in fewer lint issues)

  2. v10.11.12026-09-24 · 2026-09-24 01:08 UTC
    查看更新说明

    Patch Changes

  3. v10.11.02026-09-06 · 2026-09-06 09:58 UTC
    查看更新说明

    Minor Changes

    Patch Changes

    • Fixed vue/use-v-on-exact to avoid reporting @keydown.stop when paired with an exact key-specific listener (#3082)
    • Specified explicit items policies for array rule option schemas (#3112)
    • Updated resources (HTML elements) (#3132 and #3133)
  4. v10.10.02026-07-20 · 2026-07-20 10:46 UTC
    查看更新说明

    Minor Changes

    Patch Changes

    • Updated @eslint-community/eslint-utils, semver and xml-name-validator dependencies (#3094)
  5. v10.9.22026-06-03 · 2026-06-03 09:04 UTC
    查看更新说明

    Patch Changes

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    eslint-plugin-vue

    NPM version NPM downloads CI License

    Official ESLint plugin for Vue.js

    :book: Documentation

    Please refer to the official website.

    :anchor: Versioning Policy

    This plugin follows Semantic Versioning. However, please note that we do not follow ESLint's Semantic Versioning Policy. In minor version releases, this plugin may change the sharable configs provided by the plugin or the default behavior of the plugin's rules in order to add features to the plugin. Because we want to add many features to the plugin soon, so that users can easily take advantage of new features in Vue and Nuxt.

    According to our policy, any minor update may report more linting errors than the previous release. As such, we recommend using the tilde (~) in package.json to guarantee the results of your builds.

    :newspaper: Releases

    This project uses GitHub Releases.

    :beers: Contribution Guide

    Contributing is welcome! See the ESLint Vue Plugin Developer Guide.

    Working With Rules

    Be sure to read the official ESLint guide before you start writing a new rule.

    To see what an abstract syntax tree (AST) of your code looks like, you may use AST Explorer. After opening AST Explorer, select Vue as the syntax and vue-eslint-parser as the parser.

    The default JavaScript parser must be replaced because Vue.js single file components are not plain JavaScript, but a custom file format. vue-eslint-parser is a replacement parser that generates an enhanced AST with nodes that represent specific parts of the template syntax, as well as the contents of the <script> tag.

    To learn more about certain nodes in a produced AST, see the ESTree project page and the vue-eslint-parser AST documentation.

    vue-eslint-parser provides a few useful parser services to help traverse the produced AST and access template tokens:

    • context.parserServices.defineTemplateBodyVisitor(visitor, scriptVisitor)
    • context.parserServices.getTemplateBodyTokenStore()

    Check out an example rule to see usage of these services.

    Be aware that depending on the code samples you write in tests, the RuleTester parser property must be set accordingly (this can be done on a test by test basis). See an example here.

    If you're stuck, remember there are many rules available for reference. If you can't find the right solution, don't hesitate to reach out in issues – we're happy to help!

    :lock: License

    See the LICENSE file for license rights and limitations (MIT).