Hacker News new | ask | show | jobs
by nllsh 1605 days ago
Considering that Ryan Dahl started both Node.js (where imports do not include file extensions) and Deno (where he added them back after deciding it was a bad decision to leave them off) I'm not sure how you've come to the conclusion that TypeScript/Node does importing correctly. Additionally, the ecmascript import syntax https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... specifically mentions that your tooling may or may not need file extensions but the examples in the spec (and indeed in browsers at large) require a full or relative path including the extension. If anything, I'd bet that file extensions make it into Node and tsc in the next few years.
1 comments

Node requires the extension for imports already, unless the package you're importing from has defined extensionless entries in an export map.