role-has-required-aria-props
Configuration
Rule Details
Elements with ARIA roles must have every required aria-* attribute for that role defined. The required-attributes table is sourced from aria-query's rolesMap.
The rule reads each JSX attribute named role (case-insensitive). When the attribute's value is a literal string, it lowercases the value and splits on single ASCII spaces. For each space-delimited token that is a recognized non-abstract ARIA role with non-empty required attributes, it verifies that every required aria-* attribute is present on the same element. Tokens that are not valid ARIA roles, and roles whose required-attribute set is empty (e.g. button, row), are ignored.
Elements that natively imply the role are skipped. For example, <input type="checkbox"> already provides the checkbox role, so <input type="checkbox" role="switch" /> is not flagged for missing aria-checked.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Rule Options
This rule takes no options.