Skip to content
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

💡 an issue with detecting unnecessary files in the monorepo project. #961

Open
vincent890120 opened this issue Feb 26, 2025 · 2 comments
Labels
question Further information is requested

Comments

@vincent890120
Copy link

Suggest an idea for Knip

I ran into a problem while using knip detection in a monorepo project.
Let me give you an example:
The project comprises two sub-packages, app and infrastructure, where app relies on infrastructure's baseMethod.
When I import the baseMethod() from '@infrastructure/lib/base' in app and run 'knip --production', the file 'packages/infrastructure/lib/base.ts' is flagged as unnecessary.
But when I import the baseMethod from 'infrastructure/lib/base', knip correctly identifies 'packages/infrastructure/lib/base.ts' as a necessary file. I'm wondering, why does the presence of the '@' symbol cause this misidentification?
Here's the layout of the project structure.
Image

Image Can you assist me? Could there be an issue with how I'm using knip?
@vincent890120 vincent890120 added the feature request Feature request label Feb 26, 2025
@vincent890120
Copy link
Author

This is what I get when I run knip.
Image

@webpro webpro added question Further information is requested and removed feature request Feature request labels Feb 26, 2025
@webpro
Copy link
Member

webpro commented Feb 26, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants