✅ The extends: 'recommended' property in a configuration file enables this rule.
Adding interactivity to an element that is not naturally interactive content leads to a very poor experience for
users of assistive technology (i.e. screen readers). In order to ensure that screen readers can provide useful information to their users, we should add an appropriate role attribute when the underlying element would not have made that role obvious.
This rule forbids the following:
This rule allows the following:
The following values are valid configuration (same as the no-nested-interactive rule above):
- boolean --
trueindicates all allowlisted tests will run,falseindicates that the rule is disabled. - object - Containing the following values:
ignoredTags- An array of element tag names that should be allowlisted. Default to[].ignoreTabindex- Whentruetabindex will be ignored. Defaults tofalse.ignoreUsemapAttribute- Whentrueignores theusemapattribute onimgandobjectelements. Defaultsfalse.additionalInteractiveTags- An array of element tag names that should also be considered as interactive. Defaults to[].