Skip to content

useAriaPropsSupportedByRole (HTML)

biome.json
{
"linter": {
"rules": {
"a11y": {
"useAriaPropsSupportedByRole": "error"
}
}
}
}

Enforce that ARIA properties are valid for the roles that are supported by the element.

Invalid ARIA properties can make it difficult for users of assistive technologies to understand the purpose of the element.

<a href="#" aria-checked="true"></a>
code-block.html:1:1 lint/a11y/useAriaPropsSupportedByRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ The ARIA attribute 'aria-checked' is not supported by this element.

> 1 │ <a href="#" aria-checked="true"></a>
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │

ℹ Assistive technologies may ignore an ARIA attribute that the role of the element does not support, or report incorrect information to the user.

ℹ Remove the attribute, or use a role that supports it.

<img alt="foobar" aria-checked="true" />
code-block.html:1:1 lint/a11y/useAriaPropsSupportedByRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ The ARIA attribute 'aria-checked' is not supported by this element.

> 1 │ <img alt="foobar" aria-checked="true" />
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │

ℹ Assistive technologies may ignore an ARIA attribute that the role of the element does not support, or report incorrect information to the user.

ℹ Remove the attribute, or use a role that supports it.

<a href="#" aria-expanded="true"></a>
<img alt="foobar" aria-hidden="true" />
<div role="heading" aria-level="1"></div>