Repository navigation
Description
Summary
a11y/image-redundant-alt reports alt="Google Partner Logo" as redundant solely because the image filename is google-partner-logo.svg. The alt identifies the logo correctly; the filename being equally descriptive does not make it redundant for a screen-reader user. There is no adjacent text repeating this alt in the repro.
Minimal repro
Serve this page and a small valid SVG with a local node:http server:
<!doctype html><html lang="en"><head><meta charset="utf-8">
<title>Descriptive partner logo alt fixture</title></head><body><main>
<h1>Certifications</h1>
<img src="google-partner-logo.svg" alt="Google Partner Logo">
</main></body></html>squirrel audit http://127.0.0.1:8765/logo --http --offline --no-publish --refresh -C full -m 20 -f json -o out.jsonActual
{"ruleId":"a11y/image-redundant-alt","name":"image-redundant-alt","status":"warn","message":"1 image(s) with redundant alt text","items":[{"id":"alt=\"Google Partner Logo\" matches filename"}]}Expected
No warning for this descriptive alt. Filename equality after removing spaces/hyphens is insufficient evidence of redundancy. Preserve warnings for filename-like slugs and genuine adjacent-text duplication.
Controls (same versions)
| Markup | Result |
|---|---|
<img src="google-partner-logo.svg" alt="Google Partner Logo"> |
warn — false positive |
<img src="arrow-downwards.svg" alt="arrow-downwards"> |
warn — expected |
<figure><img src="brand.svg" alt="Partner certification"><figcaption>Partner certification</figcaption></figure> |
warn — expected |
<img src="brand.svg" alt="Google Partner certification"> |
no warning — expected |
An alt equal to an arbitrary adjacent span was not flagged in our larger main/nav wrapper; the figcaption control above is the verified adjacent-text positive case.
Version
squirrel 0.0.138 and 0.0.139, Linux arm64, HTTP/offline mode. Reproduced using Overhub's global template; the target rule is enabled and unmodified.
Triage
v0.0.138 packages/rules/src/a11y/image-redundant-alt.ts normalizes both alt and filename with .toLowerCase().replace(/[-_\s]+/g, ""), then reports equality. This turns a human-readable label into a filename match. The filename branch needs to distinguish a readable description from a raw filename/slug; surrounding-text checks should remain separate.
Acceptance Criteria
- The
Google Partner Logofixture produces noimage-redundant-altwarning. - The
arrow-downwardsslug control still warns. - The matching figcaption control still warns.
- The distinct descriptive-alt control still passes.
- Regression tests cover readable alt/filename equality without weakening the existing redundant-prefix and surrounding-text checks.
Activity
nc9 commentedon Oct 29, 2026
Thanks @deniskern, confirmed on current
main.image-redundant-altstrips spaces, hyphens and underscores from both the alt and the filename and flags any match, so a readable label like "Google Partner Logo" reads the same as the sluggoogle-partner-logo. A fix should only flag an alt that looks like a raw slug (no spaces, or the filename verbatim), keeping your controls as the tests. Your acceptance criteria are the spec; queued.fix(rules): count label elements in form-field-multiple-labels, skip …
nc9 commentedon Oct 30, 2026
Fixed in v0.0.142 (1ea94aae), via the stacked release PR #1331.