Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parens are incorrectly stripped for MemberExpression in BindExpression #4963

Closed
ghost opened this issue Aug 9, 2018 · 1 comment
Closed
Labels
difficulty:easy Issues that should be easy to fix. Resolve me on the train to work! lang:javascript Issues affecting JS locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. priority:high Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent! status:has pr Issues with an accompanying pull request. These issues will probably be fixed soon! type:bug Issues identifying ugly output, or a defect in the program
Milestone

Comments

@ghost
Copy link

ghost commented Aug 9, 2018

Prettier 1.14.0
Playground link

--parser babylon

Input:

a::(b.c());

Output:

a::b.c();

Expected behavior:

a::(b.c());

Babel repl link

@ikatyang ikatyang added type:bug Issues identifying ugly output, or a defect in the program priority:high Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent! lang:javascript Issues affecting JS difficulty:easy Issues that should be easy to fix. Resolve me on the train to work! labels Aug 9, 2018
@ikatyang
Copy link
Member

ikatyang commented Aug 9, 2018

PRs welcome, see #4950 for example.

@ikatyang ikatyang added the help wanted We're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue! label Aug 9, 2018
@ikatyang ikatyang added status:has pr Issues with an accompanying pull request. These issues will probably be fixed soon! and removed help wanted We're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue! labels Aug 9, 2018
duailibe pushed a commit that referenced this issue Aug 9, 2018
* fix #4963

* lint code

* fix more incorrectly paren stripping

* always need parens when UnaryExpression in BindExpression

* lint code
@ikatyang ikatyang added this to the 1.15 milestone Oct 25, 2018
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jan 23, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
difficulty:easy Issues that should be easy to fix. Resolve me on the train to work! lang:javascript Issues affecting JS locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. priority:high Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent! status:has pr Issues with an accompanying pull request. These issues will probably be fixed soon! type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

No branches or pull requests

1 participant