TypeScript · Junior · Question 48 of 75
How do you gradually migrate a JS project to TypeScript?
- ✓Correct answer: Enable
allowJs, rename files one by one and tighten the checks - 2Rewrite the whole project in TS at once, otherwise it won't build
- 3Add
// @ts-nocheckto every file forever
Explanation
allowJs lets you mix JS and TS, while checkJs and JSDoc give you types without renaming. Start with leaf modules and utilities, then tighten the strict flags. A full rewrite is risky and halts development.