Disallow usage of redundant roles
- Rule ID:
- no-redundant-role
- Category:
- Accessibility
- Standards:
- ARIA in HTML
Some HTML5 elements have implicit WAI-ARIA roles defined by ARIA in HTML.
This rule disallows using the role
attribute to set the role to same as the implied role.
Rule details
Examples of incorrect code for this rule:
<main role="main">
<ul>
<li role="listitem">Lorem ipsum</li>
</ul>
</main>
Examples of correct code for this rule:
<ul>
<li role="presentation">Lorem ipsum</li>
</ul>