🐛 Knip module resolution doesn't take account of TypeScript rootDirs
from referenced project
#873
Open
6 tasks done
Labels
bug
Something isn't working
Prerequisites
Reproduction url
https://github.com/pawelblaszczyk5/knip-root-dirs-repro
Reproduction access
Description of the issue
Hello 👋
In one of my monorepos, where I use Knip I'm migrating from Remix to React Router. They're using
rootDirs
from TypeScript for some funky typesafety codegen stuff. I'm also using project references to split up settings for e.g. tests and app code. While importing from this "magically" mapped stuff I'm getting "unresolved imports" errors.In my reproduction you can see these behaviours:
pnpm knip
fails withunresolved imports
errorpnpm knip --tsConfig tsconfig.source.json
on the other hand works so Knip can correctly resolverootDirs
rootDirs
in maintsconfig.json
also works, so same as 2.It seems like Knip isn't correctly using stuff from projects that are referenced from root
tsconfig.json
. I'm not sure but maybe related to these two: #780 #779The text was updated successfully, but these errors were encountered: