How to enable typescript check in javascript file [ Javascript type checking without typescript]

In this post, I will show you how to enable typescript type checking in in JavaScript file.`

Let’s suppose you have the following file code in javascript.

var a=10;'Hello World');

You can see the second line is which is not a valid function also you can see there is no error shown in the editor.

If you want typescript to check your file for error(s), you can enable it by simply  adding the following line at the top of your file


once you add the above line in your file, you will immediately see the error that blog is a not function on console. See the below image for the error message.


Post a Comment


Close Menu