Skip to content

Commit df5359a

Browse files
committed
update document
1 parent 656fdb5 commit df5359a

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

Diff for: docs/rules/valid-slot-scope.md

+15-17
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,44 @@ This rule reports `slot-scope` attributes in the following cases:
88

99
- The `slot-scope` attribute does not have that attribute value. E.g. `<div slot-scope></div>`
1010

11-
This rule does not check syntax errors in directives because it's checked by [no-parsing-error] rule.
12-
13-
:-1: Examples of **incorrect** code for this rule:
14-
11+
<eslint-code-block fix :rules="{'vue/valid-slot-scope': ['error']}">
1512
```vue
1613
<template>
14+
<!-- ✓ GOOD -->
1715
<TheComponent>
18-
<template slot-scope>
16+
<template slot-scope="prop">
1917
...
2018
</template>
2119
</TheComponent>
2220
<TheComponent>
23-
<template slot-scope="">
21+
<template slot-scope="{ a, b, c }">
2422
...
2523
</template>
2624
</TheComponent>
27-
</template>
28-
```
29-
30-
:+1: Examples of **correct** code for this rule:
31-
32-
```vue
33-
<template>
3425
<TheComponent>
35-
<template slot-scope="prop">
26+
<template slot-scope="[ a, b, c ]">
3627
...
3728
</template>
3829
</TheComponent>
30+
31+
<!-- ✗ BAD -->
3932
<TheComponent>
40-
<template slot-scope="{ a, b, c }">
33+
<template slot-scope>
4134
...
4235
</template>
4336
</TheComponent>
4437
<TheComponent>
45-
<template slot-scope="[ a, b, c ]">
38+
<template slot-scope="">
4639
...
4740
</template>
4841
</TheComponent>
4942
</template>
5043
```
44+
</eslint-code-block>
45+
46+
::: warning Note
47+
This rule does not check syntax errors in directives because it's checked by [no-parsing-error] rule.
48+
:::
5149

5250
## :wrench: Options
5351

@@ -57,7 +55,7 @@ Nothing.
5755

5856
- [no-parsing-error]
5957

60-
## Related links
58+
## :books: Further reading
6159

6260
- [Guide - Scoped Slots](https://vuejs.org/v2/guide/components-slots.html#Scoped-Slots)
6361

Diff for: lib/rules/valid-slot-scope.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = {
5858
docs: {
5959
description: 'enforce valid `slot-scope` attributes',
6060
category: undefined,
61-
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.5/docs/rules/valid-slot-scope.md'
61+
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0/docs/rules/valid-slot-scope.md'
6262
},
6363
fixable: null,
6464
schema: [],

0 commit comments

Comments
 (0)