Eventually I wonder if the TypeScript team will revert their stance on not allowing compiler plugins. It seems like such a waste not to have a standard package interface. All this is doing is exposing the already provided compiler tools, its not using Babel or anything, its just a nicer API over the raw TS compiler API.<p>Arguably, the TypeScript team should be supplying that nicer API. Its the only thing missing to me from TypeScript that it really needs.
Is it possible to use ts-morph to generate new code or is it mostly aimed at modifying existing code? I want to generate some boilerplate in a project im working on but not sure what the best tool is
I’ve always wanted a tool that could search ts code using types & logic, e.g. you could search for every instance where an object of a particular type has a value assigned to one of its properties.
This is a great tool. The api surface takes a bit to figure out, and navigating manipulating the syntax tree can require some trial and error, but I’ve used this to do large scale refactors that would have been very time consuming if done by hand.<p>99% of the time the tools provided by jetbrains / vscode are more than sufficient, but 1% of the time a tool like this saves you a bunch of time, both searching for what you need to change and making the changes you want.
For people who want to do similar programmatic manipulation using Racket: <a href="https://www.neilvandyke.org/racket/progedit/" rel="nofollow">https://www.neilvandyke.org/racket/progedit/</a><p>(Not just manipulation of Lisp-like languages: any language can be parsed to Racket syntax objects.)