✅ The extends: 'recommended'
property in a configuration file enables this rule.
Usage of nested, interactive content can lead to UX problems, accessibility problems, bugs, and in some cases DOM errors. You should not put interactive content elements nested inside other interactive content elements. Instead of using nested interactive content elements, you should separate them, or use styling on a single element.
This rule forbids the following (button nested inside a link):
This rule allows the following (link with button styling):
The following values are valid configuration:
- 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[]
.