8 ms·
It's a tough call, and I can see arguments for both sides. On the other side, one of the big selling points of TypeScript is that you can take your existing hug
by Analemma_ 10y ago
It's a tough call, and I can see arguments for both sides. On the other side, one of the big selling points of TypeScript is that you can take your existing huge JavaScript codebase, and with little effort turn it into TypeScript with all the types being "any", then gradually add strong types as time permits. This wouldn't work if --strictNullChecks was the default and would add one more step to the migration process.
- knocte 10y ago> and with little effort turn it into TypeScript Good point, but then how about an opt-out warning (instead of error)?
- kcorbitt 10y agoI don't use TypeScript, but with Flow (which has always disallowed nulls in built-in and user-defined types by default), "null" is a subtype of "any", so that would still work. Is this not the case in TypeScript with --strictNullChecks?
- legulere 10y ago`null` and `undefined` are subtypes of `any`, so you can still gradually convert to typescript. (according to https://github.com/Microsoft/TypeScript/pull/7140 https://github.com/Microsoft/TypeScript/pull/7140)