升级到 TSC 2.0.0 - VS Code 语法检查器未解析节点模块

Upgraded to TSC 2.0.0- node modules aren't resolved by VS Code syntax checker

问题

设置

我今天早上 运行 tsc 1.8。我后来升级到 tsc 2.0.0。

VS 代码 1.4.0 6276dcb0ae497766056b4c09ea75be1d76a8b679

节点 5.10.0

tsc -v: === "Version 2.0.0"

tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "jsx": "react",
    "experimentalDecorators": true,
    "noImplicitAny": false,
    "noFallthroughCasesInSwitch": true,
    "forceConsistentCasingInFileNames": true,
    "noUnusedLocals": true,
    "strictNullChecks": true
  },
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": false,
  "buildOnSave": false
}

完整项目源代码here。免责声明:这是一个相当大的代码库。

我可以通过将以下内容添加到 /.vscode/settings.json 来解决问题:

{
    "typescript.tsdk": "node_modules/typescript/lib",
}