3 ms·
> Simply renaming the file extension won’t work, as the compiler stops completely at type errors. Why did the author think that this would work exactly?
by JacksonGariety 6y ago
> Simply renaming the file extension won’t work, as the compiler stops completely at type errors.
Why did the author think that this would work exactly?
- pantsforbirds 6y agoI think it was supposed to be a comparison to Typescript. Since TS is a strict superset of JS you can simply rename a file and refactor into TS as you go.
- onion2k 6y agoIt works in TypeScript - just rename something from JS to TS and the you have the benefits of TS's types, warnings, and features but your code will continue to work. Untyped things default to 'any', which is useful if you want to migrate a project from JS to TS. It's a very useful feature if you have a mature project in JS that you want to improve.
- ronenlh 6y agoThat's how it is with TypeScript, CoffeeScript, SCSS... This works which most language supersets. My point was that it was a trial and error way of discovering that this was not so. Seeing it as a separate language, I agree that the statement doesn't really makes sense.