Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't require redundant role for <img alt="" /> in require-valid-alt-text rule #2954

Merged

Commits on Aug 9, 2023

  1. fix: Don't require redundant role for <img alt="" />

    Fixes ember-template-lint#2951
    
    This updates the `require-valid-alt-text` rule so that it does not
    *require* setting `role="presentation"` or `role="none"` for an `<img
    alt="" />`.
    
    Context
    
    After bumping `aria-query` in ember-template-lint#2927,
    `ember-template-lint` began reporting an error for the following:
    
    ```html
    <img alt="" role="presentation" />
    ```
    
    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 a `role` of `presentation`.
    
    However, this new behavior was in direct conflict with part of the
    `require-valid-alt-text` rule that required setting
    `role="presentation"` or `role="none"` whenever an image has `alt=""`.
    HeroicEric committed Aug 9, 2023
    Configuration menu
    Copy the full SHA
    e413335 View commit details
    Browse the repository at this point in the history