✅ The extends: 'recommended'
property in a configuration file enables this rule.
This rule checks for invalid element/role combinations.
Current list of checks:
-
Use of the presentation role for content which should convey semantic information may prevent the user from understanding that content. This rule checks semantic HTML elements for the presence of
role="none"
orrole="presentation"
and compares it to the list of disallowed elements. It should not effect custom elements. -
Use of invalid role for elements which does not fall under any of the values in this list.
This rule forbids the following:
This rule allows the following:
-
boolean -
true
to enable /false
to disable -
object - { 'catchNonexistentRoles' :
true|false
} -- Whether invalid role values should be allowed (defaults totrue
)
- If violations are found, remediation should be planned to replace the semantic HTML with the
div
element. Additional CSS will likely be required.