microsoft / microsoft/TypeScript
Adjust relative imports in TypeScript when using copy-paste
Open
@navya9singh is already working on this.
Since Sep 4, 2024.
Experience Enhancement
Suggestion
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.4k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
When copying an import from a file, it would be nice if pasting it in another file would adjust the path
Copying the import from src/folder1/a.ts:
//@filename: src/folder1/a.ts
import { x } from './b';
It would be very useful if pasting it in src/folder2/a.ts would generate (note how the import path was correctly adjusted):
//@filename: src/folder2/a.ts
import { x } from '../folder1/b';
This will be very useful once we switch to relative imports starting from tomorrow.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.