Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork680
Official ESLint plugin for Vue.js
License
vuejs/eslint-plugin-vue
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Official ESLint plugin for Vue.js
Please refer to theofficial website.
This plugin followsSemantic Versioning andESLint's Semantic Versioning Policy.
This project usesGitHub Releases.
Contributing is welcome! See theESLint Vue Plugin Developer Guide.
Be sure to read theofficial ESLint guide before you start writing a new rule.
To see what an abstract syntax tree (AST) of your code looks like, you may useAST Explorer. After openingAST Explorer, selectVue
as the syntax andvue-eslint-parser
as the parser.
The default JavaScript parser must be replaced becauseVue.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 theESTree project page and thevue-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 anexample rule to see usage of these services.
Be aware that depending on the code samples you write in tests, theRuleTester
parser property must be set accordingly (this can be done on a test by test basis). See anexample 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 inissues – we're happy to help!
See theLICENSE file for license rights and limitations (MIT).
About
Official ESLint plugin for Vue.js
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.