TypeScript compiler has the following options for the --lib
cmd line arg:
- ES2018
- ES2018.Promise
- ES2018.RegExp
What is the difference between them? Should I use ES2018
or ES2018.Promise
if I need Promisefinally()
support only and do NOT care about other ES2018 features?
Also, since what TS version those ES2018
libs are supported? When I try to use them with TS 2.6.2, it throws:
Error: tsconfig.json(16,13): error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'esnext.asynciterable'.