.ts
suffix
imports
extension
Typescript doesn't recognize file imports with .ts suffix.
Allow voluntary .ts to be added to import paths.
It seems right to be able to use a correct path to a file without magic resolution.
This would help to align with deno which uses mandatory suffixes o files.
let
import a from "path/to/a.ts"
behave the same as
import a from "path/to/a"
My suggestion meets these guidelines:
After some more research I wonder if that behavior could even be more guided by a compiler option like --noImplicitSuffix.
That would be in alignment with --noImplicitAny and give the developer the choice, yet push for a valid, not "magical" resolved path if not set.
What are your thoughts on that?
35148
Read through the above and it seems to boil down to multiple build targets with different file extensions throws a wrench in things when supporting using the file extensions on imports. Where it diverges in my mind, and hopefully @Jack-Works you can illuminate this a bit, is that we'd be importing .ts extensions which would have to be rewritten anyways.
Most helpful comment
After some more research I wonder if that behavior could even be more guided by a compiler option like
--noImplicitSuffix.That would be in alignment with
--noImplicitAnyand give the developer the choice, yet push for a valid, not "magical" resolved path if not set.What are your thoughts on that?