Our great sponsors
-
recast
JavaScript syntax tree transformer, nondestructive pretty-printer, and automatic source map generator
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
I'm the author of Abracadabra, a VS Code extension that brings extra automated refactorings for JS & TS code.
I had great results with a combination of babel + recast. Babel is doing the job and Recast is mostly here to preserve the original style when printing code again. I animated a workshop @ Node.JS Montréal 2019 that was recorded here. We cover the parse/transform/print of code using Babel (live coding starts around 45').
I think a great alternative in your case would be to use the typescript compiler itself.