Skip to content

Commit 0e99261

Browse files
committed
update html-end-tags rule
1 parent ab99b7b commit 0e99261

File tree

1 file changed

+16
-24
lines changed

1 file changed

+16
-24
lines changed

docs/rules/html-end-tags.md

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,22 @@
55

66
## :book: Rule Details
77

8-
This rule reports:
9-
10-
- presence of and end tag on [Void elements](https://www.w3.org/TR/html51/syntax.html#void-elements)
11-
- absence of both an end tag (e.g. `</div>`) and a self-closing opening tag (e.g. `<div/>`) on other elements
12-
13-
:-1: Examples of **incorrect** code for this rule:
14-
15-
```html
16-
<div>
17-
<p>
18-
<p>
19-
<input></input>
20-
<br></br>
21-
```
22-
23-
:+1: Examples of **correct** code for this rule:
24-
25-
```html
26-
<div></div>
27-
<p></p>
28-
<p></p>
29-
<input>
30-
<br>
31-
```
8+
This rule aims to disallow lacking end tags.
9+
10+
<eslint-code-block :rules="{'vue/html-end-tags': ['error']}" code="
11+
&lt;template&gt;
12+
&lt;!-- ✓ GOOD --&gt;
13+
&lt;div&gt;&lt;/div&gt;
14+
&lt;p&gt;&lt;/p&gt;
15+
&lt;p&gt;&lt;/p&gt;
16+
&lt;input&gt;
17+
&lt;br&gt;
18+
19+
&lt;!-- ✗ BAD --&gt;
20+
&lt;div&gt;
21+
&lt;p&gt;
22+
&lt;/template&gt;
23+
" />
3224

3325
## :wrench: Options
3426

0 commit comments

Comments
 (0)