Hacker News new | ask | show | jobs
by coding123 2137 days ago
I thought the tool to automatically migrate JS to TS was tsc --init and then set the flag to include js files.
2 comments

This tool actually converts JS files to valid TS files with strict typing, attempting to add types to everything it can and adding placeholder types where it can't.
That’s just running js files within ts files. Nothing to really do with migrating, unless you’re writing everything by hand and want everything to work while you’re at it.
Well, actually is a good base to migratee a js codebase to ts manually, one file at a time.

You can leave parts in JS while you upgrade/add new features in TS