Skip to content

feature request: Run transformers if --noEmit #178

@Danielku15

Description

@Danielku15

Seems typescript itself runs the custom transforms as part of the emit which prevents transformers being used called at all. I'd like to execute my transformers even with --noEmit to do some validations:

https://github.com/microsoft/TypeScript/blob/c85e626d8e17427a6865521737b45ccbbe9c78ef/src/compiler/program.ts#L2765-L2772

Hence it would be great if ts-patch could ensure that the transformers are still called. The easiest solution could be to pass use a custom CompilerHost forwarding all calls to the original one. Then in the writeFile check for options.noEmit.

The alternative to call the transformers within ts-patch seems like an overkill as the logic is quite complex inside typescript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions