typescript - VS Code 未内联显示 Typescript 错误
问题描述
我很困惑为什么我的 VSCode 没有显示任何 Typescript 错误。
当我在终端中运行 tsc 时,我确实看到了显示的错误,但这些不在我的内联文件中。
我目前的设置
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"lib": [
"es2015",
"dom"
],
"skipLibCheck": false
},
"include": [
"src"
]
}
index.ts - 抛出预期错误但没有
const a: number = 'test';
我还根据此链接的建议更新了 VS 中的设置以添加以下内容,但仍未显示任何错误。
解决方案
推荐阅读
- c - C中的函数原型
- java - 使用递归 Java 镜像三角形
- apache - OpenSSL:错误:140770FC:SSL 例程:SSL23_GET_SERVER_HELLO:未知协议
- r - 将几何传递给函数
- pygame - Pygame,生成第二枚导弹或外星人不起作用
- c# - 当不支持 HTTP 方法时,Web API 2 不会说未经授权
- objective-c - 如何将 NSString 转换为字符?
- python - 使用 Kivy 的函数调用中出现意外的 TypeError
- c# - 如何将存储过程值显示到 datagridview
- html - 使 div 的高度等于 flex 容器中内容的高度