Skip to content

no-missing-references

Reports an attribute that refers to an id (for, aria-labelledby, list, headers, form, …) when no element of the document has that id.

A reference to nothing silently does nothing: a label that labels no control, a description that is never read, a list that offers no choices.

To fix, correct the id or add the element that has it.

Reported
...
<label for="y">y</label><input type="text" id="y">
<label for="missing">z</label>
<p aria-labelledby="y nothere"></p>
angular:
lint:
rules:
no-missing-references: warn # off, warn (default), error
html:
lint:
rules:
no-missing-references: warn # off, warn (default), error
svelte:
lint:
rules:
no-missing-references: warn # off, warn (default), error
vue:
lint:
rules:
no-missing-references: warn # off, warn (default), error

Enabled by the presets: html/html-validate-standard.

Suppress one line with sudsy-disable-next-line no-missing-references in a comment of the file’s language.

The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.

Tool Rule Match What differs
html-validate no-missing-references partial no include and exclude options