Skip to content

Commit acfde8f

Browse files
committed
chore: introduce @eslint/markdown and eslint-plugin-markdown-preferences
1 parent a198b52 commit acfde8f

32 files changed

+306
-69
lines changed

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"editor.tabSize": 2,
3-
"eslint.experimental.useFlatConfig": true,
4-
"eslint.validate": ["javascript", "javascriptreact", "vue", "json", "jsonc"],
3+
"eslint.validate": ["javascript", "javascriptreact", "vue", "json", "jsonc", "markdown"],
54
"typescript.tsdk": "./node_modules/typescript/lib",
65
"vetur.validation.script": false,
76
"[typescript]": {

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
### Patch Changes
1414

15-
- Resolved TypeScript compatibility issues introduced by eslint-typegen ([#2790](https://github.com/vuejs/eslint-plugin-vue/pull/2790))
15+
- Resolved TypeScript compatibility issues introduced by [eslint-typegen](https://github.com/antfu/eslint-typegen) ([#2790](https://github.com/vuejs/eslint-plugin-vue/pull/2790))
1616

1717
- Fixed inconsistent quotes in [`vue/block-lang`](https://eslint.vuejs.org/rules/block-lang.html) error messages ([#2805](https://github.com/vuejs/eslint-plugin-vue/pull/2805))
1818

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ Contributing is welcome! See the [ESLint Vue Plugin Developer Guide](https://esl
3434

3535
Be sure to read the [official ESLint guide](https://eslint.org/docs/developer-guide/working-with-rules) before you start writing a new rule.
3636

37-
To see what an abstract 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.
37+
To see what an abstract 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`](https://github.com/vuejs/vue-eslint-parser) as the parser.
3838

3939
The default JavaScript parser must be replaced because [Vue.js single file components](https://vuejs.org/guide/scaling-up/sfc.html) are not plain JavaScript, but a custom file format. [`vue-eslint-parser`](https://github.com/vuejs/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.
4040

4141
To learn more about certain nodes in a produced AST, 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).
4242

43-
`vue-eslint-parser` provides a few useful parser services to help traverse the produced AST and access template tokens:
43+
[`vue-eslint-parser`](https://github.com/vuejs/vue-eslint-parser) provides a few useful parser services to help traverse the produced AST and access template tokens:
4444

4545
- `context.parserServices.defineTemplateBodyVisitor(visitor, scriptVisitor)`
4646
- `context.parserServices.getTemplateBodyTokenStore()`

docs/developer-guide/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ Before you start writing new rule, please read the [official ESLint guide](https
3939
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].
4040
The [astexplorer.net] is a great tool to inspect ASTs, also Vue templates are supported.
4141

42-
After opening [astexplorer.net], select `Vue` as the syntax and `vue-eslint-parser` as the parser.
42+
After opening [astexplorer.net], select `Vue` as the syntax and [`vue-eslint-parser`](https://github.com/vuejs/vue-eslint-parser) as the parser.
4343

4444
[astexplorer.net]: https://astexplorer.net/
4545

46-
Since single file components in Vue are not plain JavaScript, we can't use the default parser, and we had to introduce additional one: `vue-eslint-parser`, that generates enhanced AST with nodes that represent specific parts of the template syntax, as well as what's inside the `<script>` tag.
46+
Since single file components in Vue are not plain JavaScript, we can't use the default parser, and we had to introduce additional one: [`vue-eslint-parser`](https://github.com/vuejs/vue-eslint-parser), that generates enhanced AST with nodes that represent specific parts of the template syntax, as well as what's inside the `<script>` tag.
4747

4848
To know more about certain nodes in produced ASTs, go here:
4949

5050
- [ESTree docs](https://github.com/estree/estree)
5151
- [vue-eslint-parser AST docs](https://github.com/vuejs/vue-eslint-parser/blob/master/docs/ast.md)
5252

53-
The `vue-eslint-parser` provides few useful parser services, to help traverse the produced AST and access tokens of the template:
53+
The [`vue-eslint-parser`](https://github.com/vuejs/vue-eslint-parser) provides few useful parser services, to help traverse the produced AST and access tokens of the template:
5454

5555
- `context.parserServices.defineTemplateBodyVisitor(visitor, scriptVisitor)`
5656
- `context.parserServices.getTemplateBodyTokenStore()`
@@ -63,7 +63,7 @@ If you'll stuck, remember there are plenty of rules you can learn from already,
6363

6464
## :white_check_mark: JSDoc type checking with TypeScript
6565

66-
We have type checking enabled via TypeScript and JSDoc.
66+
We have type checking enabled via TypeScript and JSDoc.\
6767
The command to perform type checking is: `npm run tsc`
6868

6969
This is just to help you write the rules, not to do strict type checking. If you find it difficult to resolve type checking warnings, feel free to suppress warnings using the `// @ts-nocheck` and `// @ts-ignore` comment.

docs/rules/block-lang.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ This rule disallows the use of languages other than those available in the your
4848

4949
</eslint-code-block>
5050

51-
Specify the block name for the key of the option object.
51+
Specify the block name for the key of the option object.\
5252
You can use the object as a value and use the following properties:
5353

5454
- `lang` ... Specifies the available value for the `lang` attribute of the block. If multiple languages are available, specify them as an array. If you do not specify it, will disallow any language.
5555
- `allowNoLang` ... If `true`, allows the `lang` attribute not to be specified (allows the use of the default language of block).
5656

5757
::: warning Note
58-
If the default language is specified for `lang` option of `<template>`, `<style>` and `<script>`, it will be enforced to not specify `lang` attribute.
58+
If the default language is specified for `lang` option of `<template>`, `<style>` and `<script>`, it will be enforced to not specify `lang` attribute.\
5959
This is to prevent unintended problems with [Vetur](https://vuejs.github.io/vetur/).
6060

6161
See also [Vetur - Syntax Highlighting](https://vuejs.github.io/vetur/guide/highlighting.html).

docs/rules/component-api-style.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ since: v7.18.0
1414

1515
This rule aims to make the API style you use to define Vue components consistent in your project.
1616

17-
For example, if you want to allow only `<script setup>` and Composition API.
17+
For example, if you want to allow only `<script setup>` and Composition API.\
1818
(This is the default for this rule.)
1919

2020
<eslint-code-block :rules="{'vue/component-api-style': ['error']}">

docs/rules/html-indent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ This rule enforces a consistent indentation style in `<template>`. The default s
7979
- `type` (`number | "tab"`) ... The type of indentation. Default is `2`. If this is a number, it's the number of spaces for one indent. If this is `"tab"`, it uses one tab for one indent.
8080
- `attribute` (`integer`) ... The multiplier of indentation for attributes. Default is `1`.
8181
- `baseIndent` (`integer`) ... The multiplier of indentation for top-level statements. Default is `1`.
82-
- `closeBracket` (`integer | object`) ... The multiplier of indentation for right brackets. Default is `0`.
82+
- `closeBracket` (`integer | object`) ... The multiplier of indentation for right brackets. Default is `0`.\
8383
You can apply all of the following by setting a number value.
8484
- `closeBracket.startTag` (`integer`) ... The multiplier of indentation for right brackets of start tags (`<div>`). Default is `0`.
8585
- `closeBracket.endTag` (`integer`) ... The multiplier of indentation for right brackets of end tags (`</div>`). Default is `0`.

docs/rules/multiline-html-element-content-newline.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ This rule enforces a line break before and after the contents of a multiline ele
9191
default `true`
9292
- `ignores` ... the configuration for element names to ignore line breaks style.
9393
default `["pre", "textarea", ...INLINE_ELEMENTS]`.
94-
- `allowEmptyLines` ... if `true`, it allows empty lines around content. If you want to disallow multiple empty lines, use [no-multiple-empty-lines] in combination.
94+
- `allowEmptyLines` ... if `true`, it allows empty lines around content. If you want to disallow multiple empty lines, use [no-multiple-empty-lines] in combination.\
9595
default `false`
9696

9797
::: info
@@ -146,7 +146,9 @@ This rule enforces a line break before and after the contents of a multiline ele
146146
## :couple: Related Rules
147147

148148
- [vue/singleline-html-element-content-newline](./singleline-html-element-content-newline.md)
149-
- [no-multiple-empty-lines](https://eslint.org/docs/rules/no-multiple-empty-lines)
149+
- [no-multiple-empty-lines]
150+
151+
[no-multiple-empty-lines]: https://eslint.org/docs/rules/no-multiple-empty-lines
150152

151153
## :rocket: Version
152154

docs/rules/no-async-in-computed-properties.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ Nothing.
112112

113113
## :books: Further Reading
114114

115-
- [vue-async-computed](https://github.com/foxbenjaminfox/vue-async-computed)
115+
- [vue-async-computed]
116+
117+
[vue-async-computed]: https://github.com/foxbenjaminfox/vue-async-computed
116118

117119
## :rocket: Version
118120

docs/rules/no-computed-properties-in-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ since: v7.20.0
1414

1515
## :book: Rule Details
1616

17-
This rule disallow accessing computed properties in `data()`.
17+
This rule disallow accessing computed properties in `data()`.\
1818
The computed property cannot be accessed in `data()` because is before initialization.
1919

2020
<eslint-code-block :rules="{'vue/no-computed-properties-in-data': ['error']}">

0 commit comments

Comments
 (0)