Some functions are erroneously listed as returning `undefined`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- documentation, tooling
Hướng nghiên cứu
Bắt đầu bằng cách so sánh các kiểu trả về được hiển thị trên các trang tài liệu net, buffer, fs, http, sqlite và url được liên kết với phần mô tả trong mã nguồn của chúng. Theo dõi cách doc-kit chuẩn hóa thông tin trả về, đặc biệt là các constructor, overload, phương thức giải phóng bất đồng bộ và các mô tả không theo chuẩn. Công việc được xem là hoàn tất khi các ví dụ được liệt kê hiển thị đúng kiểu hoặc lược bỏ kiểu khi nguồn không rõ ràng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- JavaScript
- Star
- 65
- Fork
- 71
- Merge trung bình
- 4 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 31
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nodejs/doc-kit
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Tất cả issue của nodejs/doc-kit
Issue tương tự
-
Update HugeIcons library Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
antfu-collective/icones#398 ·
-
ECmail.com Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
wesbos/burner-email-providers#554 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
radiantearth/stac-browser#1023 ·
-
HMR stops working Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
components-web-app/docs#92 ·