synt icon indicating copy to clipboard operation
synt copied to clipboard

Enable JSX support via setting Esprima's and TypeScript's JSX flag

Open brentlintner opened this issue 7 years ago • 0 comments

A simple cli flag and lib option should be easy to implement.

http://esprima.readthedocs.io/en/latest/syntactic-analysis.html#jsx-syntax-support

Note: escodegen will die if --jsx is set, so that complicates things.

https://github.com/estools/escodegen/issues/333

Note: If we use babylon to parse, we can use things like https://www.npmjs.com/package/babel-generator (see #94).

Note: Also should pick up files with .jsx

Note: Perhaps astring/astring-jsx is worth checking out for codegen (https://www.npmjs.com/package/astring). -- astring-jsx has some preliminary issues when testing simple file

UPDATED NOTE: try https://github.com/wallabyjs/escodegen? (see if it supports template strings too like javascript-obfuscator fork used)

brentlintner avatar Jun 07 '17 15:06 brentlintner