Give invalid yet still useful role="text"
an ESLint exemption
#3443
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This deletes a couple of ESLint disable rules in
productOption
andhero.tsx
which was allowingrole="text"
to be used.role="text"
helps screen readers to understand that elements are all part of a single piece of text that should be read in one go. Here is an example by Open Inclusion:It was considered for inclusion in ARIA1.1 back in 2017 but didn't make the cut and has lived in a kind of limbo ever since. It has some browser support, and in leu of something better is still used to improve the screen reader experience. As a result an
allowedInvalidRoles
option was added to the ESLint aria-role rule last December. The full rule details can be read here.TL;DR: We don't need to make a special exception for
role="text"
because ESLint now accommodates it.