TypeScript · Senior · Question 16 of 75
What does the verbatimModuleSyntax flag require?
- ✓Correct answer: Explicitly marking type imports with
import type - 2Using only CommonJS modules with
require - 3Writing
.jsextensions in all relative imports
Explanation
The rule is simple: everything without the type modifier stays in the output JS, everything with type is erased. This makes the result predictable for any transpiler and replaces the deprecated importsNotUsedAsValues and preserveValueImports.