Skip to content

Commit 03f7c96

Browse files
committed
update html-quotes
1 parent c1a2d3d commit 03f7c96

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

docs/rules/html-quotes.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,39 @@ This rule enforces the quotes style of HTML attributes.
1515

1616
This rule reports the quotes of attributes if it is different to configured quotes.
1717

18-
:-1: Examples of **incorrect** code for this rule:
19-
20-
```html
21-
<img src='./logo.png'>
22-
<img src=./logo.png>
18+
<eslint-code-block :rules="{'vue/html-quotes': ['error']}">
2319
```
24-
25-
:+1: Examples of **correct** code for this rule:
26-
27-
```html
28-
<img src="./logo.png">
29-
```
30-
31-
:-1: Examples of **incorrect** code for this rule with `"single"` option:
32-
33-
```html
34-
<img src="./logo.png">
35-
<img src=./logo.png>
36-
```
37-
38-
:+1: Examples of **correct** code for this rule with `"single"` option:
39-
40-
```html
41-
<img src='./logo.png'>
20+
<template>
21+
<!-- ✓ GOOD -->
22+
<img src="./logo.png">
23+
24+
<!-- ✗ BAD -->
25+
<img src='./logo.png'>
26+
<img src=./logo.png>
27+
</template>
4228
```
29+
</eslint-code-block>
4330

4431
## :wrench: Options
4532

4633
- `"double"` (default) ... requires double quotes.
4734
- `"single"` ... requires single quotes.
4835

36+
### `"single"`
37+
38+
<eslint-code-block :rules="{'vue/html-quotes': ['error', 'single']}">
39+
```
40+
<template>
41+
<!-- ✓ GOOD -->
42+
<img src='./logo.png'>
43+
44+
<!-- ✗ BAD -->
45+
<img src="./logo.png">
46+
<img src=./logo.png>
47+
</template>
48+
```
49+
</eslint-code-block>
50+
4951
## :mag: Implementation
5052

5153
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/html-quotes.js)

0 commit comments

Comments
 (0)