microsoft / microsoft/TypeScript
JSDoc `@private` on constructor without parameters is omitted in declaration files
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Go
- Star
- 111k
- Fork
- 14.4k
- Merge trung bình
- 1 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 117
Mô tả
🔎 Search Terms
jsdoc private constructor
🕗 Version & Regression Information
- This is the behavior in every version I tried back through TS 3.8 where JSDoc support was added, and I reviewed the FAQ for entries about JSDoc
⏯ Playground Link
💻 Code
// foo.js
class Foo {
/**
* @private
*/
constructor() {}
}
new Foo()
// Constructor of class 'Foo' is private and only accessible within the class declaration.(2673)
🙁 Actual behavior
Emits the declaration file:
declare class Foo {
}
🙂 Expected behavior
Should emit the declaration file:
declare class Foo {
/**
* @private
*/
private constructor();
}
Additional information about the issue
I ran into this as it was requested that TypeDoc add a new JSDoc tag to work around this issue. This seems wrong since the declaration file doesn't accurately describe the types within the file, but it's also very unfortunate that it results in the loss of any documentation added to the constructor.
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.
Hướng nghiên cứu
Bắt đầu với bản tái hiện TypeScript Playground được liên kết bằng cách sử dụng foo.js và so sánh tệp khai báo được phát ra với đầu ra mong đợi. Theo dõi cách JSDoc @private của hàm tạo không có tham số được biểu diễn trong quá trình tạo khai báo. Hoàn tất khi .d.ts được phát ra vẫn giữ lại hàm tạo private và tài liệu của nó mà không thay đổi hành vi truy cập hàm tạo được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, typescript
- Lĩnh vực
- compilers
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100