✅ 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 --
true
indicates all whitelist test will run,false
indicates that the rule is disabled. - object - Containing the following values:
ignoredTags
- An array of element tag names that should be whitelisted. Default to[]
.ignoreTabindex
- Whentrue
tabindex will be ignored. Defaults tofalse
.ignoreUsemapAttribute
- Whentrue
ignores theusemap
attribute onimg
andobject
elements. Defaultsfalse
.additionalInteractiveTags
- An array of element tag names that should also be considered as interactive. Defaults to[]
.