markdown_images_have_alt
Require every live CommonMark image to have non-empty rendered alt text.
Formatted label text counts, while whitespace-only labels do not. Fenced and indented code, inline code syntax, comments, and front matter are excluded by the CommonMark parser. Raw HTML <img> elements are outside this kind's contract. Check-only because useful alternative text requires author intent.
Options
Section titled "Options"This rule takes no kind-specific options.
Plus the common paths, level, id, when, scope_filter, and expect_matches fields. This table is generated from the JSON Schema; option types and defaults are authoritative.
Example
Section titled "Example"A Markdown image without rendered alt text is reported
Section titled "A Markdown image without rendered alt text is reported"The rule fires on this repository:
- README.md
✗ error image-alt
3:1 Markdown image has no alt text
- architecture.svg✓
# Project
<svg/>With this .alint.yml:
version: 1rules: - id: image-alt kind: markdown_images_have_alt paths: "**/*.md" level: erroralint check reports:
--- README.md ------------------------------------------------------------------ x error image-alt 3:1 Markdown image has no alt text
Summary (1 violation): x 1 error 0 passing * 1 failingFormatted image alt text is recognized by the CommonMark parser
Section titled "Formatted image alt text is recognized by the CommonMark parser"This repository is compliant:
- README.md✓
- architecture.svg✓
# Project
``<svg/>With this .alint.yml:
version: 1rules: - id: image-alt kind: markdown_images_have_alt paths: "**/*.md" level: erroralint check reports:
v All 1 rule(s) passed.