[英]VS Code not doing type checking on typescript files
I'm trying to convert an existing codebase from flowtype to typescript, but VS Code will not report type errors in .ts
files as expected.我正在尝试将现有代码库从 flowtype 转换为 typescript,但 VS Code 不会按预期报告.ts
文件中的类型错误。
Running tsc
works as expected:运行tsc
按预期工作:
typescript
and tslint
as npm devDependencies
.我安装了typescript
及tslint
为NPM devDependencies
。<root>/tsconfig.json
file.我添加了一个<root>/tsconfig.json
文件。<root>/frontend/ts-example.ts
with types that should fail very badly.我在<root>/frontend/ts-example.ts
添加了一个测试文件,其类型应该会非常失败。"typescript.validate.enable": true
to my settings.json
but it complained that was an unsupported setting.尝试添加"typescript.validate.enable": true
到我的settings.json
但它抱怨这是一个不受支持的设置。What could I be missing here?我会在这里错过什么?
Welp, uh...咳咳……
I had the "TypeScript and JavaScript Language Features" extension disabled in my workspace.我在我的工作区中禁用了“TypeScript 和 JavaScript 语言功能”扩展。
Yep, that'll do it...是的,这样就可以了...
In case anyone in the future is as stupid as I am, check: VS Code Extensions > Disabled.如果将来有人像我一样愚蠢,请检查:VS Code Extensions > Disabled。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.