Skip to content

Commit

Permalink
Merge branch 'bugfix/unary-arrow-function-preserve-parentheses' into …
Browse files Browse the repository at this point in the history
…newest
  • Loading branch information
yuriyyakym committed Aug 5, 2018
2 parents 995d825 + f6b9395 commit 48abc16
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,12 @@ function genericPrintNoParens(path, options, print) {
}

const unaryWrappedInParens = n.params.length === 1 &&
n.loc &&
n.params[0].loc &&
n.loc.start.column !== n.params[0].loc.start.column;
(n.start && n.start !== n.params[0].start) ||
(
n.loc &&
n.params[0].loc &&
n.loc.start.column !== n.params[0].loc.start.column
);
if (! unaryWrappedInParens &&
! options.arrowParensAlways &&
n.params.length === 1 &&
Expand Down

0 comments on commit 48abc16

Please sign in to comment.