Skip to content

roleTags

Reports ARIA roles that have semantic HTML element equivalents.

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

Semantic HTML elements have built-in accessibility features and better browser support than generic elements with ARIA roles. Use native HTML elements when available instead of generic elements with role attributes.

<
any
div
role: string
role
="button" />
<
any
div
role: string
role
="img" />
<
any
span
role: string
role
="link" />

If you are using a framework that automatically manages element interactions and/or swaps elements to their semantic counterparts, you might be able to safely disable this rule.

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