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.

Conformance checking

Rule IDFixableDescription
attr-duplication🔧Warns that attributes were duplicated in one element. Capital letters and lower-case letters are not distinguished.
correct-aspect-ratioWarns when the width/height attributes of an img or source element do not match the actual image aspect ratio.
deprecated-attrWarns when there is an attribute defined as deprecated or obsolete.
deprecated-elementWarns when there is an element defined as deprecated or obsolete.
disallowed-elementWarns if specified elements appear on a document or an element.
doctypeWarns when doesn't including DOCTYPE.
heading-levelsWarns for skipped heading levels
id-duplicationWarns that id attribute value were duplicated in one document.
invalid-attrWarn if an attribute is a non-existent attribute or an invalid type value due to the specifications (or the custom rule).
link-typesValidates link type keywords in the rel attribute against the WHATWG standard.
no-duplicate-autofocusDisallow multiple elements with the autofocus attribute in a document.
no-duplicate-dtNo duplicate names in <dl>
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-orphaned-end-tag🔧Warns when an end tag appears without a corresponding start tag, which constitutes an inner parse error in HTML Standard.
no-unsupported-featuresWarns when using HTML elements or attributes not supported by target browsers, or that are experimental/non-standard.
permitted-contentsValidate the content model and structural constraints of HTML elements.
placeholder-label-optionChecking whether the select element needs the placeholder label option.
require-datetimeWarn to need the datetime attribute if the time element has invalid content.
required-attrWarns if specified attributes or required attribute on specs are not appeared on an element.
required-elementRequired elements
srcset-sizes-constraintEnforces WHATWG constraints between srcset, sizes, and loading attributes.

Accessibility

Rule IDFixableDescription
label-has-controlWarns if the label element has no control.
landmark-rolesWhether banner, main, complementary and contentinfo are top-level landmarks. Whether a specific landmark role has unique label when used multiple times on a page
neighbor-popoversWarns when popover triggers and their corresponding targets are not adjacent
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-consecutive-br🔧Warns against the use of consecutive <br> tags
no-refer-to-non-existent-idCheck whether the ID or the list of ID specified to for, form, aria-*, and more, or a fragment in a hyperlink are referencing it that existed in the same document.
undefinedundefined
require-accessible-nameWarn if the element has no accessible name.
require-dialog-autofocusRequires a dialog shown via the show-modal command to contain an element with the autofocus attribute
required-h1Warn if there is no h1 element in the document.
table-row-column-alignmentChecks for consistency in the defined number of rows and columns.
use-listPrompt to use list element when a bullet character is at the start of a text node.
wai-ariaWarn if the role attribute and aria-* attributes don't set in accordance with specs that are WAI-ARIA and ARIA in HTML.
wai-aria-abstract-roleWarns when an abstract WAI-ARIA role is used.
wai-aria-default-valueWarns when an ARIA property is explicitly set to its spec-defined default value.
wai-aria-deprecated-propsWarns when a deprecated ARIA property or state is used on a role.
wai-aria-deprecated-roleWarns when a deprecated WAI-ARIA role is used.
wai-aria-disallowed-propsWarns when an ARIA property or state is not allowed on the element's computed role or is subject to naming prohibition.
wai-aria-implicit-propsWarns when an ARIA property duplicates or contradicts semantics provided by a native HTML attribute.
wai-aria-implicit-roleWarns when the explicit role attribute duplicates the element's implicit role.
wai-aria-interaction-in-hiddenWarns when focusable interactive elements are placed inside an aria-hidden subtree.
wai-aria-no-global-propWarns when a non-global ARIA property is used on an element without an explicit role.
wai-aria-non-existent-roleWarns when a role attribute value does not exist in the WAI-ARIA specification.
wai-aria-permitted-rolesWarns when a role is not permitted on the element according to ARIA in HTML.
wai-aria-presentational-childrenWarns when ARIA attributes are set on descendants of roles with presentational children.
wai-aria-required-owned-elementsWarns when a role does not contain its required child roles.
wai-aria-required-parent-roleWarns when an element with an explicit role is placed outside its required parent context.
wai-aria-required-propsWarns when required ARIA properties for a role are missing.
wai-aria-valueWarns when an ARIA property or state value does not conform to its expected type.

Naming Convention

Rule IDFixableDescription
class-namingWarn if the class name does not conform to the specified rules.

Maintainability

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

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.
character-referenceWarns when unauthorized illegal characters are not escaped with character reference in the text node or attribute value.
end-tagWarn if there is not an end tag.
head-element-order🔧Warns if elements within <head> are not in the expected order.
ineffective-attr🔧Warn that if the attribute specified cannot affect (in other words, mean-less) the element.
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.

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