Unlock TypeScript's Features in Vanilla JS with @ts-check and JSDoc

InstructorJohn Lindquist

Share this video with your friends

Send Tweet

TypeScript can help you with your plain JavaScript files if you add a simple //@ts-check comment. Then you can enhance the experience by add proper JSDocs to describe your functions which will feed type information into TypeScript and give you a development experience near TypeScript itself.

~ 2 years ago

You'll want to make sure that javascript.validate.enable is enabled in your VS Code settings in order to see type errors in your vanilla JS files.