

GitHub - vuejs/eslint-plugin-vue: Official ESLint plugin for Vue.js
source link: https://github.com/vuejs/eslint-plugin-vue
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

eslint-plugin-vue
Official ESLint plugin for Vue.js
Documentation
Please refer to the official website.
Versioning Policy
This plugin follows Semantic Versioning and ESLint's Semantic Versioning Policy.
Releases
This project uses GitHub Releases.
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!
License
See the LICENSE file for license rights and limitations (MIT).
Recommend
-
141
Contribute to vue-docs-zh-cn development by creating an account on GitHub.
-
56
README.md vue-router
-
33
README.md Vue Composition API Vue Composition API @v...
-
43
README.md vue-next
-
24
README.md vuejs.org This site is built with hexo. Site content is written in Markdown format located in s...
-
12
中文文档 eslint-plugin-clean-timer Enforce best practice with setTimeout and setInterval Motivati...
-
12
eslint-plugin-import This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names. All the goodness that the ES2015+ static module syntax intends to...
-
14
eslint-plugin-import This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names. All the goodness that the ES2015+ static module syntax intends to...
-
9
eslint-plugin-anti-trojan-source ESLint plugin to detect and prevent Trojan Source attacks from entering your codebase About ESLint plugin to detect and stop Trojan Source attacks from entering your codebase.
-
16
eslint-plugin-no-pipe An ESLint plugin to disable the use of the pipe operator. Rule Details Examples of incorrect code for this rule: "Hell...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK