Skip to content

chore(remark-lint): improve for node core#9016

Open
avivkeller wants to merge 5 commits into
mainfrom
remark-lint-changes
Open

chore(remark-lint): improve for node core#9016
avivkeller wants to merge 5 commits into
mainfrom
remark-lint-changes

Conversation

@avivkeller

@avivkeller avivkeller commented Jul 21, 2026

Copy link
Copy Markdown
Member

Improves the remark-lint package by:

  • Fixing an issue with type validation where it would include comments, code blocks, etc
  • Adding link validation, as mentioned by @aduh95

@avivkeller
avivkeller requested review from a team as code owners July 21, 2026 03:35
Copilot AI review requested due to automatic review settings July 21, 2026 03:35
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodejs-org Ready Ready Preview Jul 26, 2026 2:12am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cursor

cursor Bot commented Jul 21, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Changes are limited to remark-lint tooling and static site markdown link fixes; no runtime, auth, or data-path behavior is modified.

Overview
Adds a node-core:validate-links remark rule that checks root-relative and relative links against site content (pages/en, public, etc.), validates in-document # anchors (including custom HTML ids), and ignores external URLs. The rule ships in the @node-core/remark-lint preset (v1.4.0) with unit tests, and the site enables it via .remarkrc.json with globs that skip non-English pages and routes like /learn and /static.

invalid-type-reference now only runs on prose text / html nodes so {types} inside comments, fenced code, and JSX are no longer flagged.

Several English MD/MDX pages were updated so existing links pass the new checks (e.g. EOL release schedule path, N-API learn URL, branding link, stale /about/* blog links pointed at GitHub, and a missing / on an old release link). Security advisory footers drop redundant /security/ links in favor of the GitHub reporting process. ESLint notes a TODO to extend link validation to translations once routes stay in sync.

Reviewed by Cursor Bugbot for commit e244251. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.86992% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.11%. Comparing base (7dac7d8) to head (e244251).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/remark-lint/src/rules/validate-links.mjs 89.84% 20 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9016      +/-   ##
==========================================
+ Coverage   74.57%   75.11%   +0.53%     
==========================================
  Files         100      102       +2     
  Lines        8803     9109     +306     
  Branches      324      372      +48     
==========================================
+ Hits         6565     6842     +277     
- Misses       2234     2263      +29     
  Partials        4        4              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Comment thread packages/remark-lint/src/index.mjs Outdated
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

📦 Build Size Comparison

Summary

Metric Value
Old Total First Load JS 10.64 MB
New Total First Load JS 10.65 MB
Delta 10.54 KB (+0.10%)

Changes

🔄 Modified Routes (4)
Route Old First Load JS New First Load JS Delta
/[locale] 2.54 MB 2.54 MB 📈 2.63 KB (+0.10%)
/[locale]/[...path] 2.54 MB 2.54 MB 📈 2.63 KB (+0.10%)
/[locale]/blog/[...path] 2.54 MB 2.54 MB 📈 2.63 KB (+0.10%)
/[locale]/download/archive/[version] 2.54 MB 2.54 MB 📈 2.63 KB (+0.10%)

@avivkeller

Copy link
Copy Markdown
Member Author

Bump @nodejs/web-infra

@bmuenzenmeyer bmuenzenmeyer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a cursor concern here Link validator lacks needed options that is perhaps valid. can you validate the real runtime scenarios here? it'd be bad if this resulted in false-positivies

Comment thread packages/remark-lint/src/__tests__/index.test.mjs Outdated
Copilot AI review requested due to automatic review settings July 25, 2026 22:25
@avivkeller
avivkeller requested a review from a team as a code owner July 25, 2026 22:25
@avivkeller
avivkeller requested a review from bmuenzenmeyer July 25, 2026 22:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@avivkeller

Copy link
Copy Markdown
Member Author

Replaced remark-validate-links with our own validator to allow for:

  • Node.js-style slugs
  • Path exclusions

Copilot AI review requested due to automatic review settings July 25, 2026 22:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread packages/remark-lint/package.json
Signed-off-by: Aviv Keller <me@aviv.sh>
Copilot AI review requested due to automatic review settings July 26, 2026 02:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e244251. Configure here.

Comment thread apps/site/.remarkrc.json
"ignoreFiles": ["pages/!(en)/**/*.{md,mdx}"],
"ignoreLinks": ["/learn", "/learn/**/*", "/static/**/*", "/feed/*"]
}
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link ignores never apply

High Severity

validate-links is registered twice with split options: the preset enables it with basePaths but no ignoreFiles/ignoreLinks, while .remarkrc.json adds another instance with only the ignores. Both run, so /learn, /feed, and non-English pages are still flagged by the preset instance, and the remarkrc instance lacks basePaths so valid site routes can fail too.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e244251. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants