Disallow usage of redundant roles (no-redundant-role)

Some HTML5 elements have implied WAI-ARIA roles and this rule disallows setting the implied roles on those elements.

Rule details

Examples of incorrect code for this rule:

<main role="main">
  <ul>
    <li role="listitem">Lorem ipsum</li>
  </ul>
</main>
error: Redundant role "main" on <main> (no-redundant-role) at inline:1:13:
> 1 | <main role="main">
    |             ^^^^
  2 |   <ul>
  3 |     <li role="listitem">Lorem ipsum</li>
  4 |   </ul>


error: Redundant role "listitem" on <li> (no-redundant-role) at inline:3:15:
  1 | <main role="main">
  2 |   <ul>
> 3 |     <li role="listitem">Lorem ipsum</li>
    |               ^^^^^^^^
  4 |   </ul>
  5 | </main>


2 errors found.

Examples of correct code for this rule:

<ul>
  <li role="presentation">Lorem ipsum</li>
</ul>