-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--include-entry-exports
ignores workspaces in knip
config
#479
Comments
Not sure I understand the issue. Why would you remove |
Hey @webpro !
because I want to setup the
Sorry, I just opened the repo. Could you take a look. |
If I guess you'll want to |
I understand you. However, if I use knip-workspaces instead of NPM-workspaces, shouldn't it continue to work? Or does the |
No, Knip workspaces isn't anything like the npm feature. npm does all the heavy lifting like installing dependencies and making those accessible to the runtime (e.g. Node.js), so e.g. your code or Knip can do its thing. So with/out the installation and symlinking of directories in The Knip
Yeah that's something you should just try, not sure about it. The symlinks are important here, because that makes Knip think internal packages/workspaces are not in |
Now I know more, thanks! You can close this issue. I'll try to focus on #472. |
Hey guys!
During the investigation of issue #472 , I encountered a problem. I'm not sure if it's a bug or not.
To make knip complain about unused items in the
shared
module, a suggestion was made to use the--include-entry-exports
flag in the #140. This flag works ifworkspaces
are specified in the rootpackage.json
. However, if they are specified in theknip
config and not in the rootpackage.json
, this flag stops working correctly and complains about all files in theshared
folder.For me, this looks like a bug because according to the documentation (https://knip.dev/features/monorepos-and-workspaces), if there are no workspaces in the root
package.json
,knip
should use theworkspaces
paths specified in theknip
config.The
knip
config looks like this:You can see an example repository here - https://github.com/what1s1ove/knip-playground
Steps to reproduce:
npx knip --include-entry-exports
and see in the console that knip complains only aboutpackages/shared/bar.js
.workspaces
from the rootpackage.json
.npm i
) to regeneratepackage-lock.json
.npx knip --include-entry-exports
and see in the console that nowknip
complains about all modules in theshared
folder.The text was updated successfully, but these errors were encountered: