Skip to content

[BUG] require-img-alt should allow empty value #424

@duhem-s

Description

@duhem-s

Describe the bug

The require-img-alt rule incorrectly flags empty alt attributes (alt="") as invalid. According to accessibility guidelines (WCAG 2.1 SC 1.1.1 and RGAA 4.1 Criterion 1.1), an empty alt is the recommended approach for decorative images (e.g., icons, spacers, or purely visual elements).

To Reproduce

Feedback is based on documentation : https://html-eslint.org/docs/rules/require-img-alt

Expected behavior

The rule should not report errors for alt="".

Additional context

Empty alt attributes ensure screen readers skip decorative images, improving UX for assistive tech users.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions