When to use lib.es2015.d.ts vs @ types / core-js?

It seems to lib.es2015.d.tscome with a Typescript compiler with a package @types/core-jsif they are both referenced.

This post indicates that the solution is either:

  • Change es6to es5in the compilerOptionslib property. Therefore, Typescript will not include ES6 type definitions.
  • Remove core-jsfrom node_modules. Thus, Typescript will only use internal definitions of type ES6.

I don’t understand why @types/core-jsthen it even exists, and when it is useful, since the compiler already comes with these definitions?

+4
source share

Source: https://habr.com/ru/post/1662795/


All Articles