You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
will update all relative import/export specifiers referencing 'someFile.ts' but not if the specifier used an alias such as
import*from'Root/someFile';
I expected ts-morph to update the specifier to import * from 'Root/someDir/someFile'; but it doesn't.
I think it would be nice feature to support this. VSCode can handle paths mapped import/exports when moving files.
tl;dr Add support for module specifier "aliases" (tsconfig.paths mappings) when moving files/folders.
Let's say your tsconfig contains a paths mapping like this:
I noticed that
will update all relative import/export specifiers referencing 'someFile.ts' but not if the specifier used an alias such as
I expected
ts-morph
to update the specifier toimport * from 'Root/someDir/someFile';
but it doesn't.I think it would be nice feature to support this. VSCode can handle paths mapped import/exports when moving files.
Describe the solution you'd like
I think the problem is that
updateStringLiteralReferences(nodeReferences: ReadonlyArray<[StringLiteral, SourceFile]>) {
only updates the module specifier if it's a relative path like'../someFile'
not if it's an module specifier alias like'Root/someFile'
.The text was updated successfully, but these errors were encountered: