My use case: I'm building a Yeoman generator, that modifies TypeScript files; in ways similar to:
- Add
import
statements - Import components into an AngularJS module
Yeoman recommends using an AST parser for this task:
The most reliable way to do so is to parse the file AST (abstract syntax tree) and edit it.
Tools like jscodeshift make this fairly straightforward for JavaScript files, but it doesn't appear to support TypeScript. Are there any similar tools to parse and modify the AST of a TypeScript file?