Skip to content

jsx_a11y/no-redundant-roles Correctness

🛠️ An auto-fix is available for this rule.

What it does

Enforces that the explicit role property is not the same as implicit/default role property on element.

Why is this bad?

Redundant roles can lead to confusion and verbosity in the codebase.

Example

Examples of incorrect code for this rule:

jsx
<nav role="navigation" />

Examples of correct code for this rule:

jsx
<nav />

References

Released under the MIT License.