Skip to content

Commit ba6ae96

Browse files
authored
Fixed the usage of '✗ BAD' and '✓ GOOD' in the documentation (#1202)
1 parent 376048e commit ba6ae96

7 files changed

+36
-37
lines changed

docs/rules/attribute-hyphenation.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ This rule enforces using hyphenated attribute names on custom components in Vue
1818

1919
```vue
2020
<template>
21-
<!-- GOOD -->
21+
<!-- GOOD -->
2222
<MyComponent my-prop="prop" />
2323
24-
<!-- BAD -->
24+
<!-- BAD -->
2525
<MyComponent myProp="prop" />
2626
</template>
2727
```
@@ -51,10 +51,10 @@ It errors on upper case letters.
5151

5252
```vue
5353
<template>
54-
<!-- GOOD -->
54+
<!-- GOOD -->
5555
<MyComponent my-prop="prop" />
5656
57-
<!-- BAD -->
57+
<!-- BAD -->
5858
<MyComponent myProp="prop" />
5959
</template>
6060
```
@@ -68,34 +68,34 @@ It errors on hyphens except `data-`, `aria-` and `slot-scope`.
6868

6969
```vue
7070
<template>
71-
<!-- GOOD -->
71+
<!-- GOOD -->
7272
<MyComponent myProp="prop" />
7373
<MyComponent data-id="prop" />
7474
<MyComponent aria-role="button" />
7575
<MyComponent slot-scope="prop" />
7676
77-
<!-- BAD -->
77+
<!-- BAD -->
7878
<MyComponent my-prop="prop" />
7979
</template>
8080
```
8181

8282
</eslint-code-block>
8383

84-
### `"never", { "ignore": ["custom-prop"] }`
84+
### `"never", { "ignore": ["custom-prop"] }`
8585
Don't use hyphenated name but allow custom attributes
8686

8787
<eslint-code-block fix :rules="{'vue/attribute-hyphenation': ['error', 'never', { ignore: ['custom-prop']}]}">
8888

8989
```vue
9090
<template>
91-
<!-- GOOD -->
91+
<!-- GOOD -->
9292
<MyComponent myProp="prop" />
9393
<MyComponent custom-prop="prop" />
9494
<MyComponent data-id="prop" />
9595
<MyComponent aria-role="button" />
9696
<MyComponent slot-scope="prop" />
9797
98-
<!-- BAD -->
98+
<!-- BAD -->
9999
<MyComponent my-prop="prop" />
100100
</template>
101101
```

docs/rules/custom-event-name-casing.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ See [Guide - Custom Events] for more details.
2323

2424
```vue
2525
<template>
26-
<!-- GOOD -->
26+
<!-- GOOD -->
2727
<button @click="$emit('my-event')" />
2828
29-
<!-- BAD -->
29+
<!-- BAD -->
3030
<button @click="$emit('myEvent')" />
3131
</template>
3232
<script>
3333
export default {
3434
methods: {
3535
onClick () {
36-
/* GOOD */
36+
/* GOOD */
3737
this.$emit('my-event')
3838
this.$emit('update:myProp', myProp)
3939
40-
/* BAD */
40+
/* BAD */
4141
this.$emit('myEvent')
4242
}
4343
}

docs/rules/no-potential-component-option-typo.md

+12-13
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ This rule disallow a potential typo in your component options
1818
"vue/no-potential-component-option-typo": ["error", {
1919
"presets": ["all"],
2020
"custom": ["test"]
21-
}
22-
]
21+
}]
2322
}
2423
```
2524

@@ -30,21 +29,21 @@ This rule disallow a potential typo in your component options
3029
export default {
3130
/* ✓ GOOD */
3231
props: {
33-
32+
3433
},
35-
/* × BAD */
34+
/* BAD */
3635
method: {
3736
3837
},
3938
/* ✓ GOOD */
4039
data: {
41-
40+
4241
},
43-
/* × BAD */
42+
/* BAD */
4443
beforeRouteEnteR() {
4544
4645
},
47-
/* × BAD due to custom option 'test'*/
46+
/* BAD due to custom option 'test' */
4847
testt: {
4948
5049
}
@@ -72,19 +71,19 @@ export default {
7271
```vue
7372
<script>
7473
export default {
75-
/* ✓ BAD, due to threshold is 5 */
74+
/* ✓ GOOD, due to threshold is 5 */
7675
props: {
77-
76+
7877
},
79-
/* ✓ BAD, due to threshold is 5 */
78+
/* ✓ GOOD, due to threshold is 5 */
8079
method: {
8180
8281
},
83-
/* ✓ BAD, due to threshold is 5 */
82+
/* ✓ GOOD, due to threshold is 5 */
8483
data: {
85-
84+
8685
},
87-
/* × GOOD, due to we don't choose vue-router preset or add a custom option */
86+
/* ✗ BAD, due to we don't choose vue-router preset or add a custom option */
8887
beforeRouteEnteR() {
8988
9089
}

docs/rules/no-restricted-static-attribute.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This rule takes a list of strings, where each string is a attribute name or patt
2525

2626
```vue
2727
<template>
28-
<!-- BAD -->
28+
<!-- BAD -->
2929
<div foo="x" />
3030
<div bar />
3131
</template>
@@ -62,7 +62,7 @@ The following properties can be specified for the object.
6262
<!-- ✓ GOOD -->
6363
<div foo="foo" />
6464
65-
<!-- BAD -->
65+
<!-- BAD -->
6666
<div foo="bar" />
6767
</template>
6868
```
@@ -78,7 +78,7 @@ The following properties can be specified for the object.
7878
<!-- ✓ GOOD -->
7979
<CoolButton foo="x" />
8080
81-
<!-- BAD -->
81+
<!-- BAD -->
8282
<MyButton foo="x" />
8383
</template>
8484
```

docs/rules/no-restricted-syntax.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ Forbids call expressions inside mustache interpolation.
2525

2626
```vue
2727
<template>
28-
<!-- GOOD -->
28+
<!-- GOOD -->
2929
<div> {{ foo }} </div>
3030
<div> {{ foo.bar }} </div>
3131
32-
<!-- BAD -->
32+
<!-- BAD -->
3333
<div> {{ foo() }} </div>
3434
<div> {{ foo.bar() }} </div>
3535
<div> {{ foo().bar }} </div>

docs/rules/no-restricted-v-bind.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This rule takes a list of strings, where each string is a argument name or patte
2525

2626
```vue
2727
<template>
28-
<!-- BAD -->
28+
<!-- BAD -->
2929
<div v-bind:foo="x" />
3030
<div :bar="x" />
3131
</template>
@@ -39,7 +39,7 @@ By default, `'/^v-/'` is set. This prevents mistakes intended to be directives.
3939

4040
```vue
4141
<template>
42-
<!-- BAD -->
42+
<!-- BAD -->
4343
<MyInput :v-model="x" />
4444
<div :v-if="x" />
4545
</template>
@@ -84,7 +84,7 @@ The following properties can be specified for the object.
8484
<!-- ✓ GOOD -->
8585
<div :foo="x" />
8686
87-
<!-- BAD -->
87+
<!-- BAD -->
8888
<div :foo.prop="x" />
8989
</template>
9090
```
@@ -100,7 +100,7 @@ The following properties can be specified for the object.
100100
<!-- ✓ GOOD -->
101101
<CoolButton :foo="x" />
102102
103-
<!-- BAD -->
103+
<!-- BAD -->
104104
<MyButton :foo="x" />
105105
</template>
106106
```

docs/rules/no-unused-properties.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ This rule cannot be checked for use in other components (e.g. `mixins`, Property
8989
<eslint-code-block :rules="{'vue/no-unused-properties': ['error', {groups: ['props', 'data']}]}">
9090

9191
```vue
92-
<!-- BAD (`count` data not used) -->
92+
<!-- BAD (`count` data not used) -->
9393
<script>
9494
export default {
9595
data() {
@@ -136,7 +136,7 @@ This rule cannot be checked for use in other components (e.g. `mixins`, Property
136136
<eslint-code-block :rules="{'vue/no-unused-properties': ['error', {groups: ['props', 'computed']}]}">
137137

138138
```vue
139-
<!-- BAD (`reversedMessage` computed property not used) -->
139+
<!-- BAD (`reversedMessage` computed property not used) -->
140140
<template>
141141
<p>{{ message }}</p>
142142
</template>

0 commit comments

Comments
 (0)