Disallow usage of unknown attributes
- Rule ID:
- no-unknown-attributes
- Category:
- -
- Standards:
- -
Experimental: This rule is still in an early stage. If you encounter false positives or missing attributes, please file a bug report.
This rule requires all attributes used on an element to be valid for that element.
Global HTML attributes (e.g. id, class, style, hidden) are included automatically.
Elements without metadata (e.g. custom elements) are ignored.
Rule details
Examples of incorrect code for this rule:
<div unknown="value"></div>
Examples of correct code for this rule:
<div id="foo" class="bar" hidden></div>
<input type="text" name="username" />
Exceptions
Currently this rule ignores:
data-*aria-*on*xml:*:attr@eventng-*v-*x-*[attr]
Version history
- 10.17.0 - Rule added.