TypeScript-Handbook icon indicating copy to clipboard operation
TypeScript-Handbook copied to clipboard

@types package consumption should warn users about breaking changes

Open ghost opened this issue 7 years ago • 1 comments

The page on consuming types packages (https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html) tells people to run npm install --save @types/lodash. This looks like a normal npm package install, and normal npm packages follow semver, so users might assume that's all they have to do. But DefinitelyTyped packages make breaking changes in patch versions. We should tell users to lock their dependencies or install a particular version.

ghost avatar Aug 13 '18 16:08 ghost

Educating about package-lock.json and yarn.lock could also be a good idea, specifically for types one might want to lock down the version in package.json as well tough 🤔

There is --save-exact, we could change to command to that: npm install --save-exact @types/lodash

LinusU avatar Aug 13 '18 16:08 LinusU