Some functions are erroneously listed as returning `undefined`
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript
- 領域
- documentation, tooling
調査の方向性
まず、リンクされた net、buffer、fs、http、sqlite、url のドキュメントページに示されている戻り値の型を、それぞれのソースの説明と比較します。特にコンストラクター、オーバーロード、非同期の破棄メソッド、標準外の説明について、doc-kit が戻り値の情報をどのように正規化するかを追跡します。列挙された例で正確な型が示されるか、ソースが曖昧な場合に型が省略されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
URL:
https://beta.docs.nodejs.org/net.html#blocklistisblocklistvalue
Browser Name:
Firefox, Chrome
Browser Version:
153.0
Operating System:
macOS 15.7.8
How to reproduce the issue:
The new return type annotations are incorrect if a function has a non-standard description of its return value. An illustrative example is BlockList.isBlockList, which incorrectly shows undefined:
A non-exhaustive list of other examples I've found:
- https://beta.docs.nodejs.org/net.html#new-netsocketaddressoptions shows a return type of
voidfrom the constructor - https://beta.docs.nodejs.org/net.html#blocklisttojson
- https://beta.docs.nodejs.org/net.html#socketaddressparseinput (does not list
undefinedas a possible return) - https://beta.docs.nodejs.org/net.html#new-netboundsocketoptions shows a return type of
voidfrom the constructor - https://beta.docs.nodejs.org/buffer.html#new-bufferblobsources-options shows a return type of
voidfrom the constructor - https://beta.docs.nodejs.org/buffer.html#blobbytes
- https://beta.docs.nodejs.org/buffer.html#blobslicestart-end-type
- https://beta.docs.nodejs.org/buffer.html#new-bufferarray (and related constructors)
- https://beta.docs.nodejs.org/buffer.html#new-bufferfilesources-filename-options
- https://beta.docs.nodejs.org/buffer.html#bufferatobdata
- https://beta.docs.nodejs.org/buffer.html#bufferbtoadata
- https://beta.docs.nodejs.org/fs.html#filehandlesymbolasyncdispose should return a
Promise, notvoid - https://beta.docs.nodejs.org/fs.html#dirsymbolasyncdispose also should return a
Promise - https://beta.docs.nodejs.org/fs.html#new-fsutf8streamoptions
- https://beta.docs.nodejs.org/http.html#new-agentoptions
- https://beta.docs.nodejs.org/http.html#httpgetoptions-callback this should return the same type as the alternative overload beneath it (i.e.
http.ClientRequest) - https://beta.docs.nodejs.org/http.html#httprequestoptions-callback also should return
http.ClientRequest - https://beta.docs.nodejs.org/sqlite.html#new-databasesyncpath-options
- https://beta.docs.nodejs.org/url.html#new-urlinput-base
- https://beta.docs.nodejs.org/url.html#new-urlpattern (and variants)
- https://beta.docs.nodejs.org/url.html#urlpatterntestinput-baseurl should return
boolean - https://beta.docs.nodejs.org/url.html#new-urlsearchparams (and variants)
- https://beta.docs.nodejs.org/url.html#urlformaturlobject (should return a
string)
Brian edit: converted these to list items for tracking
Presumably these are issues with the source data, which should be made consistent. But previously the documentation "got away" with it because it didn't try to show this normalised value. In the new documentation, it is probably better to err towards not showing the type in cases where it is not clear, to avoid confusion from mismatches.
Common themes are:
- constructors shown as returning
void - async dispose methods shown as returning
voidinstead ofPromise, as required by the interface - functions with non-standard return text shown as returning
undefined - occasionally functions with multiple possible return types only showing the first option
- some functions which have annotated their return type in the comments instead of in a structured way
- overloaded functions only setting a return type on the last overload
- 主要言語
- JavaScript
- スター
- 65
- フォーク
- 71
- 平均マージ
- 4日 3時間
- マージ済み PR(30日)
- 31
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nodejs/doc-kit のほかの issue
-
難易度 2/5 半日 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
似ている issue
-
bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
open-webui/open-webui#30750 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Mend: dependency security vulnerability untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100