diff --git a/src/language-js/needs-parens.js b/src/language-js/needs-parens.js index 4d65e92987ea..d81b31252a9f 100644 --- a/src/language-js/needs-parens.js +++ b/src/language-js/needs-parens.js @@ -513,6 +513,7 @@ function needsParens(path, options) { case "SpreadProperty": case "BinaryExpression": case "LogicalExpression": + case "NGPipeExpression": case "ExportDefaultDeclaration": case "AwaitExpression": case "JSXSpreadAttribute": diff --git a/tests/angular_interpolation/__snapshots__/jsfmt.spec.js.snap b/tests/angular_interpolation/__snapshots__/jsfmt.spec.js.snap index 8885a5343b2b..731741e5e177 100644 --- a/tests/angular_interpolation/__snapshots__/jsfmt.spec.js.snap +++ b/tests/angular_interpolation/__snapshots__/jsfmt.spec.js.snap @@ -36,7 +36,8 @@ exports[`pipe-expression.ng - __ng_interpolation-verify 1`] = ` keyA: reallySuperLongValue, keyB: shortValue | pipeB | pipeC: valueToPipeC } - | aaa + | aaa, + (hideLinqPanel ? "ReportSelection.HideShowLabel_Show.String" : "ReportSelection.HideShowLabel_Hide.String") | localize:(localizationSection) ] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ @@ -63,6 +64,10 @@ exports[`pipe-expression.ng - __ng_interpolation-verify 1`] = ` keyA: reallySuperLongValue, keyB: shortValue | pipeB | pipeC: valueToPipeC } - | aaa + | aaa, + (hideLinqPanel + ? "ReportSelection.HideShowLabel_Show.String" + : "ReportSelection.HideShowLabel_Hide.String") + | localize: localizationSection ] `; diff --git a/tests/angular_interpolation/pipe-expression.ng b/tests/angular_interpolation/pipe-expression.ng index 9477cadb738a..349b7ba0c54f 100644 --- a/tests/angular_interpolation/pipe-expression.ng +++ b/tests/angular_interpolation/pipe-expression.ng @@ -20,5 +20,6 @@ keyA: reallySuperLongValue, keyB: shortValue | pipeB | pipeC: valueToPipeC } - | aaa + | aaa, + (hideLinqPanel ? "ReportSelection.HideShowLabel_Show.String" : "ReportSelection.HideShowLabel_Hide.String") | localize:(localizationSection) ]