TypeScript tutorialLesson 37Free preview
TS in JS Projects
This lesson is part of TypeScript · All levels
Summary
Older JavaScript projects can benefit from type through JSDoc annotations and allowJs and checkJs options. With checkJs, TypeScript checks the type directly on the .js file without having to migrate it. This method provides some type safety with very minimal change.
Key points
- AllowJs allows .js files to be compiled
- CheckJs checks the type on the JS file
- JSDoc uses @param, @returns, and @type
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.