img-req-alt
An <img>
without an alt attribute is essentially invisible to assistive/accessibility technology (i.e. screen readers). In order to ensure that screen readers can provide useful information, we need to ensure that all <img>
elements have an alt attribute specified.
Options
Possible values :
true
: Eachimg
tag must have a non-emptyalt
property."allownull"
: Eachimg
tag must have analt
property with a value, but value may be null (equal to""
). ⚠️ consider not using this setting as it's bad for accessibility, userole="presentation" instead
false
: No restriction
The following patterns are considered violations:
<img src="cat.png">
The following patterns are not considerd violations:
<img src="cat.png" alt="picture of cat">