我有一个tsconfig.json:
{
"compilerOptions": {
//"noImplicitAny": "true",
//"removeComments": "true",
"target": "es5",
//"sourceMaps": true,
"outDir": "../compiledjs"
},
"files": ["./node_modules/screeps-typescript-declarations/dist/screeps.d.ts"],
}我正在尝试使用Screep特定的Javascript函数,如下所示:
Source.prototype.harvesters = function () {
var creeps = this.pos.findInRange(FIND_MY_CREEPS, 1);
return _(creeps).filter({ memory: { role: 'harvester' } }).value();
}但是我一直收到一个错误,因为VS代码不能识别Source。我在这里做错了什么?
发布于 2020-01-29 15:14:49
tsconfig.json文件具有特定类型信息的属性typeRoot和types。您的tsconfig在files中而不是在types中具有类型信息。
https://stackoverflow.com/questions/55658030
复制相似问题