Difference in the 'lib' property in tsconfig.json between es6 and es2017?

I am studying what possible property values libmean in compilerOptionsfound in the file tsconfig.json. I found on the Typescript GitHub page the corresponding files d.tsmatching these values, and apparently using the ES2017following ES features included:

/// <reference path="lib.es2016.d.ts" />
/// <reference path="lib.es2017.object.d.ts" />
/// <reference path="lib.es2017.sharedmemory.d.ts" />
/// <reference path="lib.es2017.string.d.ts" />
/// <reference path="lib.es2015.d.ts" />
/// <reference path="lib.es2016.array.include.d.ts" />
/// <reference path="lib.es2015.core.d.ts" />
/// <reference path="lib.es2015.collection.d.ts" />
/// <reference path="lib.es2015.generator.d.ts" />
/// <reference path="lib.es2015.iterable.d.ts" />
/// <reference path="lib.es2015.promise.d.ts" />
/// <reference path="lib.es2015.proxy.d.ts" />
/// <reference path="lib.es2015.reflect.d.ts" />
/// <reference path="lib.es2015.symbol.d.ts" />
/// <reference path="lib.es2015.symbol.wellknown.d.ts" />
/// <reference path="lib.es5.d.ts" />

But apparently ES6 is not included and has its own file that does not reference anything. My question is: if anyone knows, can it be assumed that with the help of ES2017I cover all the functionality es6(in terms of typing) or should it be included separately in the parameter lib?

For example, for example:

{
  ...
  "compilerOptions": {
    ...
    "lib": ["es2017", "dom"]
  },
  ...
  }
}

Or that:

{
  ...
  "compilerOptions": {
    ...
    "lib": ["es2017", "es6", "dom"]
  },
  ...
  }
}
+4
1

lib Typescript GitHub , , es6 lib compilerOptions , :

/// <reference path="lib.es2015.core.d.ts" />
/// <reference path="lib.es2015.collection.d.ts" />
/// <reference path="lib.es2015.generator.d.ts" />
/// <reference path="lib.es2015.iterable.d.ts" />
/// <reference path="lib.es2015.promise.d.ts" />
/// <reference path="lib.es2015.proxy.d.ts" />
/// <reference path="lib.es2015.reflect.d.ts" />
/// <reference path="lib.es2015.symbol.d.ts" />
/// <reference path="lib.es2015.symbol.wellknown.d.ts" />
/// <reference path="lib.es5.d.ts" />
/// <reference path="lib.dom.d.ts" />
/// <reference path="lib.scripthost.d.ts.d.ts" />
/// <reference path="lib.dom.iterable.d.ts" />

, es6 es2017, tsconfig.json :

{
  ...
  "compilerOptions": {
    ...
    "lib": ["es2017", "dom", "dom.iterable", "scripthost"]
  },
  ...
  }
}
+4

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


All Articles