microsoft / microsoft/TypeScript

Behavior difference: Comment above `@typedef` does not become comment for the corresponding emitted type in tsgo

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

@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

  1. Start a plain new project
    • "@typescript/native-preview": "7.0.0-dev.20260618.1",
    • "typescript": "6.0.3"
  2. Run npx tsgo --init to get the default tsconfig. Turn on these flags as well.
    • "allowJs": true,
    • "checkJs": true,
    • "stableTypeOrdering": true,
  3. Add src/main.js. Run npx tsc & npx tsgo to 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

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.

Đánh giá

Issue này chưa được đánh giá.

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.