Skip to content

Move to new file: Moving an import statement may break code #23968

Closed
@ghost

Description

Code

See moveToNewFile_moveImport.ts.

[|import { a, b } from "m";
a;|]
b;

Expected behavior:

The import of b is kept in the original file since it's still needed.

Actual behavior:

The import is wholly removed from the old file, and an extra import is added to the new file for a even though it already has that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions