Skip to content

feat(remark-lint): improve validation#8746

Open
avivkeller wants to merge 3 commits intomainfrom
feat/remark-lint
Open

feat(remark-lint): improve validation#8746
avivkeller wants to merge 3 commits intomainfrom
feat/remark-lint

Conversation

@avivkeller
Copy link
Member

Ref: nodejs/node#62090


Adds deprecation validation based on https://github.com/nodejs/node/blob/main/tools/doc/deprecationCodes.mjs, and allows type validation to work in links (i.e. [<Type>]())

@avivkeller avivkeller requested review from a team as code owners March 18, 2026 23:16
Copilot AI review requested due to automatic review settings March 18, 2026 23:16
@vercel
Copy link

vercel bot commented Mar 18, 2026

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

Project Deployment Actions Updated (UTC)
nodejs-org Ready Ready Preview Mar 18, 2026 11:27pm

Request Review

@github-actions
Copy link
Contributor

👋 Codeowner Review Request

The following codeowners have been identified for the changed files:

Team reviewers: @nodejs/nodejs-website @nodejs/web-infra

Please review the changes when you have a chance. Thank you! 🙏

@codecov
Copy link

codecov bot commented Mar 18, 2026

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
59 1 58 0
View the top 1 failed test(s) by shortest run time
test::src/rules/__tests__/duplicate-stability-nodes.test.mjs
Stack Traces | 0.411s run time
[Error: test failed] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: 'test failed', exitCode: 1, signal: null }

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Copy link
Contributor

Copilot AI left a comment

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 enhances the @node-core/remark-lint API-doc preset to validate deprecation entries and to recognize/normalize type references inside link text.

Changes:

  • Add a new node-core:invalid-deprecations rule (and unit tests) to validate ordering and required metadata blocks in deprecation docs.
  • Update node-core:invalid-type-reference to detect type references via QUERIES.normalizeTypes, including cases like [<Type>]().
  • Bump @node-core/doc-kit dependency (and lockfile) and bump @node-core/remark-lint version to 1.3.0.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pnpm-lock.yaml Updates lockfile for @node-core/doc-kit@1.0.2 and related dependency graph changes.
packages/remark-lint/src/rules/invalid-type-reference.mjs Adjusts type-reference detection and normalization logic to work in more AST contexts (e.g., link text).
packages/remark-lint/src/rules/invalid-deprecations.mjs Introduces a new rule to validate deprecation codes ordering and presence of required sections.
packages/remark-lint/src/rules/tests/invalid-type-reference.test.mjs Adds coverage for miswrapped type references inside link text.
packages/remark-lint/src/rules/tests/invalid-deprecations.test.mjs Adds unit tests for ordering/type/changes validation in deprecations content.
packages/remark-lint/src/api.mjs Registers the new invalid-deprecations rule in the API preset.
packages/remark-lint/package.json Bumps package version and @node-core/doc-kit dependency range.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

You can also share your feedback on Copilot code review. Take the survey.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2026

📦 Build Size Comparison

Summary

Metric Value
Old Total Size 3.51 MB
New Total Size 3.51 MB
Delta 0 B (0.00%)

Changes

➕ Added Assets (1)
Name Size
.next/static/chunks/101d166a55e0d15c.js 208.90 KB
➖ Removed Assets (1)
Name Size
.next/static/chunks/fd7f80a8996e13b2.js 208.90 KB

Signed-off-by: Aviv Keller <me@aviv.sh>
let currentDeprecationCode;

// Get the current deprecation
if (node.type === 'html') {
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain what it really does with? currentDeprecationCode = node.value.match(DEPRECATION_COMMENT)?.[1]; it seems like that's supposed to be when we skip a deprecation note?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. This matches when we skip a deprecation code, and ensures that the code we skip is the next code in line (1, 2, etc).

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.

3 participants