Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Some functions are erroneously listed as returning `undefined`

Đang mở
#953 11 bình luận 2 reaction 0 người được giao Xem trên GitHub

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ả

downstream help wanted Web Generator
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:

Method with inconsistent return values

A non-exhaustive list of other examples I've found:

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 void instead of Promise, 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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nodejs/doc-kit

Tất cả issue của nodejs/doc-kit

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.