Re:Announcing TypeScript 3.9
by bavell on Wednesday May 13, 2020 @11:57AM
(#23168208)
Most of the time you can just `npm install -D @types/package-name` to get the types for that package. E.g. `npm i -D @types/lodash`
[ Parent
| on HN ]
Re:Announcing TypeScript 3.9
by WorldMaker on Wednesday May 13, 2020 @05:32PM
(#23172076)
I find you generally want the @types/ dependencies in the same package.json array as the related dependency (ie, if lodash is a devDependency then `npm i -D` away, but if it is a proper dependency it generally makes sense to `npm i @types/lodash`). Different project's mileage will of course vary, but it makes it easier for downstream dependencies.
Re:Announcing TypeScript 3.9
by strogonoff on Wednesday May 13, 2020 @12:20PM
(#23168498)
As to the remaining cases, a custom definitions file is unfortunately required to avoid compile-time errors.