src/content/docs/linter/rules/use-aria-props-supported-by-role.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="JavaScript (and super languages)" icon="seti:javascript"> ## Summary - Rule available since: `v1.9.0` - Diagnostic Category: [`lint/a11y/useAriaPropsSupportedByRole`](/reference/diagnostics#diagnostic-category) - This rule is **recommended**, meaning it is enabled by default. - This rule doesn't have a fix. - The default severity of this rule is [**error**](/reference/diagnostics#error). - Sources: - Same as [`jsx-a11y/role-supports-aria-props`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/role-supports-aria-props.md){
"linter": {
"rules": {
"a11y": {
"useAriaPropsSupportedByRole": "error"
}
}
}
}
Enforce that ARIA properties are valid for the roles that are supported by the element.
Invalid ARIA properties can make it difficult for users of assistive technologies to understand the purpose of the element.
<a href="#" aria-checked />
<>
<a href="#" aria-expanded />
<div role="heading" aria-level="1" />
</>