You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-9
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,9 @@ The ESLint custom parser for `.vue` files.
10
10
11
11
## ⤴️ Motivation
12
12
13
-
-**This parser allows us to lint the `<template>` of `.vue` files.**
13
+
-**This parser allows us to lint the `<template>` of `.vue` files.**
14
14
We can make mistakes easily on `<template>` if we use complex directives and expressions in the template. This parser and the rules of [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) would catch some of the mistakes.
15
-
-**This parser allows us to fix our mistakes automatically.**
15
+
-**This parser allows us to fix our mistakes automatically.**
16
16
ESLint supports autofix on custom parsers but does not support autofix on plugins which have processors ([eslint/eslint#7510](https://github.com/eslint/eslint/issues/7510)). This parser supports autofix on `.vue` files.
17
17
18
18
## 💿 Installation
@@ -43,7 +43,7 @@ $ eslint src --ext .vue
43
43
44
44
## 🔧 Options
45
45
46
-
`parserOptions` has the same properties as what [espree](https://github.com/eslint/espree#usage), the default parser of ESLint, is supporting.
46
+
`parserOptions` has the same properties as what [espree](https://github.com/eslint/espree#usage), the default parser of ESLint, is supporting.
47
47
For example:
48
48
49
49
```json
@@ -63,7 +63,7 @@ For example:
63
63
```
64
64
65
65
Also, you can use `parser` property to specify a custom parser to parse `<script>` tags.
66
-
Other properties than parser would be given to the specified parser.
66
+
Other properties than parser would be given to the specified parser.
67
67
For example:
68
68
69
69
```json
@@ -91,11 +91,11 @@ For example:
91
91
92
92
## 🎇 Usage for custom rules / plugins
93
93
94
-
This parser provides `parserServices` to traverse `<template>`.
95
-
96
-
The spec of `<template>` AST is [here](./docs/ast.md).
97
-
98
-
TODO: write examples.
94
+
-This parser provides `parserServices` to traverse `<template>`.
95
+
-`defineTemplateBodyVisitor(templateVisitor, scriptVisitor)` ... returns ESLint visitor to traverse `<template>`.
96
+
-`getTemplateBodyTokenStore()` ... returns ESLint `TokenStore` to get the tokens of `<template>`.
97
+
-[ast.md](./docs/ast.md) is `<template>` AST specification.
98
+
-[mustache-interpolation-spacing.js](https://github.com/vuejs/eslint-plugin-vue/blob/b434ff99d37f35570fa351681e43ba2cf5746db3/lib/rules/mustache-interpolation-spacing.js) is an example.
0 commit comments