microsoft / microsoft/TypeScript

`isolatedDeclarations` quick-fix cannot consistently use auto-imports

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

@DanielRosenwasser đang làm issue này rồi.

Từ ngày 23/6/2026.

  • #4412 của @copilot-swe-agent — đã đóng, không merge
Bug
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ả

```ts
// @module: preserve
// @isolatedDeclarations: true

// @Filename: types.ts
export type Thing = {};

// @Filename: funcs.ts
import type { Thing } from "./types";

export function makeThing(): Thing {
throw {};
}

// @Filename: exporter.ts
import { makeThing } from "./funcs";

export let thing = makeThing();
```

The test has `isolatedDeclarations` set to true, so `export let thing` needs an annotation.

Ordinarily, we have a best-effort import adder for `Thing` which works if `Thing` is available through an existing import; but because `exporter.ts` doesn't import `types.ts`, it doesn't work in this case.

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.