Skip to content

Conversation

@jtkiesel
Copy link
Contributor

@jtkiesel jtkiesel commented Oct 15, 2025

What changed with this PR:

The extra indent which was added to wrapped ternary/lambda expressions inside of parentheses is now removed, so that it is only indented once like Prettier JavaScript/TypeScript.

Example

Input

class Example {

  void example() {
    (aaaaaaaaaa ? bbbbbbbbbb : cccccccccc.dddddddddd().eeeeeeeeee().ffffffffff());
    (aaaaaaaaaa -> bbbbbbbbbb.cccccccccc.dddddddddd().eeeeeeeeee().ffffffffff());
  }
}

Output

class Example {

  void example() {
    (aaaaaaaaaa
      ? bbbbbbbbbb
      : cccccccccc.dddddddddd().eeeeeeeeee().ffffffffff());
    (aaaaaaaaaa ->
      bbbbbbbbbb.cccccccccc.dddddddddd().eeeeeeeeee().ffffffffff());
  }
}

Relative issues or prs:

Closes #786

@jtkiesel jtkiesel merged commit c47c99b into jhipster:main Oct 20, 2025
6 checks passed
@jtkiesel jtkiesel deleted the fix/ternary-lambda-parens-extra-indent branch October 20, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong indentation for ternary in parentheses

1 participant