self-closing-void-elements.md
April 2, 2019 ยท View on GitHub
self-closing-void-elements
HTML has no self-closing tags. The HTML5 parser will ignore self-closing tag in the case of void elements (tags that shouldn't have a "closing tag"). Although the parser will ignore it, it's unnecessary and can lead to confusion with SVG/XML code.
This rule forbids the following:
<img src="http://emberjs.com/images/ember-logo.svg" alt="ember" />
<hr/>
This rule allows the following:
<img src="http://emberjs.com/images/ember-logo.svg" alt="ember">
<hr>
There may be cases where a self-closing tag may be necessary for void elements. In such cases, a require string may be passed to log the missing closing tags.
Configuration
The following values are valid configuration:
- boolean --
truefor enabled /falsefor disabled - string --
requireto mandate the use of self closing tags