Skip to main content

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 IDFixableDescription
no-content-after-bodyDisallow 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-referenceWarns 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-tagDisallow a stray head end tag or a duplicate body start tag left behind by an implicit head closure.
no-unclosed-element-at-eofDisallow an element requiring an end tag from remaining open at the end of the document.
no-unescaped-charWarns 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-importmapValidate the body of <script type="importmap"> elements against the import map spec.
valid-speculation-rulesValidate the body of <script type="speculationrules"> elements against the Speculation Rules spec.

Structure

Rule IDFixableDescription
consistent-table-row-lengthWarns 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-positionRequire the character encoding declaration to be serialized within the first 1024 bytes of the document.
no-deprecated-elementWarns when there is an element defined as deprecated.
no-disallowed-ancestorWarns when an element appears as a descendant of an ancestor its content model forbids.
no-duplicate-dtNo duplicate names in <dl>
no-duplicate-sibling-attrWarns 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-mainDisallow more than one visible main element in a document.
no-empty-palpable-contentWarn if there is an empty palpable content element.
no-empty-table-trackWarns when a table row or column has no cell anchored to it.
no-obsolete-doctypeWarns when a document declares an obsolete DOCTYPE.
no-obsolete-elementWarns when there is an element the HTML Living Standard marks as a non-conforming, obsolete feature.
no-restricted-elementWarns if specified elements appear on a document or an element.
no-table-cell-overlapWarns when two cells anchored in a table are covering the same slot.
no-table-span-overflowWarns when a cell's rowspan reaches past the end of its row group.
permitted-contentsValidate the content model and structural constraints of HTML elements.
require-ancestorWarns when an element is missing a required ancestor.
require-doctypeWarns when a document doesn't include a DOCTYPE.
require-elementRequired elements

Attributes

Rule IDFixableDescription
itemprop-requires-itemscopeRequire every itemprop to belong to an item.
link-typesValidates link type keywords in the rel attribute against the WHATWG standard.
map-id-name-matchRequire that, when both attributes are present on a map element, the id attribute has the same value as the name attribute.
meter-value-boundsEnforce HTML LS inequalities between meter element attributes (min, max, value, low, high, optimum).
no-always-matching-sourceRequires a media or type attribute on a source element that has a following srcset-bearing sibling.
no-ambiguous-navigable-target-namesPrevents 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-attrWarns when there is an attribute defined as deprecated.
no-disallowed-attrWarn if an attribute is defined by the specification but not allowed in this context.
no-duplicate-autofocusDisallow 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-valueWarn if an attribute's value doesn't match the type or pattern the specification (or the custom rule) requires.
no-mismatched-aspect-ratioWarns when the width/height attributes of an img or source element do not match the actual image aspect ratio.
no-mixed-srcset-descriptorsDisallows mixing width and pixel density descriptors in a srcset attribute.
no-obsolete-attrWarns when there is an attribute the HTML Living Standard marks as a non-conforming, obsolete feature.
no-restricted-attrDisallow specific attributes, or specific attribute/value combinations, that your project's rules forbid regardless of the HTML specification.
no-unknown-attrWarn if an attribute is not defined by the specification (or the custom rule) for the element.
no-unpaired-srcset-sizesEnforces the mutual requirement between the srcset width descriptors and the sizes attribute.
progress-value-boundsEnforce HTML LS inequalities for the progress element (value ≤ max; value ≤ 1 when max is absent).
require-attrWarns if specified attributes or required attribute on specs are not appeared on an element.
require-datetimeWarn to need the datetime attribute if the time element has invalid content.
sizes-auto-requires-lazy-loadingRequires loading="lazy" wherever sizes="auto" is used.

References

Rule IDFixableDescription
form-attr-references-formRequire that a form-associated element's form attribute references an actual form element by ID.
input-list-references-datalistRequire that an input element's list attribute references an actual datalist element by ID.
label-for-references-labelableRequire that a label element's for attribute references an actual labelable element by ID.
no-broken-fragment-linkCheck whether a fragment in a hyperlink is referencing an ID that exists in the same document.
no-duplicate-idWarns that id attribute value were duplicated in one document.
no-refer-to-non-existent-idCheck 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-mapRequire that an img element's usemap attribute is a valid hash-name reference to a map element.

