Skip to content

roleRedundancies

Reports redundant ARIA roles on elements with implicit roles.

✅ This rule is included in the jsx logical and logicalStrict presets.

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.

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

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

Made with ❤️‍🔥 around the world by the Flint team and contributors.