-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
lang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!scope:dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependency
Description
The following nested ternary
let icecream = what == "cone"
? p => !!p ? `here's your ${p} cone` : `just the empty cone for you`
: p => `here's your ${p} ${what}`;gets formatted to
let icecream = what == "cone"
? p => (!!p ? `here's your ${p} cone` : `just the empty cone for you`)
: p => `here's your ${p} ${what}`;which consequently fails a subsequent parsing with
SyntaxError: Invalid left-hand side in arrow function parameters (2:11);
(using prettier 1.44)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!scope:dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependency