Eslint-plugin-vue: Rule proposal: Require alt attribute for image tag

Created on 24 Apr 2018  路  1Comment  路  Source: vuejs/eslint-plugin-vue

Please describe what the rule should do:

Ensure there is a non-empty alt attribute when using the <img> tag.

What category of rule is this? (place an "X" next to just one item)

[X] Enforces code style
[ ] Warns about a potential error
[ ] Suggests an alternate way of doing something
[ ] Other (please specify:)

Provide 2-3 code examples that this rule will warn about:

<img src="path/to/my/src" alt="">

<img src="path/to/my/src">

Most helpful comment

Thanks for posting this proposal @manniL But there is already a dedicated plugin with accessibility rules, that has this rule: https://github.com/maranran/eslint-plugin-vue-a11y/blob/master/docs/rules/alt-text.md

>All comments

Thanks for posting this proposal @manniL But there is already a dedicated plugin with accessibility rules, that has this rule: https://github.com/maranran/eslint-plugin-vue-a11y/blob/master/docs/rules/alt-text.md

Was this page helpful?
0 / 5 - 0 ratings

Related issues

casprwang picture casprwang  路  4Comments

lichnow picture lichnow  路  3Comments

maple-leaf picture maple-leaf  路  3Comments

KristofMorva picture KristofMorva  路  4Comments

prograhammer picture prograhammer  路  3Comments