automatically installing the @types package when adding a dependency #174
-
reference: https://twitter.com/aweary/status/1353832998723059714 It seems like if npm already knows |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
Theoretically this could be a config option that can be defined globally in npm itself in addition to being locally defined in an |
Beta Was this translation helpful? Give feedback.
-
I wonder if something like |
Beta Was this translation helpful? Give feedback.
-
One concern is, should it be a dev dep or a regular dep? I'm pretty sure types should always be dev deps, but I'm not convinced every part of the community has this convention. Picking "regular dep" could have far-reaching impacts on non-TS users downstream of the current project. |
Beta Was this translation helpful? Give feedback.
-
This seems like it could be a useful feature, although I do have some slight concerns with "automatically" installing a 3rd party type definition for a module, it seems like it could create an additional attack surface for supply chain attacks. I could see this being an option that could be included at install time, I believe there are also tools that already exist in the ecosystem to do this behavior. This feels like something that could be explore via the CLI RFC process, perhaps starting with an issue outlining what this new feature could look like. |
Beta Was this translation helpful? Give feedback.
-
TypeScript already recommends installing the |
Beta Was this translation helpful? Give feedback.
-
Opened an RFC for this, since @MylesBorins asked for one to be created: npm/rfcs#328 |
Beta Was this translation helpful? Give feedback.
This seems like it could be a useful feature, although I do have some slight concerns with "automatically" installing a 3rd party type definition for a module, it seems like it could create an additional attack surface for supply chain attacks.
I could see this being an option that could be included at install time, I believe there are also tools that already exist in the ecosystem to do this behavior.
This feels like something that could be explore via the CLI RFC process, perhaps starting with an issue outlining what this new feature could look like.
https://github.com/npm/rfcs