Currently using TypeScript 2 in my project, I am looking to incorporate a JavaScript library along with its typings. While I know I can easily install the types using npm install @types/some-library
, I am uncertain whether to use --save
or --save-dev
. The DefinitelyTyped GitHub readme vaguely mentions both options without clarification. My instinct tells me that @types should be included in devDependencies
, since the types are strictly for development purposes and not utilized during runtime. However, I have noticed @types being placed in dependencies
numerous times, adding to my confusion.
How can I determine whether @types/* belongs in dependencies
or devDependencies
? Are there any formal guidelines available on this matter?