Skip to content

Adjust relative imports in TypeScript when using copy-paste #59841

Open

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions