当我使用以下内容构建项目时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",
VSCode 中一切似乎都工作正常exceptstrictNullChecks 错误。