jeffijoe / typesync

Install missing TypeScript typings for dependencies in your package.json.
MIT License
1.51k stars 21 forks source link

[feature request] Remove @types packages for packages already including types. #43

Closed dylang closed 4 years ago

dylang commented 4 years ago

Lot of packages are starting to include their own types, making the @types typings unnecessary for those packages.

TypeScript will ignore the @types typings if a package includes types, but I don't know of an automated way to figure out which @types typings are no longer necessary and remove them.

Perhaps this project could handle cleaning up the redundant/outdated @types packages?

jeffijoe commented 4 years ago

I believe TypeSync already does this. For example, it won’t add typings for jest because they are included.

dylang commented 4 years ago

@jeffijoe If your package.json already has @types/jest, then it would be great if TypeSync removed it from the package.json, assuming TypeSync recognized it as no longer necessary because jest included the types.

jeffijoe commented 4 years ago

That would be a bad idea, because sometimes the typings from DT are more correct than the ones shipping with the package. Jest is one of those.

dylang commented 4 years ago

Interesting, I didn't realize TypeScript would use the @types if the package included types too. Thanks for helping me understand and closing this ticket!

jeffijoe commented 4 years ago

No problem! 👍