Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97371

Strict null check not working on typescript in VSCode?

$
0
0

I'm brand new to Typescript and I suppose this is basic, but I was watching 2017 What's new in Typescript video here: [Build 2017 with Anders Hejlsberg][1] and the section on null checking looked interesting but doesn't work for me in VS Code for some reason

I have "strictNullChecks": true in my tsconfig.json, and I am using the latest version of tsc I can find (3.7.3), but when I have code like this as a method in a class in my code there are no complaints from the compiler like in the demo. Since this was a 2017 video I assume all this has been released by now. Can someone explain?

 foo(a?: string) : string {
    return a;
 }

Viewing all articles
Browse latest Browse all 97371

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>