microsoft / microsoft/TypeScript

"after" custom transformer seems to be called before the JS transformation.

Open
#32,731 0 comments 0 reactions 1 assignee View on GitHub

@rbuckton is already working on this.

Since Aug 6, 2019.

Needs Investigation
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Hi there,

I am trying to implement an after custom transformer as I am planning to make changes to the transpiled JS code.
According to the inline documentation (Custom transformers to evaluate after built-in .js transformations.), the transformer should be called after the source file is transpiled to JS. In the transformer API, the only provided argument is a "SourceFile" object which has no reference to the JS code (or at least I couldn't find it).

What's the point of having an after transformer if you don't get access to the transformed source code, nor have possibilities to change it? Is it a bug or is it like that on purpose?

Thanks in advance

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.