no missing references (no-missing-references)

Require all elements referenced by attributes such as for to exist in the current document.

Checked attributes:

Rule details

Examples of incorrect code for this rule:

<label for="missing-input"></label>
<div aria-labelledby="missing-text"></div>
<div aria-describedby="missing-text"></div>
error: Element references missing id "missing-input" (no-missing-references) at inline:1:13:
> 1 | <label for="missing-input"></label>
    |             ^^^^^^^^^^^^^
  2 | <div aria-labelledby="missing-text"></div>
  3 | <div aria-describedby="missing-text"></div>


error: Element references missing id "missing-text" (no-missing-references) at inline:2:23:
  1 | <label for="missing-input"></label>
> 2 | <div aria-labelledby="missing-text"></div>
    |                       ^^^^^^^^^^^^
  3 | <div aria-describedby="missing-text"></div>


error: Element references missing id "missing-text" (no-missing-references) at inline:3:24:
  1 | <label for="missing-input"></label>
  2 | <div aria-labelledby="missing-text"></div>
> 3 | <div aria-describedby="missing-text"></div>
    |                        ^^^^^^^^^^^^


3 errors found.

Examples of correct code for this rule:

<label for="my-input"></label>
<div id="verbose-text"></div>
<div aria-labelledby="verbose-text"></div>
<div aria-describedby="verbose-text"></div>
<input id="my-input">