Back to Tsx

Native type-stripping checker contract

notes/typescript/type-stripping.md

4.23.91.3 KB
Original Source

Native type-stripping checker contract

erasableSyntaxOnly rejects syntax that requires JavaScript generation, including import-equals declarations (checker); verbatimModuleSyntax preserves non-type imports and makes import/export intent explicit instead of applying legacy inferred elision (emit predicate).

transpileModule() forces noCheck, so its output does not prove that semantic diagnostic TS1294 from erasableSyntaxOnly was enforced (transpile options).

module: nodenext selects Node's module mode (module option); allowImportingTsExtensions requires noEmit, emitDeclarationOnly, or rewriteRelativeImportExtensions (validation).