-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [transformers] add example formatting + compatible parsers (#586)
This adds two new configuration options for transformers: - compatibleParserIDs - formatCodeExample compatibleParserIDs is used in SELECT_TRANSFORMER as an alternative to always resetting the parser when changing the transformer or turning it on. If we are already on a compatible parser, we won't change. formatCodeExample supports custom formatting/templating for code examples - in the case of jscodeshift, this is used to set the module.exports.parser based on current parser. In combination, this supports a workflows like: - Copy in a typescript file contents - Change the parser to typescript - Turn on the transform for jscodeshift
- Loading branch information
Showing
3 changed files
with
55 additions
and
5 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
website/src/parsers/js/transformers/jscodeshift/codeExample.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters