Support resolving different paths from tsonfig files in monorepo
Suggest an idea for Knip
Hello!
I have a project with this sort of structure:
project
│ tsconfig.ts
│
└───src
│ │ tsconfig.ts
│ │
│ └───ui
│ │ tsconfig.ts
│ │ ...
│ └───server
│ │ tsconfig.ts
│ │ ...
│
└───tests
And in every tsconfig file i have some paths set up.
And when I'm using knip it can't resolve it, so i need to specify all of them in paths in knip.json.
I can't use workspaces, cause there is only one package.json.
Maybe there is solution that I can't find?
Would be grateful for any help.
Unfortunately there is not currently.
Maybe the TypeScript plugin should actually return such path aliases now that we have toAlias. Then you could configure Knip like this:
{
"typescript": ["**/tsconfig.json"]
}
For now, an idea: use a dynamic config (i.e. knip.config.ts) and something like https://github.com/privatenumber/get-tsconfig to set the Knip paths config.
Then you could configure Knip like this:
{ "typescript": ["**/tsconfig.json"] }
Unfortunately this approach not working :(
get-tsconfig seems as overkill for me, but maybe i'll try
Thank you!