image_alt
<img>
elements must have aalt
attribute, either with meaningful text, or an empty string for decorative imagesUser impact: Serious
This rule supports the following configuration:
- TOML
- Shell
# The `alt` attribute must be present.image_alt = true
# The `alt` attribute must be present.curlylint --rule 'image_alt: true' .
#
Success- TOML
- Shell
<!-- Good: Check alt is present --><!-- image_alt = true --><img src="foo" alt="Foo eating a sandwich." /><!-- Good: Empty alt is fine too --><!-- image_alt = true --><img src="foo" alt="" />
<!-- Good: Check alt is present --><!-- curlylint --rule 'image_alt: true' . --><img src="foo" alt="Foo eating a sandwich." /><!-- Good: Empty alt is fine too --><!-- curlylint --rule 'image_alt: true' . --><img src="foo" alt="" />
#
Fail- TOML
- Shell
<!-- Bad: Missing --><!-- image_alt = true --><img src="foo" />
<!-- Bad: Missing --><!-- curlylint --rule 'image_alt: true' . --><img src="foo" />