Skip to content

Alias import is moved incorrectly when moving code to another file #59798

Closed
@alexdima

Description

@alexdima
// @filename: src/_producer.ts
export function doit() {}
// @filename: src/_consumer.ts
import { doit as doit2 } from "./_producer";

class Another {}

class Consumer {
    constructor() {
        doit2();
    }
}

Doing move to a new file on Consumer generates the following 🐛 (note how doit2 does not exist in _producer.ts):

// @filename: src/Consumer.ts
import { doit2 } from "./_producer";

class Consumer {
    constructor() {
        doit2();
    }
}

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions