Skip to content

roleSupportedAriaProps

Reports ARIA properties that are not supported by an element's role.

✅ This rule is included in the jsx logical and logicalStrict presets.

Elements with ARIA roles should only use ARIA properties that are supported by that role. Each ARIA role has a specific set of supported properties defined in the WAI-ARIA specification. Using ARIA properties that are not supported by a role can confuse assistive technologies and lead to unexpected behavior.

For example, the checkbox role supports properties like aria-checked and aria-required, but not aria-selected. Similarly, the button role supports aria-pressed and aria-expanded, but not aria-checked.

This is required for WCAG 4.1.2 compliance.

<
any
div
role: string
role
="button"
aria-checked: string
aria-checked
="true" />
<
any
div
role: string
role
="link"
aria-selected: string
aria-selected
="true" />
<
any
button
aria-checked: string
aria-checked
="false" />

If you use a framework that automatically changes ARIA properties from custom invalid ones to correct roles, you might need to disable this rule.

Made with ❤️‍🔥 around the world by the Flint team and contributors.