TypeScript 2.0 introduces a new method of accessing type declarations through npm packages within the @types scope.
npm i --save-dev @types/lodash
As mentioned in this answer, TypeScript can be directed to search for type declaration files by including a string in the `typings` property of `tsconfig.json`, as outlined in the documentation available here.
{
"compilerOptions": {
...
"types": ["lodash"]
}
}
The manual process of editing the `tsconfig.json` file every time a new type declaration is installed may seem cumbersome. Is there an automatic solution for this?
I am considering creating an npm script for this task, but I would prefer not to resort to using bash for JSON file modifications.