Rules
The complete list of built-in rules. Most users don't need to configure these individually — presets enable them for you. See Applying Rules to customize.
Syntax
| Rule ID | Fixable | Description |
|---|---|---|
no-content-after-body | Disallow a start tag or non-whitespace text after the body element's end tag. | |
no-duplicate-attr | 🔧 | Warns that attributes were duplicated in one element. Capital letters and lower-case letters are not distinguished. |
no-malformed-character-reference | Warns when a character reference is malformed — an unknown name, a missing semicolon, or a NULL/surrogate/control/noncharacter/out-of-range numeric reference. | |
no-orphaned-end-tag | 🔧 | Warns when an end tag appears without a corresponding start tag, which constitutes an inner parse error in HTML Standard. |
no-stray-head-or-body-tag | Disallow a stray head end tag or a duplicate body start tag left behind by an implicit head closure. | |
no-unclosed-element-at-eof | Disallow an element requiring an end tag from remaining open at the end of the document. | |
no-unescaped-char | Warns when a literal less-than sign (or, in strict mode, a greater-than sign, a double quote, or a bare ampersand) isn't escaped with a character reference in text content or an attribute value. | |
valid-importmap | Validate the body of <script type="importmap"> elements against the import map spec. | |
valid-speculation-rules | Validate the body of <script type="speculationrules"> elements against the Speculation Rules spec. |
Structure
| Rule ID | Fixable | Description |
|---|---|---|
consistent-table-row-length | Warns when a row's number of columns disagrees with the rest of the table. | |
head-element-order | 🔧 | Warns if elements within <head> are not in the expected order. |
meta-charset-position | Require the character encoding declaration to be serialized within the first 1024 bytes of the document. | |
no-deprecated-element | Warns when there is an element defined as deprecated. | |
no-disallowed-ancestor | Warns when an element appears as a descendant of an ancestor its content model forbids. | |
no-duplicate-dt | No duplicate names in <dl> | |
no-duplicate-sibling-attr | Warns when an attribute that must be unique among siblings appears on more than one element of the same type within the same parent. | |
no-duplicate-visible-main | Disallow more than one visible main element in a document. | |
no-empty-palpable-content | Warn if there is an empty palpable content element. | |
no-empty-table-track | Warns when a table row or column has no cell anchored to it. | |
no-obsolete-doctype | Warns when a document declares an obsolete DOCTYPE. | |
no-obsolete-element | Warns when there is an element the HTML Living Standard marks as a non-conforming, obsolete feature. | |
no-restricted-element | Warns if specified elements appear on a document or an element. | |
no-table-cell-overlap | Warns when two cells anchored in a table are covering the same slot. | |
no-table-span-overflow | Warns when a cell's rowspan reaches past the end of its row group. | |
permitted-contents | Validate the content model and structural constraints of HTML elements. | |
require-ancestor | Warns when an element is missing a required ancestor. | |
require-doctype | Warns when a document doesn't include a DOCTYPE. | |
require-element | Required elements |
Attributes
| Rule ID | Fixable | Description |
|---|---|---|
itemprop-requires-itemscope | Require every itemprop to belong to an item. | |
link-types | Validates link type keywords in the rel attribute against the WHATWG standard. | |
map-id-name-match | Require that, when both attributes are present on a map element, the id attribute has the same value as the name attribute. | |
meter-value-bounds | Enforce HTML LS inequalities between meter element attributes (min, max, value, low, high, optimum). | |
no-always-matching-source | Requires a media or type attribute on a source element that has a following srcset-bearing sibling. | |
no-ambiguous-navigable-target-names | Prevents typographical errors in links and more that could inadvertently replace special navigational keywords (_blank, _self, _parent, _top) with invalid target names, ensuring navigations behave as intended. | |
no-deprecated-attr | Warns when there is an attribute defined as deprecated. | |
no-disallowed-attr | Warn if an attribute is defined by the specification but not allowed in this context. | |
no-duplicate-autofocus | Disallow multiple elements with the autofocus attribute sharing the same autofocus scoping root. | |
no-ineffective-attr | 🔧 | Warn that if the attribute specified cannot affect (in other words, mean-less) the element. |
no-invalid-attr-value | Warn if an attribute's value doesn't match the type or pattern the specification (or the custom rule) requires. | |
no-mismatched-aspect-ratio | Warns when the width/height attributes of an img or source element do not match the actual image aspect ratio. | |
no-mixed-srcset-descriptors | Disallows mixing width and pixel density descriptors in a srcset attribute. | |
no-obsolete-attr | Warns when there is an attribute the HTML Living Standard marks as a non-conforming, obsolete feature. | |
no-restricted-attr | Disallow specific attributes, or specific attribute/value combinations, that your project's rules forbid regardless of the HTML specification. | |
no-unknown-attr | Warn if an attribute is not defined by the specification (or the custom rule) for the element. | |
no-unpaired-srcset-sizes | Enforces the mutual requirement between the srcset width descriptors and the sizes attribute. | |
progress-value-bounds | Enforce HTML LS inequalities for the progress element (value ≤ max; value ≤ 1 when max is absent). | |
require-attr | Warns if specified attributes or required attribute on specs are not appeared on an element. | |
require-datetime | Warn to need the datetime attribute if the time element has invalid content. | |
sizes-auto-requires-lazy-loading | Requires loading="lazy" wherever sizes="auto" is used. |
References
| Rule ID | Fixable | Description |
|---|---|---|
form-attr-references-form | Require that a form-associated element's form attribute references an actual form element by ID. | |
input-list-references-datalist | Require that an input element's list attribute references an actual datalist element by ID. | |
label-for-references-labelable | Require that a label element's for attribute references an actual labelable element by ID. | |
no-broken-fragment-link | Check whether a fragment in a hyperlink is referencing an ID that exists in the same document. | |
no-duplicate-id | Warns that id attribute value were duplicated in one document. | |
no-refer-to-non-existent-id | Check whether the ID or the list of ID specified to for, form, aria-*, and more are referencing an ID that exists in the same document. | |
usemap-references-map | Require that an img element's usemap attribute is a valid hash-name reference to a map element. |
Forms
| Rule ID | Fixable | Description |
|---|---|---|
label-no-multiple-controls | Enforce the descendant-control constraints on a label element per HTML LS §4.10.4. | |
no-extra-selected-options | Disallow multiple selected option elements in a select that lacks the multiple attribute. | |
no-input-file-value | Require <input type="file"> elements to omit the value attribute or set it to the empty string, per HTML LS §4.10.5.1.18. | |
placeholder-label-option | Checking whether the select element needs the placeholder label option. |
Accessibility
| Rule ID | Fixable | Description |
|---|---|---|
aria-prop-requires-role | Warns when a non-global ARIA property is used on an element without an explicit role. | |
element-supports-aria-prop | Warns when an ARIA property or state is disallowed by an element-specific ARIA in HTML restriction. | |
label-has-control | Warns if the label element has no control. | |
no-abstract-role | Warns when an abstract WAI-ARIA role is used. | |
no-aria-hidden-on-hidden-until-found | Disallows aria-hidden="true" on an element whose hidden attribute is in the Hidden Until Found state. | |
no-aria-on-presentational-children | Warns when ARIA attributes are set on descendants of roles with presentational children. | |
no-aria-on-unsupported-element | Disallows ARIA attributes on elements that don't support ARIA at all. | |
no-consecutive-br | 🔧 | Warns against the use of consecutive <br> tags |
no-contradictory-aria-prop | Warns when an ARIA property's value contradicts an equivalent native HTML attribute. | |
no-default-aria-value | Warns when an ARIA property is explicitly set to its spec-defined default value. | |
no-deprecated-aria-prop | Warns when a deprecated ARIA property or state is used on a role. | |
no-deprecated-role | Warns when a deprecated WAI-ARIA role is used. | |
no-duplicate-h1 | Warn if there is more than one h1 element in the document. | |
no-focusable-in-aria-hidden | Warns when focusable interactive elements are placed inside an aria-hidden subtree. | |
no-invalid-aria-prop-value | Warns when an ARIA property or state value does not conform to its expected type. | |
no-nested-top-level-landmark | Warns when banner, main, or contentinfo is nested inside another landmark. | |
no-prohibited-naming | Warns when aria-label, aria-labelledby, or aria-braillelabel is used on a naming-prohibited element. | |
no-pseudo-list | Prompt to use list element when a bullet character is at the start of a text node. | |
undefined | undefined | |
no-redundant-aria-prop | Warns when an ARIA property redundantly restates the same semantics as an equivalent native HTML attribute. | |
no-redundant-role | Warns when the explicit role attribute duplicates the element's implicit role. | |
no-skipped-heading-level | Warns for skipped heading levels | |
no-unknown-role | Warns when a role attribute value does not exist in the WAI-ARIA specification. | |
permitted-roles | Warns when a role is not permitted on the element according to ARIA in HTML. | |
require-accessible-name | Warn if the element has no accessible name. | |
require-adjacent-popover | Warns when popover triggers and their corresponding targets are not adjacent | |
require-aria-prop | Warns when required ARIA properties for a role are missing. | |
require-dialog-autofocus | Requires a dialog shown via the show-modal command to contain an element with the autofocus attribute | |
require-h1 | Warn if there is no h1 element in the document. | |
require-landmark-label | Warns when a landmark role used multiple times on a page lacks a unique accessible name. | |
require-owned-elements | Warns when a role does not contain its required child roles. | |
require-parent-role | Warns when an element with an explicit role is placed outside its required parent context. | |
role-supports-aria-prop | Warns when an ARIA property or state is disallowed on the element's computed role. | |
tab-requires-tabpanel | Warns when an active "tab" role element has no corresponding "tabpanel" role element. |
Style
| Rule ID | Fixable | Description |
|---|---|---|
attr-order | 🔧 | Enforces a consistent order of attributes on elements. |
attr-value-quotes | 🔧 | Warns if the attribute value is not quoted. |
case-sensitive-attr-name | 🔧 | Warns that the attribute name is not in one of uppercase or lowercase letters. |
case-sensitive-tag-name | 🔧 | Warns that the tag name is not in one of uppercase or lowercase letters. |
class-naming | Warn if the class name does not conform to the specified rules. | |
no-boolean-attr-value | 🔧 | Warn when it specified any value to the boolean attribute. |
no-default-value | 🔧 | Warn when it specifies the default value to the attribute. |
require-end-tag | Warn if there is not an end tag. |
Maintainability
| Rule ID | Fixable | Description |
|---|---|---|
no-event-handler-attr | Warn when specifying the event handler attribute. | |
no-hardcoded-id | Warn it hard-coded the value of the id attribute when the element is a fragment. |
Browser Compatibility
| Rule ID | Fixable | Description |
|---|---|---|
no-experimental-features | Warns when using HTML elements or attributes marked as experimental. | |
no-nonstandard-features | Warns when using HTML elements or attributes marked as non-standard. | |
no-unsupported-browser-features | Warns when using HTML elements or attributes not supported by target browsers. |
Removed rules
| Rule ID | Fixable | Description | Drop |
|---|---|---|---|
attr-equal-space-after | Spaces after the equal of attribute | Since v3.0 | |
attr-equal-space-before | Spaces before the equal of attribute | Since v3.0 | |
attr-spacing | Spaces between attributes | Since v3.0 | |
indentation | Indentation | Since v3.0 |