我正在使用VS Code 1.40.0,并且具有以下package.json
{
"name": "test","version": "0.0.1","description": "test","main": "./src/main.ts","sideEffects": false,"author": "","license": "ISC","devDependencies": {
"@typescript-eslint/eslint-plugin": "^2.6.1","@typescript-eslint/parser": "^2.6.1","eslint": "^6.5.1","typescript": "^3.7.2"
},"dependencies": {
}
}
以及以下tsconfig.json
{
"compilerOptions": {
"lib": [
"es2019","dom","es2019.array"
],"target": "es6","module": "es6","strict": true,"strictBindCallApply": true,"strictFunctionTypes": true,"strictPropertyInitialization": true,"moduleResolution": "node","noImplicitAny": true,"noImplicitReturns": true,"noImplicitThis": true,"forceConsistentCasingInFileNames": true,"noFallthroughCasesInSwitch": true,"strictNullChecks": true,"removeComments": true,"preserveConstEnums": true,"sourceMap": true,"alwaysStrict": true,"esModuleInterop": true,"allowSyntheticDefaultImports": true,"noUnusedLocals": true,"noUnusedParameters": true
}
}
但是在编写以下代码const a = null ?? 0;
时,vscode抱怨,但是在按预期方式编译时,是否需要更改某些设置才能使vscode正确解析Typescript 3.7?