-
Notifications
You must be signed in to change notification settings - Fork 124
chore: enable oxfmt jsdoc feature #757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -76,36 +76,32 @@ export type ClientOptions = { | |||||||||||||
| defaultArgs?: RequestOptions; | ||||||||||||||
| /** Allow to use HTTP2 first. Default is `false` */ | ||||||||||||||
| allowH2?: boolean; | ||||||||||||||
| /** | ||||||||||||||
| * Custom DNS lookup function, default is `dns.lookup`. | ||||||||||||||
| */ | ||||||||||||||
| /** Custom DNS lookup function, default is `dns.lookup`. */ | ||||||||||||||
| lookup?: LookupFunction; | ||||||||||||||
| /** | ||||||||||||||
| * 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 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. | ||||||||||||||
|
Comment on lines
+82
to
+84
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
|
||||||||||||||
| */ | ||||||||||||||
| checkAddress?: CheckAddressFunction; | ||||||||||||||
| connect?: { | ||||||||||||||
| key?: string | Buffer; | ||||||||||||||
| /** | ||||||||||||||
| * A string or Buffer containing the certificate key of the client in PEM format. | ||||||||||||||
| * Notes: This is necessary only if using the client certificate authentication | ||||||||||||||
| * A string or Buffer containing the certificate key of the client in PEM format. Notes: This is necessary only if | ||||||||||||||
| * using the client certificate authentication | ||||||||||||||
| */ | ||||||||||||||
| cert?: string | Buffer; | ||||||||||||||
| /** | ||||||||||||||
| * If `true`, the server certificate is verified against the list of supplied CAs. | ||||||||||||||
| * An 'error' event is emitted if verification fails. | ||||||||||||||
| * Default: `true` | ||||||||||||||
| * If `true`, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if | ||||||||||||||
| * verification fails. Default: `true` | ||||||||||||||
| */ | ||||||||||||||
| 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 | ||||||||||||||
|
||||||||||||||
| * 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| * 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 |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,14 +32,13 @@ export type RequestOptions = { | |||||||||||||
| */ | ||||||||||||||
| stream?: Readable; | ||||||||||||||
| /** | ||||||||||||||
| * A writable stream to be piped by the response stream. | ||||||||||||||
| * Responding data will be write to this stream and callback | ||||||||||||||
| * 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. | ||||||||||||||
|
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. | |
| * 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
AI
Apr 30, 2026
There was a problem hiding this comment.
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.
| * 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'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| * 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor grammar fix: "Defaults is" should be "Default is".
| * 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 |
Copilot
AI
Apr 30, 2026
There was a problem hiding this comment.
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.
| * 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot
AI
Apr 30, 2026
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| * 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. |
Copilot
AI
Apr 30, 2026
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| * 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. |
There was a problem hiding this comment.
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.