For any JS that is over 100 lines, I will use Typescript without thinking.
This is 20% for bugs, and 80% for sanity in long term maintenance. Refactoring is so much better / safer when you have a compilation process and at a minimum, types.
I just wish I could use Typescript without npm.