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

[Feature Request] @types/<package> for packages that already include types as Unused #241

Closed
dylang opened this issue Sep 15, 2023 · 6 comments
Labels
feature request Feature request

Comments

@dylang
Copy link

dylang commented Sep 15, 2023

Hi, great project!

I noticed that Webpack 5 now includes types, so including @types/webpack is no longer necessary.

We probably have a lot of packages like this.

To figure out which packages now include types, maybe we can look in each dependency's package.json for a "types" key?

@dylang dylang added the feature request Feature request label Sep 15, 2023
@webpro
Copy link
Collaborator

webpro commented Sep 18, 2023

What is the issue you're seeing? Is @types/webpack being reported as a false positive?

@ElPrudi
Copy link
Contributor

ElPrudi commented Sep 18, 2023

I see the potential too: If the dependency comes with it's own type definitions, and you have a @types dependency of it installed that is now deprecated, it's useless and should be removed, no matter if you included it or not.

@dylang
Copy link
Author

dylang commented Sep 20, 2023

In the example above, @types/webpack should be reported as unused.

@webpro
Copy link
Collaborator

webpro commented Sep 27, 2023

🚀 This issue has been resolved in v2.30.0. See Release 2.30.0 for release notes.

@webpro
Copy link
Collaborator

webpro commented Sep 27, 2023

As far as I can see Knip just needs to check for the types (or typings) field in package.json (no implicit file exist checks or anything), so that's what it's doing now :)

@webpro
Copy link
Collaborator

webpro commented Oct 7, 2023

🚀 This issue has been resolved in v2.32.0. See Release 2.32.0 for release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request
Projects
None yet
Development

No branches or pull requests

3 participants