3 ms·
Since this is a brand new feature that isn't even accepted into the language yet, it obviously can't be made default. If they decide to make it the default beha
by geon 11y ago
Since this is a brand new feature that isn't even accepted into the language yet, it obviously can't be made default. If they decide to make it the default behavior, there would need to be a period where the old bahavior is depreciated and triggers warnings, but not errors.
I hope the --noImplicitAny option will become default.
- mc808 11y agoOne of the most touted features is "your JavaScript is already valid TypeScript" (or pretty close), so I think they will keep the defaults so that JS developers can just change the .js to .ts and be up and running with as little friction as possible.
- geon 11y agoWell, with the last release, typescriot supposedly can compile plain js. https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#including-js-files-with---allowjs https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in... That should make it simple to treat ts more strict than js.
- masklinn 11y ago> Well, with the last release, typescriot supposedly can compile plain js. How does the ability to compile plain JS alter its goal of being a JS superset?
- jdmichal 11y agoBecause it can compile plain JS using the rules present under plain JS, such as nullable and undefined-able types by default, regardless of the rules it's using to compile TS.
- spion 11y agoIt will never be the default, but its not a big deal as you can set it up in the project configuration options. Not sure why the default matters at all. The idea behind TS is to be able to gradually turn up the strictness dial as you migrate from JS
- knocte 11y agoYes but the ideal would be to know that if its extensions ends with .ts then it's strict, if it's .js then it still is crap.