Skip to content

fix: use arg_<index> for anonymous doc parameters - #3087

Open
KazariAI wants to merge 1 commit into
npmx-dev:mainfrom
KazariAI:fix/anonymous-doc-parameters
Open

fix: use arg_<index> for anonymous doc parameters#3087
KazariAI wants to merge 1 commit into
npmx-dev:mainfrom
KazariAI:fix/anonymous-doc-parameters

Conversation

@KazariAI

@KazariAI KazariAI commented Jul 28, 2026

Copy link
Copy Markdown

@deno/doc omits name for parameters destructured directly in parameter lists, causing package docs to render undefined as the parameter name. This adds positional fallback names and regression coverage.

The fallback uses arg_<index> because TypeScript uses the same form for unlabeled tuple elements, while the zero-based index keeps multiple anonymous parameters distinct.


This pull request was created with assistance from a code agent.

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Jul 28, 2026 7:38am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Jul 28, 2026 7:38am
npmx-lunaria Ignored Ignored Jul 28, 2026 7:38am

Request Review

@github-actions

Copy link
Copy Markdown

Hello! Thank you for opening your first PR to npmx, @KazariAI! 🚀

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any issues you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. In a few minutes, you’ll be able to see a preview of your changes on Vercel

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
server/utils/docs/format.ts 50.00% 1 Missing and 2 partials ⚠️
server/utils/docs/render.ts 33.33% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Documentation signature formatting now uses shared helpers that support optional and unnamed parameters, generating positional names such as arg_0. Class, interface, and function renderers adopt the helper, with updated types, tests, and a fixture.

Changes

Parameter formatting

Layer / File(s) Summary
Parameter formatting contract
shared/types/deno-doc.ts, server/utils/docs/format.ts, test/unit/server/utils/docs/format.spec.ts
FunctionParam.name is optional; shared helpers format parameter lists and generate indexed fallback names, with tests covering anonymous parameters.
Signature renderer integration
server/utils/docs/render.ts, test/fixtures/esm-sh/doc-nodes/...
Constructors, class methods, interface methods, and the createHighlighter fixture use the centralised parameter-list formatting behaviour.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarises the main change: fallback names for anonymous doc parameters.
Description check ✅ Passed The description matches the change by explaining the anonymous-parameter fallback and added regression coverage.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

2 participants