Don't require redundant role for <img alt="" />
in require-valid-alt-text
rule
#2954
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.
Closes #2951,
Closes #2190,
Closes #2579,
Closes #2828
This updates the
require-valid-alt-text
rule so that it does not require settingrole="presentation"
orrole="none"
for an<img alt="" />
.Context
After bumping
aria-query
in #2927,ember-template-lint
began reporting an error for the following:The error is from the
no-redundant-role
. I believe it is correct to report an error in this case because<img alt="" />
already implicitly has arole
ofpresentation
.However, this new behavior was in direct conflict with part of the
require-valid-alt-text
rule that required settingrole="presentation"
orrole="none"
whenever an image hasalt=""
. It is valid to set one of these roles but it should not be required. Removing this requirement allows these two rules (no-redundant-role
andrequire-valid-alt-text
) to continue to be used together.