Skip to content

roleRedundancies

Reports redundant ARIA roles on elements with implicit roles.

✅ This rule is included in the jsx logical preset.

HTML elements have default semantics implemented by the browser, including implicit ARIA roles. Setting an explicit role that matches the element’s implicit role is redundant and should be removed.

<button role="button" />
<img role="img" src="foo.jpg" />
<nav role="navigation" />

If you need to explicitly set roles for documentation purposes, you may want to disable this rule.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.