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
It seems that there are potential problems with complex monorepos with each workspace using tsconfig paths or baseurl. If workspace A imports from workspaces B and both workspaces use tsconfig paths, then knip will split the workspaces into 2 different principals. However, when Principal A analyzes workspace A, it will also analyze the imported file from workspace B. Unfortunately, it tries to analyze the file from workspace B using the config options from workspace A, so the bare imports that rely on paths or baseurl end up being reported as unlisted. Furthermore, because the resolution gets cached, even attempts to reanalyze the file as part of Workspace B doesn't fix the problem, so I don't think it can be solved reliably with knip config settings.
This behavior depends on the workspace ordering, so it doesn't reproduce in all circumstances. Some monorepos might just work from pure luck. However, I was able to create a simple repro here.
The text was updated successfully, but these errors were encountered:
It seems that there are potential problems with complex monorepos with each workspace using tsconfig paths or baseurl. If workspace A imports from workspaces B and both workspaces use tsconfig paths, then knip will split the workspaces into 2 different principals. However, when Principal A analyzes workspace A, it will also analyze the imported file from workspace B. Unfortunately, it tries to analyze the file from workspace B using the config options from workspace A, so the bare imports that rely on paths or baseurl end up being reported as unlisted. Furthermore, because the resolution gets cached, even attempts to reanalyze the file as part of Workspace B doesn't fix the problem, so I don't think it can be solved reliably with knip config settings.
This behavior depends on the workspace ordering, so it doesn't reproduce in all circumstances. Some monorepos might just work from pure luck. However, I was able to create a simple repro here.
The text was updated successfully, but these errors were encountered: