fix: pin en-US locale in builtin MDN type links - #997
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview
MDN URLs without a fragment (e.g. Reviewed by Cursor Bugbot for commit 81a7c16. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 55c8508. Configure here.
There was a problem hiding this comment.
Pull request overview
Pins the en-US locale for MDN URLs in the builtin type link map when those URLs include hash fragments, avoiding locale-based redirects that can translate heading IDs and break in-page anchor navigation.
Changes:
- Updated builtin MDN type links with hash fragments to use
https://developer.mozilla.org/en-US/...URLs. - Added a changeset describing the user-facing fix and rationale.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/core/src/generators/metadata/maps/builtin.json | Pins en-US on MDN URLs with fragments so anchor hashes remain stable across locales. |
| .changeset/mdn-type-link-locale.md | Adds release notes for the locale-pinning fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #997 +/- ##
=======================================
Coverage 89.60% 89.60%
=======================================
Files 197 197
Lines 18418 18418
Branches 1724 1724
=======================================
Hits 16503 16503
Misses 1908 1908
Partials 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|

Description
MDN URLs without a locale prefix get redirected to the visitor's preferred language, where heading anchor IDs are translated (e.g.
#number_typebecomes#number_类型). The original hash fragment no longer matches any anchor after the redirect, so type links fail to jump to the target section.Pin the
en-USlocale on all MDN links that carry a hash fragment in the builtin type map, so the anchors resolve consistently.Validation
Related Issues
Check List
node --run testand all tests passed.node --run format:check&node --run lint.