Add ts-morph scaffold for TS codemods
Created by: felixfbecker
I used this for the change in #10198
ts-morph
is a wrapper around the TS compiler by @dsherret that makes it easy to work with for codemods. You have full access to type errors, type resolution, symbols, autofixes and of course the AST (type-safe with autocompletion etc).
It took a while to set up and figure out, but after that I think it can save a ton of time. By adding this to the repo I want to eliminate this first-time setup cost so it can save everyone working on the web codebase a lot of time going forward when big refactors are required.