microsoft / microsoft/TypeScript
Behavior difference: Comment above `@typedef` does not become comment for the corresponding emitted type in tsgo
Đang mở
@jakebailey đang làm issue này rồi.
Từ ngày 18/6/2026.
- #4365 của @copilot-swe-agent — đã đóng, không merge
- Ngôn ngữ chính
- Go
- Star
- 111k
- Fork
- 14.3k
- Merge trung bình
- 2 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 132
Mô tả
Another follow-up on https://github.com/microsoft/typescript-go/issues/4235.
Steps to reproduce
- Start a plain new project
- "@typescript/native-preview": "7.0.0-dev.20260618.1",
- "typescript": "6.0.3"
- Run
npx tsgo --initto get the default tsconfig. Turn on these flags as well.- "allowJs": true,
- "checkJs": true,
- "stableTypeOrdering": true,
- Add
src/main.js. Runnpx tsc&npx tsgoto see the difference.
/**
* Comment on the `Foo` type
*
* @typedef {Object} Foo
* @property {boolean} bool Whether `.bool` is true or not
*/
Behavior with typescript@6.0
/**
* Comment on the `Foo` type
*/
export type Foo = {
/**
* Whether `.bool` is true or not
*/
bool: boolean;
};
Behavior with tsgo
export type Foo = {
/**
* Whether `.bool` is true or not
*/
bool: boolean;
};
/**
* Comment on the `Foo` type
*
* @typedef {Object} Foo
* @property {boolean} bool Whether `.bool` is true or not
*/
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.
Đánh giá
Issue này chưa được đánh giá.