You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disallow the omission of optional closing tags for HTML elements where the closing tag is technically optional according to the HTML specification. This rule flags elements that have an `HTMLOmittedCloseTagNode` as their close tag.
8
+
9
+
## Rationale
10
+
11
+
While HTML allows certain closing tags to be omitted (implicitly closed by sibling elements or parent closing), explicit closing tags improve code readability and maintainability. They make the document structure clear at a glance and reduce ambiguity about where elements end.
12
+
13
+
Explicit closing tags also:
14
+
15
+
- Make templates easier to understand for developers unfamiliar with HTML's implicit closing rules
16
+
- Reduce potential for subtle bugs when refactoring or moving code
17
+
- Improve consistency across the codebase
18
+
- Make diffs cleaner when adding content to elements
19
+
20
+
## Elements with Optional Closing Tags
21
+
22
+
This rule would flag elements that have omitted closing tags:
23
+
24
+
-`<li>` - list items
25
+
-`<dt>`, `<dd>` - definition list terms and descriptions
26
+
-`<p>` - paragraphs
27
+
-`<option>`, `<optgroup>` - select options and groups
0 commit comments