TypeScript · Middle · Question 45 of 75
What does the isolatedModules flag do?
- ✓Correct answer: Forbids code that can't be transpiled file by file
- 2Compiles each module in a separate process
- 3Isolates each file's global variables from one another
Explanation
Babel, SWC and esbuild compile files independently and don't see types from other modules. isolatedModules warns about code they can't handle correctly: re-exporting a type without export type, accessing a const enum from another file, and so on.