fkling / astexplorer

A web tool to explore the ASTs generated by various parsers.
https://astexplorer.net/
MIT License
6.14k stars 729 forks source link

Transforms can't work with decorators #626

Closed runspired closed 2 years ago

runspired commented 2 years ago

This is roughly similar to #36 except that the stage-0 setting isn't enough.

If using some code with a decorator and using the jscodeshift transform, the following error is encountered:

This experimental syntax requires enabling one of the following parser plugin(s): 'decorators-legacy, decorators' (2:2)
fkling commented 2 years ago

Looks like decorators are enabled for the babylon parser.

You can tell jscodeshift to use this parser by setting

export const parser = 'babylon';