[英]Typechecking not working with VsCode on .ts files
My environment: 我的环境:
I am writing this simple erroneous of code in a file called server.ts
: 我在一个名为
server.ts
的文件中编写了这个简单的错误代码:
let isDone: boolean = "done"
After running tsc
I am getting the compiler error i expect to see: 运行
tsc
我得到了编译器错误,我希望看到:
src/server.ts:1:5 - error TS2322: Type '1' is not assignable to type 'boolean'.
However, looking at the problems pane of Vscode does not warn me of this error. 但是,查看Vscode的问题窗格不会警告我该错误。 there are no problems reported and no error are being highlighed on the editor.
没有报告任何问题,并且在编辑器上没有出现任何错误。
Is type checking supported in anyway in Vscode? 在Vscode中仍然支持类型检查吗?
解决方法是打开VS Code中的typescript.validate.enable
设置,该设置默认情况下处于启用状态,但已以某种方式被关闭。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.