typescript - 如何为 vscode 启用严格的空检查

标签 typescript visual-studio-code

由于 Typescript 引入了对动态运行时错误的严格空检查,如果启用它会很棒。我找不到有关如何启用它的任何文档或指南。

如何在 VSCode 中启用严格的 null 检查?

最佳答案

couldn't find any docs or guidelines on how to enable it.

只需使用 tsconfig.jsoncompilerOptions。例如。

{
  "compilerOptions": {"strictNullChecks":true}
}

关于typescript - 如何为 vscode 启用严格的空检查,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40097895/

相关文章:

javascript - 如何使用 Angular 8 在互联网重新连接时重新发送失败的 API 请求?

typescript - 将 Mocha 与 TypeScript 路径一起使用

testing - 需要 codeceptjs 的自动完成插件

git - 来自 Visual Studio Code 和 Visual Studio(但不是 Git Bash)的 "Permission denied"错误

visual-studio-code - 与Phoenix和VSCode一起使用时,ElixirLS调试器意外停止

javascript - Angular : Conditionally changing FormControl

javascript - 我可以将函数导入 typescript 类文件吗?

javascript - 禁用 Angular react 形式的字段

visual-studio-code - 调试时忽略自己/指定的文件?

javascript - 使用 Beautify.js 在 VSCode 中导入和导出行间距