Add parenthesis around arrow functions in a cast (#1689)
parent
474eed0ecb
commit
7ab73e688d
|
@ -550,6 +550,7 @@ FPp.needsParens = function() {
|
||||||
case "LogicalExpression":
|
case "LogicalExpression":
|
||||||
case "BinaryExpression":
|
case "BinaryExpression":
|
||||||
case "AwaitExpression":
|
case "AwaitExpression":
|
||||||
|
case "TSTypeAssertionExpression":
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case "ConditionalExpression":
|
case "ConditionalExpression":
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`parenthesis.ts 1`] = `
|
exports[`parenthesis.ts 1`] = `
|
||||||
<DocumentHighlightKind>(a ? b : c)
|
<DocumentHighlightKind>(a ? b : c);
|
||||||
|
<any>(() => {});
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
<DocumentHighlightKind>(a ? b : c);
|
<DocumentHighlightKind>(a ? b : c);
|
||||||
|
<any>(() => {});
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
<DocumentHighlightKind>(a ? b : c)
|
<DocumentHighlightKind>(a ? b : c);
|
||||||
|
<any>(() => {});
|
||||||
|
|
Loading…
Reference in New Issue