Create a lint rule that restricts aria-label
or aria-labelledby
usage based on tag
#54
Labels
aria-label
or aria-labelledby
usage based on tag
#54
We should never allow
aria-label
oraria-labelledby
on roles that do not support it. I've noticed instances of<Text aria-label>
and<Box aria-label>
in the codebase, which should be flagged.I think we could flag inappropriate aria-label misuse based on what the as is set as, the
role
, and the default tag for the component.Examples of what should be flagged:
eslint-plugin-jsx-a11y
has limited support for linting (polymorphic) components so unfortunately we aren't getting the a11y linting we need. We could get around this with a custom rule in this plugin.The text was updated successfully, but these errors were encountered: