Skip to content

chore: enable oxfmt jsdoc feature#757

Merged
fengmk2 merged 1 commit intomasterfrom
enable-oxfmt-jsdoc
Apr 30, 2026
Merged

chore: enable oxfmt jsdoc feature#757
fengmk2 merged 1 commit intomasterfrom
enable-oxfmt-jsdoc

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Apr 30, 2026

https://oxc.rs/docs/guide/usage/formatter/config-file-reference.html#jsdoc

Summary by CodeRabbit

  • Documentation

    • Reformatted JSDoc comments across multiple files for improved clarity and consistency.
  • Chores

    • Updated code formatting configuration to enforce consistent documentation block formatting standards.

Copilot AI review requested due to automatic review settings April 30, 2026 01:22
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8cf22687-65b2-44f5-93b5-67467616563b

📥 Commits

Reviewing files that changed from the base of the PR and between df29cb0 and 3e3add7.

📒 Files selected for processing (5)
  • src/HttpClient.ts
  • src/Request.ts
  • src/Response.ts
  • src/index.ts
  • vite.config.ts

📝 Walkthrough

Walkthrough

JSDoc comments across TypeScript type definition files were reflowed and reformatted to improve readability and text wrapping consistency. Additionally, the Vite configuration was updated to enforce a JSDoc formatting preference for code blocks.

Changes

Cohort / File(s) Summary
JSDoc Comment Formatting
src/HttpClient.ts, src/Request.ts, src/Response.ts, src/index.ts
Reformatted and reflowed JSDoc comment text within type definitions (ClientOptions, RequestOptions, RawResponseWithMeta, UrllibRequestOptions, Timing) to improve line wrapping and readability. No type signatures, exported entities, or runtime logic were altered.
Build Configuration
vite.config.ts
Added jsdoc.preferCodeFences: true setting to the fmt section to standardize JSDoc code block formatting during format operations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A hop through the comments, so neat and so clean,
Where fences now stand where code blocks have been,
Each JSDoc line-break now perfectly placed,
No logic was harmed—just the prose was embraced! 📝

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: enabling oxfmt's JSDoc formatting feature in vite.config.ts while reformatting existing JSDoc comments across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch enable-oxfmt-jsdoc

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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 30, 2026

Open in StackBlitz

npm i https://pkg.pr.new/node-modules/urllib@757

commit: 3e3add7

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.65%. Comparing base (df29cb0) to head (3e3add7).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #757   +/-   ##
=======================================
  Coverage   94.65%   94.65%           
=======================================
  Files          10       10           
  Lines         730      730           
  Branches      228      228           
=======================================
  Hits          691      691           
  Misses         36       36           
  Partials        3        3           

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

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

Copy link
Copy Markdown

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

Enables oxfmt’s JSDoc formatting feature in the repo’s vp formatter configuration and applies the resulting JSDoc reflow/normalization across several TypeScript source files.

Changes:

  • Add fmt.jsdoc.preferCodeFences to the formatter configuration.
  • Reflow/normalize multiple JSDoc blocks in src/ (line wrapping, tag formatting, block style).
  • Minor doc-comment consolidation for timing/docs references.

Reviewed changes

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

Show a summary per file
File Description
vite.config.ts Enables oxfmt JSDoc formatting behavior via fmt.jsdoc config.
src/index.ts Reflows JSDoc for rejectUnauthorized option.
src/Response.ts Normalizes JSDoc blocks and tags (timing reference, deprecation docs).
src/Request.ts Reflows many option JSDocs; introduces a few readability/grammar/link-wrapping issues to fix.
src/HttpClient.ts Reflows option JSDocs; introduces minor wording/casing issues to fix.

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

Comment thread src/Request.ts
Comment on lines +119 to +120
* Auto retry times on 5xx response, default is `0`. Don't work on streaming request It's not supported by using retry
* and writeStream, because the retry request can't stop the stream which is consuming.
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

This JSDoc became a run-on sentence after reflow: "Don't work on streaming request It's not supported...". Add punctuation (e.g., a period after "request") so the two sentences are properly separated.

Copilot uses AI. Check for mistakes.
Comment thread src/Request.ts
Comment on lines +131 to +132
* Auto retry times on socket error, default is `1`. Don't work on streaming request It's not supported by using retry
* and writeStream, because the retry request can't stop the stream which is consuming.
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

This JSDoc also reads as a run-on sentence after reflow: "Don't work on streaming request It's not supported...". Add punctuation between these sentences for readability.

Copilot uses AI. Check for mistakes.
Comment thread src/HttpClient.ts
Comment on lines +82 to +84
* Check request address to protect from SSRF and similar attacks. It receive two arguments(ip and family) and should
* return true or false to identified the address is legal or not. It rely on lookup and have the same version
* requirement.
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

In this public API doc comment, "It receive" / "to identified" are grammatically incorrect. Since this block was reformatted, please update the wording (e.g., "It receives..." / "to identify...") to keep generated docs professional and clear.

Suggested change
* Check request address to protect from SSRF and similar attacks. It receive two arguments(ip and family) and should
* return true or false to identified the address is legal or not. It rely on lookup and have the same version
* requirement.
* Check request addresses to protect from SSRF and similar attacks. It receives two arguments (ip and family) and
* should return true or false to identify whether the address is legal. It relies on lookup and has the same
* version requirement.

Copilot uses AI. Check for mistakes.
Comment thread src/HttpClient.ts
rejectUnauthorized?: boolean;
/**
* socketPath string | null (optional) - Default: null - An IPC endpoint, either Unix domain socket or Windows named pipe
* SocketPath string | null (optional) - Default: null - An IPC endpoint, either Unix domain socket or Windows named
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

The JSDoc refers to "SocketPath" (capital S), but the actual option is socketPath. Using the exact property name in the comment will avoid confusion when users search docs for this option.

Suggested change
* SocketPath string | null (optional) - Default: null - An IPC endpoint, either Unix domain socket or Windows named
* socketPath string | null (optional) - Default: null - An IPC endpoint, either Unix domain socket or Windows named

Copilot uses AI. Check for mistakes.
Comment thread src/Request.ts
Comment on lines +35 to 36
* A writable stream to be piped by the response stream. Responding data will be write to this stream and callback
* will be called with data set null after finished writing.
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

The JSDoc sentence reads ungrammatically: "Responding data will be write". Since this block was reformatted, consider fixing it to "will be written" (and adjust wording as needed) to keep the public API docs clear.

Suggested change
* A writable stream to be piped by the response stream. Responding data will be write to this stream and callback
* will be called with data set null after finished writing.
* A writable stream to which the response stream will be piped. Response data will be written to this stream, and the
* callback will be called with `data` set to `null` after writing finishes.

Copilot uses AI. Check for mistakes.
Comment thread src/Request.ts
Comment on lines +53 to 55
* Type of response data. Could be text or json. If it's text or html, the callbacked data would be a String. If it's
* json, the data of callback would be a parsed JSON Object and will auto set Accept: 'application/json' header.
* Default is 'buffer'.
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

In this JSDoc, "callbacked" is not correct English (should be something like "callback" / "returned" / "passed to the callback"). Since this comment was reformatted, please correct the wording for clarity.

Suggested change
* Type of response data. Could be text or json. If it's text or html, the callbacked data would be a String. If it's
* json, the data of callback would be a parsed JSON Object and will auto set Accept: 'application/json' header.
* Default is 'buffer'.
* Type of response data. Could be text or json. If it's text or html, the data passed to the callback will be a
* string. If it's json, the data passed to the callback will be a parsed JSON object and will auto set Accept:
* 'application/json' header. Default is 'buffer'.

Copilot uses AI. Check for mistakes.
Comment thread src/Request.ts
Comment on lines +93 to +94
* See [MDN: HTTP - Headers - Keep-Alive
* directives](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Keep-Alive#directives) for more details.
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

The markdown link text is split across lines inside the [...] label. Some JSDoc/Markdown renderers don’t handle newlines in link labels well, which can break the rendered link text. Consider rewrapping so the line break happens outside the link label (or shorten the label) while keeping the URL intact.

Suggested change
* See [MDN: HTTP - Headers - Keep-Alive
* directives](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Keep-Alive#directives) for more details.
* See [MDN: HTTP - Headers - Keep-Alive directives](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Keep-Alive#directives)
* for more details.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request reformats JSDoc comments across several files and updates the Vite configuration to prefer code fences in JSDoc. The review feedback identifies several grammatical errors, run-on sentences, and incorrect property name capitalizations that occurred during the reformatting process, providing specific suggestions to improve the clarity and technical accuracy of the documentation.

Comment thread src/HttpClient.ts
Comment on lines +82 to +84
* Check request address to protect from SSRF and similar attacks. It receive two arguments(ip and family) and should
* return true or false to identified the address is legal or not. It rely on lookup and have the same version
* requirement.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The re-wrapped JSDoc contains several grammatical errors that affect clarity: "It receive" should be "It receives", "identified" should be "identify", and "It rely" should be "It relies". Additionally, adding a space between "arguments" and the parenthesis improves readability.

Suggested change
* Check request address to protect from SSRF and similar attacks. It receive two arguments(ip and family) and should
* return true or false to identified the address is legal or not. It rely on lookup and have the same version
* requirement.
* Check request address to protect from SSRF and similar attacks. It receives two arguments (ip and family) and
* should return true or false to identify whether the address is legal or not. It relies on lookup and has the same
* version requirement.

Comment thread src/HttpClient.ts
Comment on lines +100 to +101
* SocketPath string | null (optional) - Default: null - An IPC endpoint, either Unix domain socket or Windows named
* pipe
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The formatter capitalized socketPath to SocketPath. Since this refers to a specific property name, it should remain lowercase. Wrapping it in backticks will prevent the formatter from capitalizing it and clearly identify it as a technical term.

Suggested change
* SocketPath string | null (optional) - Default: null - An IPC endpoint, either Unix domain socket or Windows named
* pipe
* `socketPath` string | null (optional) - Default: null - An IPC endpoint, either Unix domain socket or Windows
* named pipe

Comment thread src/Request.ts
Comment on lines +59 to +60
* Urllib default use URLSearchParams to stringify form data which don't support nested object, will use qs instead of
* URLSearchParams to support nested object by set this option to true.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This sentence is a run-on and contains grammatical errors ("default use", "don't support nested object"). Improving the structure makes the documentation much clearer.

Suggested change
* Urllib default use URLSearchParams to stringify form data which don't support nested object, will use qs instead of
* URLSearchParams to support nested object by set this option to true.
* Urllib by default uses URLSearchParams to stringify form data, which doesn't support nested objects. Set this
* option to true to use `qs` instead of URLSearchParams to support nested objects.

Comment thread src/Request.ts
/**
* Request timeout in milliseconds for connecting phase and response receiving phase.
* Defaults is `5000`, both are 5 seconds. You can use timeout: 5000 to tell urllib use same timeout on two phase or set them separately such as
* Request timeout in milliseconds for connecting phase and response receiving phase. Defaults is `5000`, both are 5
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Minor grammar fix: "Defaults is" should be "Default is".

Suggested change
* Request timeout in milliseconds for connecting phase and response receiving phase. Defaults is `5000`, both are 5
* Request timeout in milliseconds for connecting phase and response receiving phase. Default is `5000`, both are 5

Comment thread src/Request.ts
/** Username:password used in HTTP Digest Authorization. */
digestAuth?: string;
/** follow HTTP 3xx responses as redirects. defaults to true. */
/** Follow HTTP 3xx responses as redirects. defaults to true. */
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Capitalize "Defaults" for consistency with the start of the sentence.

Suggested change
/** Follow HTTP 3xx responses as redirects. defaults to true. */
/** Follow HTTP 3xx responses as redirects. Defaults to true. */

Comment thread src/Request.ts
Comment on lines +119 to +120
* Auto retry times on 5xx response, default is `0`. Don't work on streaming request It's not supported by using retry
* and writeStream, because the retry request can't stop the stream which is consuming.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The formatter merged two sentences without punctuation, creating a run-on sentence. Adding a period and fixing the grammar ("Don't" to "Doesn't", "request" to "requests") improves readability.

Suggested change
* Auto retry times on 5xx response, default is `0`. Don't work on streaming request It's not supported by using retry
* and writeStream, because the retry request can't stop the stream which is consuming.
* Auto retry times on 5xx response, default is `0`. Doesn't work on streaming requests. It's not supported when
* using retry and writeStream, because the retry request can't stop the stream which is consuming.

Comment thread src/Request.ts
Comment on lines +131 to +132
* Auto retry times on socket error, default is `1`. Don't work on streaming request It's not supported by using retry
* and writeStream, because the retry request can't stop the stream which is consuming.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The formatter merged two sentences without punctuation, creating a run-on sentence. Adding a period and fixing the grammar ("Don't" to "Doesn't", "request" to "requests") improves readability.

Suggested change
* Auto retry times on socket error, default is `1`. Don't work on streaming request It's not supported by using retry
* and writeStream, because the retry request can't stop the stream which is consuming.
* Auto retry times on socket error, default is `1`. Doesn't work on streaming requests. It's not supported when
* using retry and writeStream, because the retry request can't stop the stream which is consuming.

@fengmk2 fengmk2 merged commit b4b1a14 into master Apr 30, 2026
23 checks passed
@fengmk2 fengmk2 deleted the enable-oxfmt-jsdoc branch April 30, 2026 07:38
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