Node’s new built-in support for TypeScript
SMRTR summary
Node.js now supports TypeScript without flags from version 23.6.0, using type stripping to remove type-related syntax. Key features:
1. Support for .ts, .mts (ESM), and .cts (CommonJS) extensions.
2. No support for enums, namespaces, or JSX.
3. Local imports must reference TypeScript files, with types imported using type imports.
A tsconfig.json file is still needed for type-checking. This approach maintains correct source code positions without source maps, improving stack trace accuracy.
SMRTR provides this summary for quick context. The original article belongs to Daily.dev.
Read the original article