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.

Deprecated: This rule is deprecated. It has been replaced by the rules void-content, void-style and no-self-closing.

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:7:
  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