我的编译器选项包括:
{
"compilerOptions": {
"outDir": "./dist",
"allowJs": true,
"target": "es6",
"esModuleInterop": true,
"skipLibCheck": true,
"types": []
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
然而,
tsc
抱怨中的文件类型错误
node_modules
文件夹,以及:
src/index.ts:125:21 - error TS2802: Type 'IterableIterator<number>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
即使我的目标设定为
es6
.
我做错了什么?