简体   繁体   中英

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.

在此处输入图片说明

Running tsc works as expected:

在此处输入图片说明

  • I installed typescript and tslint as npm devDependencies .
  • I added a <root>/tsconfig.json file.
  • I added a test file in <root>/frontend/ts-example.ts with types that should fail very badly.
  • Tried adding "typescript.validate.enable": true to my settings.json but it complained that was an unsupported setting.

What could I be missing here?

Welp, uh...

I had the "TypeScript and JavaScript Language Features" extension disabled in my workspace.

Yep, that'll do it...

In case anyone in the future is as stupid as I am, check: VS Code Extensions > Disabled.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM