✅ 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 --
trueindicates all whitelist test will run,falseindicates that the rule is disabled. - object - Containing the following values:
ignoredTags- An array of element tag names that should be whitelisted. 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[].