benjamn / benjamn/recast

Remove parentheses around a replaced expression

Open
#369 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.3k
Forks
363
Avg merge
3d 8h
Merged PRs (30d)
3

Description

If I replace a parenthesized expression, the parentheses are still printed, regardless of they are necessary or not.

```javascript
var ast = recast.parse('(1+2)*3').program.body[0].expression;
ast.left = recast.types.builders.literal(3);
recast.print(ast).code //"(3)*3"
```
Is it possible to remove the exptra parentheses? Is it a bug?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.