File tree 2 files changed +16
-18
lines changed
2 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -8,46 +8,44 @@ This rule reports `slot-scope` attributes in the following cases:
8
8
9
9
- The ` slot-scope ` attribute does not have that attribute value. E.g. ` <div slot-scope></div> `
10
10
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']} " >
15
12
``` vue
16
13
<template>
14
+ <!-- ✓ GOOD -->
17
15
<TheComponent>
18
- <template slot-scope>
16
+ <template slot-scope="prop" >
19
17
...
20
18
</template>
21
19
</TheComponent>
22
20
<TheComponent>
23
- <template slot-scope="">
21
+ <template slot-scope="{ a, b, c } ">
24
22
...
25
23
</template>
26
24
</TheComponent>
27
- </template>
28
- ```
29
-
30
- :+1 : Examples of ** correct** code for this rule:
31
-
32
- ``` vue
33
- <template>
34
25
<TheComponent>
35
- <template slot-scope="prop ">
26
+ <template slot-scope="[ a, b, c ] ">
36
27
...
37
28
</template>
38
29
</TheComponent>
30
+
31
+ <!-- ✗ BAD -->
39
32
<TheComponent>
40
- <template slot-scope="{ a, b, c }" >
33
+ <template slot-scope>
41
34
...
42
35
</template>
43
36
</TheComponent>
44
37
<TheComponent>
45
- <template slot-scope="[ a, b, c ] ">
38
+ <template slot-scope="">
46
39
...
47
40
</template>
48
41
</TheComponent>
49
42
</template>
50
43
```
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
+ :::
51
49
52
50
## :wrench : Options
53
51
@@ -57,7 +55,7 @@ Nothing.
57
55
58
56
- [ no-parsing-error]
59
57
60
- ## Related links
58
+ ## : books : Further reading
61
59
62
60
- [ Guide - Scoped Slots] ( https://vuejs.org/v2/guide/components-slots.html#Scoped-Slots )
63
61
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ module.exports = {
58
58
docs : {
59
59
description : 'enforce valid `slot-scope` attributes' ,
60
60
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'
62
62
} ,
63
63
fixable : null ,
64
64
schema : [ ] ,
You can’t perform that action at this time.
0 commit comments