microsoft / microsoft/TypeScript

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

Aperta
#63,846 0 commenti 2 reazioni 2 assegnatari Vedi su GitHub

@DanielRosenwasser ci sta già lavorando.

Dal 23/6/2026.

  • #4412 di @copilot-swe-agent — chiusa senza merge
Bug
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

```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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.