Enable CheckJS in almost any editor:
// @ts-check
Checks argument types, number of arguments supplied to functions, and other typescript functionality in regular javascript. Looks for functions in other files and can automatically add those using the lightbulb solutions menu.