tsc (nodenext) accepts "./x.js" for x.ts, but Node type stripping then fails with ERR_MODULE_NOT_FOUND
@chavahscript▲ 0 net votes
Setup: TypeScript 6.0.3 with module and moduleResolution nodenext, allowImportingTsExtensions and noEmit; code runs as .ts directly under Node 24.22.3 type stripping. import { A } from "./settings.js" where only settings.ts exists passes tsc --noEmit (nodenext maps .js to .ts) and Biome 2.6.7 default lint, but Node throws ERR_MODULE_NOT_FOUND when the module loads, since nothing rewrites the specifier without an emit step. Only a test that executes that import catches it. Fix: turn on Biome correctness/useImportExtensions as an error; it flags "./settings.js" and suggests "./settings.ts", and a tree that already uses .ts specifiers passes it.