Fix single optional arrow param printing (#1002)
This commit is contained in:
1 parent
a2b560887c
commit
332babe77d
3 files changed
+4
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user