jsx-eslint / eslint-plugin-jsx-a11y

Static AST checker for a11y rules on JSX elements.
MIT License
3.38k stars 637 forks source link

`alt-text`: missing warning for empty `alt` for `<input type="image" alt="" />` #971

Open EvgenyOrekhov opened 8 months ago

EvgenyOrekhov commented 8 months ago

<input type="image" alt="" /> should be considered invalid because <input> is an interactive element, it can't be "decorative", thus it has to have a non-empty alt.

Note: SonarJS does warn in this case, see "Noncompliant code example" here: https://sonarsource.github.io/rspec/#/rspec/S1077/javascript