Skip to content

useValidAriaRole (since v1.4.0)

Diagnostic Category: lint/a11y/useValidAriaRole

Sources:

Elements with ARIA roles must use a valid, non-abstract ARIA role.

<div role="datepicker"></div>
a11y/useValidAriaRole.js:1:1 lint/a11y/useValidAriaRole  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
  
  > 1 │ <div role="datepicker"></div>
   ^^^^^^^^^^^^^^^^^^^^^^^
    2 │ 
  
   Check WAI-ARIA for valid roles or provide options accordingly.
  
   Unsafe fix: Remove the invalid role attribute.
     Check the list of all valid role attributes.
  
    1 │ <div·role="datepicker"></div>
       -----------------       
<div role="range"></div>
a11y/useValidAriaRole.js:1:1 lint/a11y/useValidAriaRole  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
  
  > 1 │ <div role="range"></div>
   ^^^^^^^^^^^^^^^^^^
    2 │ 
  
   Check WAI-ARIA for valid roles or provide options accordingly.
  
   Unsafe fix: Remove the invalid role attribute.
     Check the list of all valid role attributes.
  
    1 │ <div·role="range"></div>
       ------------       
<div role=""></div>
a11y/useValidAriaRole.js:1:1 lint/a11y/useValidAriaRole  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
  
  > 1 │ <div role=""></div>
   ^^^^^^^^^^^^^
    2 │ 
  
   Check WAI-ARIA for valid roles or provide options accordingly.
  
   Unsafe fix: Remove the invalid role attribute.
     Check the list of all valid role attributes.
  
    1 │ <div·role=""></div>
       -------       
<Foo role="foo"></Foo>
a11y/useValidAriaRole.js:1:1 lint/a11y/useValidAriaRole  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
  
  > 1 │ <Foo role="foo"></Foo>
   ^^^^^^^^^^^^^^^^
    2 │ 
  
   Check WAI-ARIA for valid roles or provide options accordingly.
  
   Unsafe fix: Remove the invalid role attribute.
     Check the list of all valid role attributes.
  
    1 │ <Foo·role="foo"></Foo>
       ----------       
<>
<div role="button"></div>
<div role={role}></div>
<div></div>
</>
{
"//": "...",
"options": {
"allowInvalidRoles": ["invalid-role", "text"],
"nonIgnoreDom": true
}
}