All rules

Image without alt text

image-alt-texton by defaultJapanese / English

An image with no alt text, as in "![](chart.png)"

Example

Flagged
Sales from April to June. ![](sales.png)
What chaff prints
3:1 Image "![](sales.png)" has no alt text
Fixed
Sales from April to June. ![Sales from April to June](sales.png)
What chaff prints
no finding

How to fix

Write what the image shows in a few words ("![Sales by month, April](chart.png)"). If it is decoration, write alt="" in HTML so screen readers skip it.

Why it matters

When an image does not load, or a screen reader reads the page, the alt text is all that stands in for it. With an empty one ("![](chart.png)") the reader cannot tell what was there. An HTML <img> is reported only when it has no alt attribute; alt="" says the image is decoration and is not counted (as markdownlint's MD045).

What it does not flag

An HTML image with alt="" is marked as decoration and is not reported, nor is an image in a quotation (>) or in code.

Turning it off or relaxing it

Silence this one spot (in the document)
<!-- stet: image-alt-text — reason -->
Relax it for the team (the reason is kept as a comment in chaff.yaml)
npx chaffjs relax image-alt-text --why "reason"
Turn it off for the team (chaff.yaml)
rules: image-alt-text: off
Technical details
Layer
L1
Status
stable
Severity
warning
Languages
Japanese and English
Suited to
business, technical, blog, legal, docs, academic, literature, speech
Reads from the document
markdown

Levels

Set a level for this rule under rules in chaff.yaml. With nothing set, it runs at the level its genre gives it (see By genre below).

stricterror
normalwarning
relaxedinfo

This rule has no limit to count to. A level sets how a finding is marked: relaxed keeps the finding and marks it a step lower.

By genre

Runs by default in
technical/spec, technical/readme, blog/tech, blog/essay, blog/owned-media, business/proposal, business/report, business/email, business/press-release, business/meeting-notes, legal/contract, legal/statute, legal/judgment, legal/patent, docs/manual, docs/faq, docs/glossary, academic/paper, literature/fiction, literature/essay, literature/poetry, literature/play, speech/address, speech/transcript

Genres

Message

Image "{image}" has no alt text

This page is built from the rule's definition file:packages/chaff/rules/image-alt-text.yaml