jsx-a11y/no-redundant-roles
Disallow role attributes that duplicate an element's implicit ARIA role, like <button role='button'>.
- Category: Accessibility
- Severity: warn
- Source:
oxlint-builtin:jsx-a11y - Framework: global
- Enabled when: always (unless customRulesOnly=true)
- Documentation: https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/no-redundant-roles
Validation prompt
Use this to decide whether a fired diagnostic is real or a false positive.
Fires when role on a native element duplicates that element's implicit ARIA role, e.g. <button role='button'> or <img role='img'>. Default carve-out: <nav role='navigation'> is allowed per W3C guidance for legacy AT. False positive: an explicit role kept for an older screen reader that misreports the element's implicit role — increasingly rare in modern assistive tech.
Fix prompt
Use this once validation confirms the diagnostic is real.
Delete the redundant role attribute — the browser already exposes the correct role to assistive tech, and a duplicate role can actually break some ATs. If you genuinely need to override an element's semantics, reconsider the markup choice instead. Use the rule's options object to whitelist additional element/role pairs (like nav: ['navigation']) when needed. See https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/no-redundant-roles
Related rules
More Accessibility rules from the rules reference:
jsx-a11y/no-static-element-interactions: Require static elements with click or key handlers to declare an interactive role, or be replaced with a semantic element.jsx-a11y/role-has-required-aria-props: Require elements with an ARIA role to carry that role's required aria-* state props, like aria-checked on role='checkbox'.jsx-a11y/scope: Disallow the scope attribute on elements other than th — it is only defined for table header cells.jsx-a11y/tabindex-no-positive: Disallow positive tabIndex values, which override the natural tab order and make focus jump unpredictably.react-doctor/anchor-ambiguous-text: Describe a link's destination — avoid bare 'click here' / 'learn more' / 'link' as the only link text.