콘텐츠로 이동

useAriaPropsSupportedByRole

이 콘텐츠는 아직 번역되지 않았습니다.

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 />
code-block.jsx:1:1 lint/a11y/useAriaPropsSupportedByRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The ARIA attribute ‘aria-checked’ is not supported by this element.

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

Ensure that ARIA attributes are valid for the role of the element.

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

The ARIA attribute ‘aria-checked’ is not supported by this element.

> 1 │ <img alt=“foobar” aria-checked />
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │

Ensure that ARIA attributes are valid for the role of the element.

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