We asked ourselves the exact question and 75% of the team is in favor of moving to TS, so this thread is great validation!
We asked ourselves the exact question and 75% of the team is in favor of moving to TS, so this thread is great validation!
Just as an aside, the amount of bugs I've found just by refactoring to TS is incredible, the compiler has made me aware of edge cases that I hadn't thought of. Just adding types to old code and getting red squiggles telling me why it won't compile has taught me quite a lot about random aspects of JS that I've never considered.
Two potential drawbacks that were brought up are when there's a business "priority", the refactor will take a backseat, especially if the file is fully in JS.
The other is that with a larger codebase, this could take a year or even more and still not be fully done. But this is mitigated to a large extent by the fact that TS and JS can coexist and the benefits of a TS file are immediately available.
Thanks for your input!
https://chrisfrew.in/blog/converting-a-large-project-from-ja...
This method does have some caveats, but can get your a sort of starting point using TypeScript for any sized JavaScript project.