Hacker News new | ask | show | jobs
by boromisp 697 days ago
What they probably meant was writing 'import "file.ts"' and have tsc emit 'import "file.js"'. https://github.com/microsoft/TypeScript/issues/49083
1 comments

Given the context of Node here will allow experimental type-stripping and will not be doing things like import rewriting, Typescript's decision here to focus on "users write .js in imports because that's how the type-stripped file should look" seems like the right call to me. Less work for a type-stripper because Typescript can already check if there is a .ts or .d.ts file for you if you use .js imports everywhere.