disallows void element with content (void)

HTML void elements cannot have any content and must not have an end tag.

Foreign elements will always be ignored by this rule.

Rule details

Examples of incorrect code for this rule:

<fieldset>
    <input/>
</fieldset>

<img></img>
error: Expected omitted end tag <input> instead of self-closing element <input/> (void) at inline:2:11:
  1 | <fieldset>
> 2 |     <input/>
    |           ^^
  3 | </fieldset>
  4 | 
  5 | <img></img>


error: End tag for <img> must be omitted (void) at inline:5:11:
  3 | </fieldset>
  4 | 
> 5 | <img></img>
    |           ^


2 errors found.

Examples of correct code for this rule:

<fieldset>
    <input>
</fieldset>

<img>

Options

This rule takes an optional object:

{
    "style": "omit",
}

Style