base / base/docs

lint-mdx.js: false-positive missing-alt warning for multi-line <img> tags

Open
#1,792 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
337
Forks
792
Avg merge
17h 23m
Merged PRs (30d)
49

Description

## Description
The alt-attribute check in scripts/lint-mdx.js (inside checkMintlifyComponents) only inspects the single line containing tag's attributes are spread across multiple lines (a common JSX style used throughout docs/), an alt= attribute on a later line is never seen, and the linter reports a false-positive "should have alt attribute" warning.

## Evidence
Running node scripts/lint-mdx.js all on current master reports 5 such warnings, all false positives - each file already has a valid alt:

- docs/base-account/improve-ux/sponsor-gas/paymasters.mdx:33 and :57
- docs/base-account/reference/ui-elements/brand-guidelines.mdx:128 and :156
- docs/snippets/BasePayButton.mdx:21

Example from paymasters.mdx - the img tag spans multiple lines with alt="Paymaster CDP" set on its own line, not on the same line as the opening until the tag closes, matching the multi-line lookback pattern already used by the adjacent Frame-wrapping check in the same function. Verified against synthetic missing-alt and multi-line-with-alt cases to confirm real violations are still caught.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.