Skip to content

waynzh/eslint-plugin-vue

This branch is 12 commits ahead of, 69 commits behind vuejs/eslint-plugin-vue:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Nov 20, 2024
c938035 Β· Nov 20, 2024
Nov 29, 2023
Apr 8, 2024
Feb 19, 2024
Nov 20, 2024
Dec 27, 2023
Nov 20, 2024
Nov 20, 2024
Jul 13, 2024
Oct 11, 2024
Oct 15, 2017
Dec 27, 2020
Jun 2, 2017
Jan 13, 2023
Feb 19, 2024
Mar 19, 2022
Aug 4, 2017
Feb 19, 2024
May 25, 2020
Jun 2, 2017
Feb 16, 2022
Oct 25, 2024
Nov 11, 2024
Feb 19, 2024

Repository files navigation

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

About

Official ESLint plugin for Vue.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.5%
  • TypeScript 1.5%