move-ts
move-ts copied to clipboard
Move TS declarations to existing file with import update
Hello there!
This is an ask for new feature not an actual issue.
It would be really helpful to move some TS declarations to already existing files eg. move from a.ts and append to b.ts, and auto update the imports of c.ts.
// (a.ts)
-export type MyType {
- x: string;
- y: boolean;
- z: object;
-}
and append to existing b.ts:
// b.ts
export type OldType {
field: number;
}
+export type MyType {
+ x: string;
+ y: boolean;
+ z: object;
+}
So the imports of c.ts will now become:
// c.ts
- import MyType from "./a.ts"
+ import MyType from "./b.ts"
This is already a built-in feature of VSCode.
Select code, press Ctrl/Cmd+., select "Move to file". All imports everywhere will be updated.