microsoft / microsoft/TypeScript

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

Open
#63,846 0 comments 2 reactions 2 assignees View on GitHub

@DanielRosenwasser is already working on this.

Since Jun 23, 2026.

  • #4412 by @copilot-swe-agent — closed without merging
Bug
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

// @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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.