astexplorer icon indicating copy to clipboard operation
astexplorer copied to clipboard

Support adding a babel plugin ?

Open gs-akhan opened this issue 6 years ago • 4 comments

It would be really nice if we support a babel plugins, preferably babel typescript plugin...

Thanks

gs-akhan avatar Dec 31 '17 14:12 gs-akhan

Can you elaborate? astexplorer provides access to a number of parsers and transformers. Where do you want to have this support?

fkling avatar Jan 11 '18 10:01 fkling

Yeah, So let me explain this. Typescript doesn't have clean and easy way to transform TS-AST. However Babel-typescript plugin can create this AST nodes. I was thinking If we can have support for this, we can use AST transform to explore and write TS transformers. Currently any TS syntax throws error in transformation

screen shot 2018-01-13 at 12 18 03 am

gs-akhan avatar Jan 12 '18 19:01 gs-akhan

Note that the transform you pick always uses its default parser — there’s no way to use the TypeScript parser with Babel. However, if you use Babel 7 and Babylon 7, you can click on the ⚙️ button and enable the “typescript” option to parse TypeScript.

j-f1 avatar Jan 12 '18 19:01 j-f1

I'd love this as well; I'm writing a plugin for the pipeline operator which requires an extra syntax plugin to parse correctly.

mAAdhaTTah avatar Feb 10 '18 19:02 mAAdhaTTah