Courses / TypeScript
2. allowJs and checkJs
Compiler options that enable TypeScript to consume .js files and optionally type-check them.
JavaScript
allowJs and checkJs
TypeScript compiler options that let TypeScript read .js files and optionally type-check them.
"I want to get type safety without rewriting my whole JS codebase."
allowJs lets TypeScript include .js files in the compilation; checkJs turns on type-checking for those JavaScript files when included. Together they let you incrementally get TypeScript benefits while keeping .js files.
"I want to get type safety without rewriting my whole JS codebase."
allowJs lets TypeScript include .js files in the compilation; checkJs turns on type-checking for those JavaScript files when included. Together they let you incrementally get TypeScript benefits while keeping .js files.