Fix single optional arrow param printing (#1002)
parent
a2b560887c
commit
332babe77d
|
@ -315,6 +315,7 @@ function genericPrintNoParens(path, options, print) {
|
|||
!n.params[0].typeAnnotation &&
|
||||
!n.params[0].leadingComments &&
|
||||
!n.params[0].trailingComments &&
|
||||
!n.params[0].optional &&
|
||||
!n.predicate &&
|
||||
!n.returnType
|
||||
) {
|
||||
|
|
|
@ -30,6 +30,7 @@ x => ({}().b);
|
|||
(a => b)::c;
|
||||
a::(b => c);
|
||||
a = b => c;
|
||||
a = (b?) => c;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
(a => {}).length;
|
||||
typeof (() => {});
|
||||
|
@ -61,6 +62,7 @@ x => ({}().b);
|
|||
(a => b)::c;
|
||||
a::(b => c);
|
||||
a = b => c;
|
||||
a = (b?) => c;
|
||||
"
|
||||
`;
|
||||
|
||||
|
|
|
@ -27,3 +27,4 @@ x => ({}().b);
|
|||
(a => b)::c;
|
||||
a::(b => c);
|
||||
a = b => c;
|
||||
a = (b?) => c;
|
||||
|
|
Loading…
Reference in New Issue