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
I’m using ts-morph to build a dependency tree of js source files and d.ts files. I want both trees, that’s why I create two separate projects with different settings. For resolving the js tree I need to ignore all d.ts files. Ideally there would be an easy way to disable .d.ts file resolution, but unfortunately there is no such compiler option.
I’ve looked at the resolution host but it only allows to map some paths in a different way. I would need a way to filter them.
Right now I’ve found a solution, but it is quite cumbersome. I’ve used a custom file host which is an instance of RealFileSystemHost but overrides fileExists* and dirExists* methods so I can return false for .d.ts files or node_modules/@types imports. This works, but I think it is not a good solution, especially because RealFileSystemHost is not exported directly and I need to use @ts-morph/common.
Is there any better way to solve this? Maybe adding new methods to the resolution host would be a good approach to filter files and folders.
The text was updated successfully, but these errors were encountered:
I’m using ts-morph to build a dependency tree of js source files and d.ts files. I want both trees, that’s why I create two separate projects with different settings. For resolving the js tree I need to ignore all d.ts files. Ideally there would be an easy way to disable .d.ts file resolution, but unfortunately there is no such compiler option.
I’ve looked at the resolution host but it only allows to map some paths in a different way. I would need a way to filter them.
Right now I’ve found a solution, but it is quite cumbersome. I’ve used a custom file host which is an instance of
RealFileSystemHost
but overridesfileExists*
anddirExists*
methods so I can return false for .d.ts files ornode_modules/@types
imports. This works, but I think it is not a good solution, especially becauseRealFileSystemHost
is not exported directly and I need to use@ts-morph/common
.Is there any better way to solve this? Maybe adding new methods to the resolution host would be a good approach to filter files and folders.
The text was updated successfully, but these errors were encountered: