You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For e.g. Let's consider the following source code as input passed to recast.print();
constcode=["async function add(a, b) {"," const z = foo || await getFoo();"," return z;","}"].join("\n");constast=recast.parse(code);recast.print(ast);
Behaviour:
Prints a modified code, with await getFoo() surrounded by parentheses (normal brackets).
// PrintResult {// code: 'async function add(a, b) {\n' +// ' const z = foo || (await getFoo());\n' +// ' return z;\n' +// '}'// }
Expected Behaviour:
Should not contain parenthesis if they were not present in the original code.
// PrintResult {// code: 'async function add(a, b) {\n' +// ' const z = foo || await getFoo();\n' +// ' return z;\n' +// '}'// }
If there are any restrictions in supporting this, can it be possible to put this "adding auto parentheses" feature behind a recast options toggle?
Also if you need any support, I can work on this issue with some guidance 👍🏽
Thanks for all your efforts and creating this awesome library 🙇🏽 💯
The text was updated successfully, but these errors were encountered:
Ref: facebook/jscodeshift#176
For e.g. Let's consider the following source code as input passed to
recast.print()
;Behaviour:
Prints a modified code, with
await getFoo()
surrounded by parentheses (normal brackets).Expected Behaviour:
Should not contain parenthesis if they were not present in the original code.
If there are any restrictions in supporting this, can it be possible to put this "adding auto parentheses" feature behind a recast
options
toggle?Also if you need any support, I can work on this issue with some guidance 👍🏽
Thanks for all your efforts and creating this awesome library 🙇🏽 💯
The text was updated successfully, but these errors were encountered: