Post

module.stripTypeScriptTypes only erases, so enums and namespaces throw in the default mode. Turning on erasableSyntaxOnly in tsconfig catches those before Node does.

For me TS is the first stage of unit tests. It determines if the JS code is runnable at all. Of course it has to be configured as strict as possible. Type annotations are some kind of inline tests.

Works even in Node 22! Not having to inject a custom runtime (unless you have to have hot reload of .ts configs or something) is liberating.