I\'m looking at moving over to Typescript and currently looking at doing this slowly if possible file by file.
Now the system I currently have is built with Webpack and
What about simply rename foo.js to foo.ts (it may require some additional steps but often it works fine) and then rewrite your snippet to:
foo.js
foo.ts
/// foo('something');