Skip to content

useAriaPropsForRole (since v1.0.0)

Diagnostic Category: lint/a11y/useAriaPropsForRole

Sources:

Enforce that elements with ARIA roles must have all required ARIA attributes for that role.

<span role="checkbox"></span>
a11y/useAriaPropsForRole.js:1:7 lint/a11y/useAriaPropsForRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   The element with the checkbox ARIA role does not have the required ARIA attributes.
  
  > 1 │ <span role="checkbox"></span>
         ^^^^^^^^^^^^^^^
    2 │ 
  
   Missing ARIA prop(s):
  
  - aria-checked
  
<span role="heading"></span>
a11y/useAriaPropsForRole.js:1:7 lint/a11y/useAriaPropsForRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   The element with the heading ARIA role does not have the required ARIA attributes.
  
  > 1 │ <span role="heading"></span>
         ^^^^^^^^^^^^^^
    2 │ 
  
   Missing ARIA prop(s):
  
  - aria-level
  
<span role="checkbox" aria-checked="true"></span>
<span role="heading" aria-level="1"></span>