Skip to content

How do I use a regular transformer within a program transformer? #29

Answered by nonara
LukasMachetanz asked this question in Q&A
Discussion options

You must be logged in to vote

Effectively, using a "program transformer" requires a good understanding of the TypeScript Compiler API.

To help on that journey, I've created a short guide on how to get better acclimated with it. Please have a read here: Advice for working with the TS Compiler API

While I believe that will be helpful for you and others moving forward, I recognize that having a more complete example on how to do this would also be helpful, so I've written the following example:

Example of transforming a Progam with additional AST transformations

import ts, { CompilerHost, CompilerOptions, Program, SyntaxKind, TransformationContext, SourceFile, Node } from 'typescript';
import { PluginConfig, ProgramTrans…

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@nonara
Comment options

@zhfnjust
Comment options

@bogeeee
Comment options

@bogeeee
Comment options

@bogeeee
Comment options

Answer selected by nonara
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants