require-aria-prop
Warns when required ARIA properties for a role are missing.
The names of ARIA attributes are compared as no-unknown-attr compares names (see its "Attribute name case" section): ARIA-LABEL is the same attribute as aria-label where the DOM treats attribute names as case-insensitive, such as on an HTML element, and a different one where it does not, such as on an <svg> element in JSX.
❌ Examples of incorrect code for this rule
<div role="slider"></div>
✅ Examples of correct code for this rule
<div role="slider" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
separatorFor the separator role, aria-valuenow is required only when the element is focusable (e.g. has tabindex, or is interactive content like <button> / <a href>). A non-focusable <div role="separator"> is treated as a static structural separator per WAI-ARIA and does not require aria-valuenow. aria-valuemin and aria-valuemax are not required in any version of WAI-ARIA, as the prose of the role asks for them only when they differ from their implicit 0 and 100, though the table of WAI-ARIA 1.1 lists them.
<!-- ✅ Static structural separator -->
<div role="separator"></div>
<!-- ❌ Focusable separator missing aria-valuenow -->
<div role="separator" tabindex="0"></div>
<!-- ✅ Focusable separator with aria-valuenow -->
<div role="separator" tabindex="0" aria-valuenow="50"></div>
Interface
{
"require-aria-prop": boolean
}
Default Severity
error