Skip to content

New Rule: no-empty-alt-text #365

@Pixel998

Description

@Pixel998
Contributor

Rule details

The rule should warn when an image is missing alternate text

What type of rule is this?

Warns about a potential problem

Example code

Example of incorrect code:

![]()
![][ref]

[ref]: image.jpg

Participation

  • I am willing to submit a pull request to implement this rule.

Additional comments

Rationale: Alternate text is important for accessibility and describes the content of an image for people who may not be able to see it.

Activity

moved this to Needs Triage in Triageon May 8, 2025
lumirlumir

lumirlumir commented on May 8, 2025

@lumirlumir
Member

Hi @Pixel998, thanks for opening this issue!

It looks great to me, and I agree that this rule should be implemented as part of the recommended setup.

Interestingly, I’ve actually implemented this rule in my own custom ESLint plugin, eslint-plugin-mark, which I’m currently working on.

So, if you are open to it, and if other team members are also on board with including this rule, would it be alright if I took on this issue?

moved this from Needs Triage to Triaging in Triageon May 8, 2025
Pixel998

Pixel998 commented on May 8, 2025

@Pixel998
ContributorAuthor

Hi @lumirlumir, I've implemented the rule locally. Just need to write the docs and push if it's accepted. Also, I was thinking this rule should primarily focus on Markdown's image alt text. If we want to also check the html alt attribute, it might be best to include that as an optional setting.

nzakas

nzakas commented on May 8, 2025

@nzakas
Member

I think this is a good idea. 👍 Let's let @Pixel998 work on this as they created the issue and indicated interest in implementing it.

moved this from Triaging to Ready to Implement in Triageon May 8, 2025
lumirlumir

lumirlumir commented on May 8, 2025

@lumirlumir
Member

Let's let @Pixel998 work on this as they created the issue and indicated interest in implementing it.

Sounds good. Let's do it.

moved this from Ready to Implement to Complete in Triageon May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @nzakas@lumirlumir@Pixel998

    Issue actions

      New Rule: no-empty-alt-text · Issue #365 · eslint/markdown