From 061913091dd929a2c83df2b8428a5c97267a3a19 Mon Sep 17 00:00:00 2001 From: Yuriy Yakym Date: Sun, 5 Aug 2018 18:04:49 +0200 Subject: [PATCH] Wrap unary arrow function argument: support different parsers - logical expression fix --- lib/printer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/printer.js b/lib/printer.js index 83ff614c..f9e2d47b 100644 --- a/lib/printer.js +++ b/lib/printer.js @@ -366,13 +366,15 @@ function genericPrintNoParens(path, options, print) { parts.push(path.call(print, "typeParameters")); } - const unaryWrappedInParens = n.params.length === 1 && + const unaryWrappedInParens = n.params.length === 1 && ( (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 &&