Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alexdima opened this issue Sep 2, 2024 · 0 comments Β· May be fixed by #61107
Open

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

alexdima opened this issue Sep 2, 2024 · 0 comments Β· May be fixed by #61107
Assignees
Labels
Bug A bug in TypeScript

Comments

@alexdima
Copy link
Member

alexdima commented Sep 2, 2024

πŸ”Ž 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

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Sep 6, 2024
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 5.7.0 milestone Sep 6, 2024
@navya9singh navya9singh linked a pull request Feb 3, 2025 that will close this issue
@navya9singh navya9singh linked a pull request Feb 3, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants