我一直在研究文件中找到的lib
属性的可能值意味着什么。我在Typescript GitHub页面上发现了与这些值相对应的相关文件,并且显然通过使用以下 ES 功能包括:compilerOptions
tsconfig.json
d.ts
ES2017
/// <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" />
但显然 ES6 不包括在内,并且有自己的文件不引用任何内容。我的问题是,如果有人知道,是否可以安全地假设通过使用es2017
我涵盖了所有es6
功能(从打字的角度来看)或者应该单独包含在lib
选项中?
例如,像这样:
{
...
"compilerOptions": {
...
"lib": ["es2017", "dom"]
},
...
}
}
或这个:
{
...
"compilerOptions": {
...
"lib": ["es2017", "es6", "dom"]
},
...
}
}