The Wayback Machine - https://web.archive.org/web/20220319035234/https://github.com/vuejs/eslint-plugin-vue
Skip to content
master
Switch branches/tags
Code

Latest commit

* Add rule docs headings checker

* Fix typo in rule docs heading

* Standardize heading order in rule docs

* Add markdownlint

* Use `dash` style for all unordered lists

`ul-style` MarkdownLint rule

* Standardize unordered list indentation

`ul-indent` MarkdownLint rule

* Remove trailing spaces

`no-trailing-spaces` MarkdownLint rule

* Collapse consecutive empty lines

`no-multiple-blanks` MarkdownLint rule

* Add empty line after headings

`blanks-around-headings` MarkdownLint rule

* Add empty lines after code blocks

`blanks-around-fences` MarkdownLint rule

* Add empty lines before lists

`blanks-around-lists` MarkdownLint rule

* Add link title

`no-bare-urls` MarkdownLint rule

* Convert bold paragraph to heading

`no-emphasis-as-heading` MarkdownLint rule

* Fix trailing space in inline code

`no-space-in-code` MarkdownLint rule

* Add language to code blocks

`fenced-code-language` MarkdownLint rule

* Disable `no-inline-html` MarkdownLint rule in one place

* Fix wrong link syntax
0924d62

Git stats

Files

Permalink
Failed to load latest commit information.

eslint-plugin-vue

NPM version NPM downloads CircleCI License

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).