Warm tip: This article is reproduced from stackoverflow.com, please click
npm typescript package.json

Should typescript @types packages version match their non types packages?

发布于 2020-03-27 15:44:48

Do @types use the same versioning as the untyped package?

npm i bluebird @types/bluebird -S gives me

"@types/bluebird": "^3.5.0",
"bluebird": "^3.5.0",

Seems pretty reasonable.

npm i request @types/request -S gives me

"@types/request": "0.0.41",
"request": "^2.81.0",

Now this scares me a bit. Does this mean that we only have request types for request version 0.0.41?

Questioner
ClickThisNick
Viewed
89
basarat 2017-03-14 02:47

Should typescript @types packages version match their non types packages?

No. TypeScript types for JS packages is best effort and depends on

  • official js documentation (commonly lacking)
  • Community interest in the package

So version mismatches are fine as long as you are aware of their best effort nature.