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

徘徊边缘 提交于 2019-12-07 01:02:37

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/42768836/should-typescript-types-packages-version-match-their-non-types-packages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!