Skip to content

doc: use @node-core/remark-lint for linting - #62090

Draft
avivkeller wants to merge 5 commits into
nodejs:mainfrom
avivkeller:lint-doc-kit
Draft

doc: use @node-core/remark-lint for linting#62090
avivkeller wants to merge 5 commits into
nodejs:mainfrom
avivkeller:lint-doc-kit

Conversation

@avivkeller

@avivkelleravivkeller commented Mar 3, 2026

Copy link
Copy Markdown
Member

This PR lints the documentation according to https://www.npmjs.com/package/@node-core/remark-lint, the linter which uses doc-kit to lint.

The differences with this linter are:

  • No duplicate stability nodes
  • No invalid types
  • --- instead of ***, like is used in other organization repos
  • Changes must have full URLs and full SHAs
  • Types cannot be separated with a , just a |

CopilotAI review requested due to automatic review settings March 3, 2026 16:08
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/actions
  • @nodejs/crypto
  • @nodejs/http
  • @nodejs/loaders
  • @nodejs/net
  • @nodejs/sqlite
  • @nodejs/test_runner
  • @nodejs/tsc
  • @nodejs/userland-migrations

@nodejs-github-botnodejs-github-bot added build Issues and PRs related to build files or the CI. meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run. labels Mar 3, 2026

CopilotAI 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.

Pull request overview

This PR migrates documentation linting/formatting to @node-core/remark-lint (which leverages doc-kit) and updates the repo to comply with the new lint rules across Markdown and API docs.

Changes:

  • Replace the old tools/lint-md linter with a new tools/doc/lint-md.mjs implementation based on @node-core/remark-lint (including doc/api-specific linting).
  • Rewire make lint-md / make format-md and related dependency installation to use tools/doc.
  • Apply remark-lint-driven formatting updates across documentation (e.g., type union formatting, horizontal rules, changelog metadata formatting).

Reviewed changes

Copilot reviewed 23 out of 38 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
vcbuild.batUpdates Windows build/lint flow to use doctools for Markdown lint/format.
tools/lint-md/package.jsonRemoves legacy Markdown linter package definition.
tools/lint-md/package-lock.jsonRemoves legacy Markdown linter lockfile.
tools/lint-md/lint-md.mjsRemoves legacy Markdown lint/format script.
tools/doc/package.jsonAdds dependencies required for new remark-lint-based Markdown linting.
tools/doc/list-released-versions-from-changelogs.mjsRefactors released-version extraction into an exported helper for linting.
tools/doc/lint-md.mjsAdds new Markdown lint/format entrypoint using @node-core/remark-lint (+ API rules).
doc/type-map.jsonUpdates type map entries to satisfy new API lint rules.
doc/contributing/releases.mdReplaces *** separators with --- per remark-lint expectations.
doc/contributing/collaborator-guide.mdReplaces *** separators with --- per remark-lint expectations.
doc/changelogs/CHANGELOG_V15.mdReplaces *** separators with --- per remark-lint expectations.
doc/changelogs/CHANGELOG_V12.mdReplaces *** separators with --- per remark-lint expectations.
doc/changelogs/CHANGELOG_IOJS.mdReplaces *** separators with --- per remark-lint expectations.
doc/api/util.mdNormalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/url.mdNormalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/test.mdNormalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/sqlite.mdNormalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/quic.mdNormalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/process.mdNormalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/modules.mdNormalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/inspector.mdAdjusts content to satisfy updated doc linting rules (e.g., stability nodes).
doc/api/https.mdNormalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/http.mdNormalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/errors.mdUpdates changelog YAML metadata (full commit SHA requirement).
doc/api/dns.mdNormalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/diagnostics_channel.mdNormalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/deprecations.mdReformats multi-PR YAML metadata into separate entries per lint rules.
doc/api/crypto.mdNormalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/buffer.mdNormalizes union type formatting ({a|b}) to satisfy lint rules.
doc/README.mdReplaces *** separators with --- per remark-lint expectations.
MakefilePoints lint-md / format-md targets to tools/doc/lint-md.mjs and doctools deps.
CHANGELOG.mdReplaces *** separators with --- per remark-lint expectations.
.github/workflows/test-macos.ymlRemoves path trigger references to removed tools/lint-md.
.github/workflows/linters.ymlRemoves the old “get released versions” step for the prior linter flow.
.github/workflows/coverage-windows.ymlRemoves path trigger references to removed tools/lint-md.
.github/workflows/build-tarball.ymlRemoves path trigger references to removed tools/lint-md.
.github/dependabot.ymlRemoves dependabot updates for the removed tools/lint-md package.
Comments suppressed due to low confidence (1)

.github/workflows/linters.yml:139

  • The workflow removes the get-released-versions step, but the "Lint markdown files" step still sets NODE_RELEASED_VERSIONS from steps.get-released-versions.outputs.... This reference will be undefined and should be removed or replaced (the new markdown linter now computes released versions itself).
 - name: Lint markdown files
run: |
echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json"
NODE=$(command -v node) make lint-md
env:
NODE_RELEASED_VERSIONS: ${{ steps.get-released-versions.outputs.NODE_RELEASED_VERSIONS }}
lint-nix:

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadvcbuild.bat
Comment threadvcbuild.bat
@avivkelleravivkeller added the doc Issues and PRs related to the documentations. label Mar 3, 2026
@avivkeller

avivkeller commented Mar 3, 2026

Copy link
Copy Markdown
MemberAuthor

This uses overrides right now to ensure that doc-kit is always using the same version, but once nodejs/admin#1046 allows us to publish doc-kit, we can make it a more broad dependency in remark-lint

Comment on lines +2651 to +2653
- version: v11.0.0
pr-url: https://github.com/nodejs/node/pull/23017
description: Runtime deprecation.

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.

This doesn't seem right, the API was not runtime deprecated in Node.js 11.0.0

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

That's because this API was runtime deprecated, and had it's deprecation revoked in the same version

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.

I know that, I'm saying it's going to be confusing for readers to document a runtime deprecation that was never released

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I see, what would you recommend?

@codecov

codecovBot commented Mar 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.65%. Comparing base (6a3d358) to head (beef4ea).
⚠️ Report is 1566 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #62090 +/- ##
==========================================
+ Coverage 89.58% 89.65% +0.07% 
==========================================
Files 674 676 +2 Lines 205159 206328 +1169 Branches 39352 39528 +176 ==========================================
+ Hits 183792 184986 +1194 + Misses 13583 13484 -99 - Partials 7784 7858 +74 

see 147 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aduh95

Copy link
Copy Markdown
Contributor

Can we make it catch things like #62100?

@avivkelleravivkeller added the blocked PRs that are blocked by other issues or PRs. label Mar 4, 2026
@avivkeller

avivkeller commented Mar 4, 2026

Copy link
Copy Markdown
MemberAuthor

Will do! (Also, this is blocked by #62139)

@avivkelleravivkeller removed the blocked PRs that are blocked by other issues or PRs. label Mar 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

@avivkelleravivkeller added the blocked PRs that are blocked by other issues or PRs. label Aug 6, 2026
@avivkeller
avivkeller marked this pull request as draft August 6, 2026 01:31
@avivkeller

Copy link
Copy Markdown
MemberAuthor

Not stale! Just on hold until doc-kit packages are named

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

Labels

blockedPRs that are blocked by other issues or PRs.buildIssues and PRs related to build files or the CI.docIssues and PRs related to the documentations.metaIssues and PRs related to the general management of the project.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@avivkeller@nodejs-github-bot@aduh95@anonrig@cjihrig@AugustinMauroy