Skip to content

Move to file incorrectly adds import for type available in destination fileΒ #59827

Open
@alexdima

Description

@alexdima

πŸ”Ž Search Terms

move to file self imports

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried
  • I tried in 5.7.0-dev.20240826

⏯ Playground Link

No response

πŸ’» Code

// file _a.ts
export interface ISomething {
}
// file _b.ts
import { ISomething } from './a';

export function func(something: ISomething) {
}

Select func and move it to _a.ts
πŸ› Observe the result:

πŸ™ Actual behavior

// file _a.ts
import { ISomething } from './a'; // <------------------ incorrect import from itself

export interface ISomething {

}
export function func(something: ISomething) {
}

πŸ™‚ Expected behavior

// file _a.ts
export interface ISomething {

}
export function func(something: ISomething) {
}

Additional information about the issue

No response

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions