link-validation.ts misses several anchors and never fails CI
@stevep0z is already working on this.
Since Sep 4, 2026.
Assessment
This issue has not been assessed yet.
Description
Problem
scripts/link-validation.ts runs on every PR (via lint.yml → pnpm run check) but doesn't actually catch broken links, for two reasons:
- It only recognizes anchors from real Markdown headings and literal
<a id="...">tags. Most anchors on API reference pages come from<APIItem id="...">, which it doesn't parse, so it can't tell if those are broken or fine. - It never sets a non-zero exit code, so even when it does find a broken link, the CI step still reports success. Confirmed live: the "Lint and Format Check" run on PR #233 merged commit passed despite 85 broken anchors in that commit.
On top of that, main has no branch protection (protected: false, no required status checks), so even a correctly-failing check wouldn't block a merge today.
Proposed fix, staged (not a single flip to hard-fail):
- Extend anchor detection to recognize
<APIItem id="...">(and similar components). Keep it non-blocking for now. - Let that surface the real, sitewide baseline of broken links (there are known pre-existing ones outside Cairo 4.x too), and clean those up or snapshot them.
- Only then add the non-zero exit code.
- Add branch protection on main requiring the lint job, once step 3 is trustworthy.
- Doing 3–4 before 1–2 would fail unrelated PRs on pre-existing debt they didn't introduce; hence the order.
- Dominant language
- MDX
- Stars
- 6
- Forks
- 23
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenZeppelin/docs
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OpenZeppelin/docs#134 · 1 comment ·
-
documentation
Difficulty 5/5 Over a week Newbie friendliness 28/100
OpenZeppelin/docs#236 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
OpenZeppelin/docs#231 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
OpenZeppelin/docs#199 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
OpenZeppelin/docs#132 ·