当我使用以下tsconfig.json
构建项目时,由于最近添加strictNullChecks: true
而收到错误。
{
"version": "2.3.4",
"compilerOptions": {
"allowSyntheticDefaultImports": false,
"removeComments": true,
"strictNullChecks": true,
"sourceMap": true,
"jsx": "react",
"target": "es5",
"lib": [
"es6",
"dom",
"scripthost"
],
"outDir": "../build/"
},
"include": [
"./*.ts",
"./*.tsx",
"./{client,mobile,server,shared,test,tools}/*.ts",
"./{client,mobile,server,shared,test,tools}/*.tsx",
"./{client,mobile,server,shared,test,tools}/**/*.ts",
"./{client,mobile,server,shared,test,tools}/**/*.tsx",
"./desktop/*.ts"
]
}
但是,我没有在VSCode中看到任何错误。
我还有以下vscode设置:
"typescript.tsdk": "./node_modules/typescript/lib",
除了 strictNullChecks错误外,一切似乎都在VSCode 中正常工作。