Skip to content

[Angular] Removing parenthesis when it should not be #5389

@alexw10

Description

@alexw10

Prettier 1.15.1
Playground link

--parser angular

Input:

{{ (hideLinqPanel ? "ReportSelection.HideShowLabel_Show.String" : "ReportSelection.HideShowLabel_Hide.String") | localize:(localizationSection) }}

Output:

{{
  hideLinqPanel
    ? "ReportSelection.HideShowLabel_Show.String"
    : "ReportSelection.HideShowLabel_Hide.String"
    | localize: localizationSection
}}

Expected behavior:
It should keep the ( ) around the main ternary operator cause this is piping after that evaluates, the output it provides makes it not localize.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:angularIssues affecting Angular template (not general JS/TS issues used for Angular)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions