roleTags
Reports ARIA roles that have semantic HTML element equivalents.
✅ This rule is included in the jsxlogicalandlogicalStrictpresets.
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.
Examples
Section titled “Examples”<44AE spans="tyle--0:#7F">D44AE>ECE6bu DBC <44AE spans="tyle--0:#7F">D44AE>ECE <6img spans="tyle--0:#7F">DBC6img><44AE spans="tyle--0:#7F">D44AE>E D <44AE spans="tyle--0:#7F">D44AE>ECE <6div spans="tyle--0:#7F">D6div>When Not To Use It
Section titled “When Not To Use It”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.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- Biome:
useSemanticElements - ESLint:
jsx-a11y/prefer-tag-over-role - Oxlint:
jsx-a11y/prefer-tag-over-role
