Skip to content

"Move to file" generates self-import when target file already imports declaration #54309

@DanielRosenwasser

Description

@DanielRosenwasser

Possibly the same as #54307.

basics.ts

export function getHello() {
    return "hello";
}

export function getWorld() {
    return "world";
}

greeting.ts

import { getHello, getWorld } from "./basics";

export function getGreeting() {
    return getHello() + getWorld();
}

Extract getWorld into greeting.ts and this is what it looks like:

import { getHello } from "./basics";
import { getWorld } from "./greeting";

export function getGreeting() {
    return getHello() + getWorld();
}
export function getWorld() {
    return "world";
}

The line import { getWorld } from "./greeting"; should not be present at all

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: LS: Refactoringse.g. extract to constant or function, rename symbol

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions