src/content/docs/linter/rules/no-redundant-roles.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="JSX and TSX" icon="seti:javascript"> ## Summary - Rule available since: `v1.0.0` - Diagnostic Category: [`lint/a11y/noRedundantRoles`](/reference/diagnostics#diagnostic-category) - This rule is **recommended**, meaning it is enabled by default. - This rule has an [**unsafe**](/linter/#unsafe-fixes) fix. - The default severity of this rule is [**error**](/reference/diagnostics#error). - Sources: - Same as [`jsx-a11y/no-redundant-roles`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-redundant-roles.md){
"linter": {
"rules": {
"a11y": {
"noRedundantRoles": "error"
}
}
}
}
Enforce explicit role property is not the same as implicit/default role property on an element.
<article role='article'></article>
<button role='button'></button>
<h1 role='heading' aria-level='1'>title</h1>
<article role='presentation'></article>
<Button role='button'></Button>
<span></span>