Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Visual Studio Code show really all TypeScript type errors?

In my TypeScript/React project, "react-scripts start" shows type errors that are not shown inline in my Visual Studio Code IDE. Most types errors are actually shown inline, but not all. What could be the reason for that? How can I make Visual Studio Code show all errors directly?

VS Code setting "typescript.validate.enable" is set to true

My tsconfig.json:

{
  ...
  "compilerOptions": {
    ....
    "noImplicitAny": true,
    "strictBindCallApply": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "strictNullChecks": true,
    ...
  }
  ...
}
like image 203
Natasha Avatar asked Sep 01 '26 16:09

Natasha


1 Answers

I'm not quite sure if this is the solution to your issue, but for me I often get issues like the ones you're describing when VSCODE is running on a different version than your build is.

Down in the right corner, you can select which version you want to use in Visual Studio Code:

enter image description here

Simply click the version number (3.0.3 in image) and select the version from your workspace instead of the latest installed in vscode!

like image 165
Fredrik Schön Avatar answered Sep 03 '26 11:09

Fredrik Schön



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!