Skip to content

invalid-attr-value

Added in 0.2.5 · Related issues · View source

What it does

Checks for HTML attributes whose value is not in the set allowed by the HTML specification (and supported framework dialects such as HTMX or Alpine.js).

Currently only validates enum-type attributes (e.g., <form method>, <input type>, <button type>).

Why is this bad?

Browsers silently ignore unknown values for enum attributes and fall back to a default, which usually does not match the author's intent. The resulting bug is easy to miss because the page still renders.

Values containing template interpolation ({{ ... }} or {% ... %}), unknown elements (web components, custom tags), and unknown attributes are skipped.

Example

<form method="put"></form>

Use instead:

<form method="post"></form>

References