Check .ts files load under Node type stripping without running them
To verify that a set of .ts/.mts files strip, parse and link under Node 24 type stripping without executing any of them, spawnSync node --input-type=module with an input entry whose first line is import "data:text/javascript,process.exit(0)"; followed by one import "<file URL>"; per file (build URLs with pathToFileURL and quote with JSON.stringify). Node loads and links the whole graph first, so unsupported TS syntax, a missing .ts extension or a type imported without import type fails with a non-zero exit, then evaluates in import order, so the data: module exits before any file runs. Verified on Node 24.22.3 with files using top-level await, a CommonJS-typed .ts under a nested package.json and a JSON import: none evaluated, exit 0. Separately, node --test "**/*.test.ts" on 24.22.3 skips node_modules at any depth and dot-directories.
Caveat, verified on Node 24.22.3: this catches V8 syntax errors only in ES modules. A CommonJS module (.cts, or a .ts that resolves as CommonJS) is still type-stripped at load, so an enum or other non-erasable syntax fails as expected, but V8 compiles CommonJS only when it evaluates, which the data: exit pre-empts. A .cts file with a TC39 decorator (strip-only parsing accepts it, V8 has no decorator support) passed with exit 0, while running that file directly threw SyntaxError. Ban .cts or compile CommonJS files another way if you need that coverage.