|
9 | 9 |
|
10 | 10 | ## :book: Documentation
|
11 | 11 |
|
12 |
| -See [the official website](https://eslint.vuejs.org). |
| 12 | +Please refer to [official website](https://eslint.vuejs.org). |
13 | 13 |
|
14 | 14 | ## :anchor: Versioning Policy
|
15 | 15 |
|
16 |
| -This plugin is following [Semantic Versioning](https://semver.org/) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy). |
| 16 | +This plugin follows [Semantic Versioning](https://semver.org) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy). |
17 | 17 |
|
18 |
| -## :newspaper: Changelog |
| 18 | +## :newspaper: Releases |
19 | 19 |
|
20 | 20 | This project uses [GitHub Releases](https://github.com/vuejs/eslint-plugin-vue/releases).
|
21 | 21 |
|
22 | 22 | ## :beers: Contribution Guide
|
23 | 23 |
|
24 |
| -Contribution is welcome! |
| 24 | +Contributing is welcome! See the [ESLint Vue Plugin Developer Guide](https://eslint.vuejs.org/developer-guide). |
25 | 25 |
|
26 |
| -See [The ESLint Vue Plugin Developer Guide](https://eslint.vuejs.org/developer-guide/). |
| 26 | +### Working With Rules |
27 | 27 |
|
28 |
| -### Working with Rules |
| 28 | +Be sure to read the [official ESLint guide](https://eslint.org/docs/developer-guide/working-with-rules) before you start writing a new rule. |
29 | 29 |
|
30 |
| -Before you start writing a new rule, please read [the official ESLint guide](https://eslint.org/docs/developer-guide/working-with-rules). |
| 30 | +To see what an abtract syntax tree (AST) of your code looks like, you may use [AST Explorer](https://astexplorer.net). After opening [AST Explorer](https://astexplorer.net), select `Vue` as the syntax and `vue-eslint-parser` as the parser. |
31 | 31 |
|
32 |
| -Next, in order to get an idea how does the AST of the code that you want to check looks like, use the [astexplorer.net]. |
33 |
| -The [astexplorer.net] is a great tool to inspect ASTs, also Vue templates are supported. |
| 32 | +The default parser must be replaced since Vue's single file components are not plain JavaScript. `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. |
34 | 33 |
|
35 |
| -After opening [astexplorer.net], select `Vue` as the syntax and `vue-eslint-parser` as the parser. |
| 34 | +To learn more about certain nodes in the produced ASTs, see the [ESTree project page](https://github.com/estree/estree) and the [vue-eslint-parser AST documentation](https://github.com/vuejs/vue-eslint-parser/blob/master/docs/ast.md). |
36 | 35 |
|
37 |
| -[astexplorer.net]: https://astexplorer.net/ |
| 36 | +The `vue-eslint-parser` provides a few useful parser services to help traverse the produced AST and access template tokens: |
38 | 37 |
|
39 |
| -Since single file components in Vue are not plain JavaScript, the default parser couldn't be used, so a new one was introduced. `vue-eslint-parser` generates enhanced AST with nodes that represent specific parts of the template syntax, as well as what's inside the `<script>` tag. |
40 |
| - |
41 |
| -To know more about certain nodes in produced ASTs, go here: |
42 |
| -- [ESTree docs](https://github.com/estree/estree) |
43 |
| -- [vue-eslint-parser AST docs](https://github.com/vuejs/vue-eslint-parser/blob/master/docs/ast.md) |
44 |
| - |
45 |
| -The `vue-eslint-parser` provides a few useful parser services that help traverse the produced AST and access tokens of the template: |
46 | 38 | - `context.parserServices.defineTemplateBodyVisitor(visitor, scriptVisitor)`
|
47 | 39 | - `context.parserServices.getTemplateBodyTokenStore()`
|
48 | 40 |
|
49 |
| -Check out [an example rule](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/mustache-interpolation-spacing.js) to get a better understanding of how these work. |
| 41 | +Check out an [example rule](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/mustache-interpolation-spacing.js) to see usage of these services. |
50 | 42 |
|
51 |
| -Please be aware that regarding what kind of code examples you'll write in tests, you'll have to accordingly set up the parser in `RuleTester` (you can do it on a per test case basis). See an example [here](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/attribute-hyphenation.js#L19). |
| 43 | +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](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/attribute-hyphenation.js#L19). |
52 | 44 |
|
53 |
| -If you'll stuck, remember there are plenty of rules you can learn from already. If you can't find the right solution, don't hesitate to reach out in [issues](https://github.com/vuejs/eslint-plugin-vue/issues) – we're happy to help! |
| 45 | +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](https://github.com/vuejs/eslint-plugin-vue/issues) – we're happy to help! |
54 | 46 |
|
55 | 47 | ## :lock: License
|
56 | 48 |
|
57 |
| -See the [LICENSE](LICENSE) file for license rights and limitations (MIT). |
| 49 | +See the [LICENSE](LICENSE) file for license rights and limitations (MIT). |
0 commit comments