3 ms·
> - Always enable --noImplicitAny and --strictNullChecks. Without these flags, the type system is barely better than using JS. It may be a good idea to add tho
by azylman 10y ago
> - Always enable --noImplicitAny and --strictNullChecks. Without these flags, the type system is barely better than using JS.
It may be a good idea to add those flags for new projects, but if you're converting existing projects, that's just not feasible.
Further, you can actually see huge benefits just from switching to the TypeScript compiler without any changes to your code.
At my last company, we started switching to TypeScript just by running our large JavaScript codebases through the TypeScript compiler and installing type definitions [1] for the popular libraries we were using. While we were doing so, we started finding a lot of bugs in existing code that TypeScript was detecting for us automatically by inferring types from how we interacted with known libraries.
[1] http://definitelytyped.org/ http://definitelytyped.org/
- jrhurst 10y agoWhat sort of bugs did you find? Were you able create replicate the regression from a user endpoint?
- deleted 10y ago[deleted]