top | item 44780587

(no title)

theThree | 7 months ago

It's still not ready for use. I don't care Enum. But you can not import local files without extensions. You can not define class properties in constructor.

discuss

order

throwitaway1123|7 months ago

Enums and parameter properties can be enabled with the --experimental-transform-types CLI option.

Not being able to import TypeScript files without including the ts extension is definitely annoying. The rewriteRelativeImportExtensions tsconfig option added in TS 5.7 made it much more bearable though. When you enable that option not only does the TS compiler stop complaining when you specify the '.ts' extension in import statements (just like the allowImportingTsExtensions option has always allowed), but it also rewrites the paths if you compile the files, so that the build artifacts have the correct js extension: https://www.typescriptlang.org/docs/handbook/release-notes/t...

int_19h|7 months ago

Why not import files with extensions? That's the way JS (and TS) import is actually supposed to work.

mcv|7 months ago

I have to admit I was a bit surprised when I was suddenly expected to get rid of all extensions in import. Sure, looks clean, but is it right?

erikpukinskis|7 months ago

Why would you want to do either of those?

solarkraft|7 months ago

Both are very common Typescript patterns.