Forms

Rule IDFixableDescription
label-no-multiple-controlsEnforce the descendant-control constraints on a label element per HTML LS §4.10.4.
no-extra-selected-optionsDisallow multiple selected option elements in a select that lacks the multiple attribute.
no-input-file-valueRequire <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-optionChecking whether the select element needs the placeholder label option.

Accessibility

Rule IDFixableDescription
aria-prop-requires-roleWarns when a non-global ARIA property is used on an element without an explicit role.
element-supports-aria-propWarns when an ARIA property or state is disallowed by an element-specific ARIA in HTML restriction.
label-has-controlWarns if the label element has no control.
no-abstract-roleWarns when an abstract WAI-ARIA role is used.
no-aria-hidden-on-hidden-until-foundDisallows aria-hidden="true" on an element whose hidden attribute is in the Hidden Until Found state.
no-aria-on-presentational-childrenWarns when ARIA attributes are set on descendants of roles with presentational children.
no-aria-on-unsupported-elementDisallows 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-propWarns when an ARIA property's value contradicts an equivalent native HTML attribute.
no-default-aria-valueWarns when an ARIA property is explicitly set to its spec-defined default value.
no-deprecated-aria-propWarns when a deprecated ARIA property or state is used on a role.
no-deprecated-roleWarns when a deprecated WAI-ARIA role is used.
no-duplicate-h1Warn if there is more than one h1 element in the document.
no-focusable-in-aria-hiddenWarns when focusable interactive elements are placed inside an aria-hidden subtree.
no-invalid-aria-prop-valueWarns when an ARIA property or state value does not conform to its expected type.
no-nested-top-level-landmarkWarns when banner, main, or contentinfo is nested inside another landmark.
no-prohibited-namingWarns when aria-label, aria-labelledby, or aria-braillelabel is used on a naming-prohibited element.
no-pseudo-listPrompt to use list element when a bullet character is at the start of a text node.
undefinedundefined
no-redundant-aria-propWarns when an ARIA property redundantly restates the same semantics as an equivalent native HTML attribute.
no-redundant-roleWarns when the explicit role attribute duplicates the element's implicit role.
no-skipped-heading-levelWarns for skipped heading levels
no-unknown-roleWarns when a role attribute value does not exist in the WAI-ARIA specification.
permitted-rolesWarns when a role is not permitted on the element according to ARIA in HTML.
require-accessible-nameWarn if the element has no accessible name.
require-adjacent-popoverWarns when popover triggers and their corresponding targets are not adjacent
require-aria-propWarns when required ARIA properties for a role are missing.
require-dialog-autofocusRequires a dialog shown via the show-modal command to contain an element with the autofocus attribute
require-h1Warn if there is no h1 element in the document.
require-landmark-labelWarns when a landmark role used multiple times on a page lacks a unique accessible name.
require-owned-elementsWarns when a role does not contain its required child roles.
require-parent-roleWarns when an element with an explicit role is placed outside its required parent context.
role-supports-aria-propWarns when an ARIA property or state is disallowed on the element's computed role.
tab-requires-tabpanelWarns when an active "tab" role element has no corresponding "tabpanel" role element.

Style

Rule IDFixableDescription
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-namingWarn 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-tagWarn if there is not an end tag.

Maintainability

Rule IDFixableDescription
no-event-handler-attrWarn when specifying the event handler attribute.
no-hardcoded-idWarn it hard-coded the value of the id attribute when the element is a fragment.

Browser Compatibility

Rule IDFixableDescription
no-experimental-featuresWarns when using HTML elements or attributes marked as experimental.
no-nonstandard-featuresWarns when using HTML elements or attributes marked as non-standard.
no-unsupported-browser-featuresWarns when using HTML elements or attributes not supported by target browsers.

Removed rules

Rule IDFixableDescriptionDrop
attr-equal-space-afterSpaces after the equal of attributeSince v3.0
attr-equal-space-beforeSpaces before the equal of attributeSince v3.0
attr-spacingSpaces between attributesSince v3.0
indentationIndentationSince v3.0