Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Typescript] Indentation of nested ? : (ternary operator) inconsistent - first part indented, second part not #5881

Closed
mihilion opened this issue Feb 18, 2019 · 1 comment
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Comments

@mihilion
Copy link

Prettier 1.16.4
Playground link

Input:

let variable = condition1
  ? condition2
    ? "aa"
    : "bb"
  : condition2
    ? "cc"
    : "dd";

Output:

let variable = condition1
  ? condition2
    ? "aa"
    : "bb"
  : condition2
  ? "cc"
  : "dd";

Expected behavior:

let variable = condition1
  ? condition2
    ? "aa"
    : "bb"
  : condition2
    ? "cc"
    : "dd";
@mihilion mihilion changed the title Typescript: indentation of nested ? : (ternary operator) inconsistent - first part indented, second part not [Typescript] indentation of nested ? : (ternary operator) inconsistent - first part indented, second part not Feb 18, 2019
@mihilion mihilion changed the title [Typescript] indentation of nested ? : (ternary operator) inconsistent - first part indented, second part not [Typescript] Indentation of nested ? : (ternary operator) inconsistent - first part indented, second part not Feb 18, 2019
@duailibe
Copy link
Member

Hi!

This is the expected behavior, see #5039 for more context.

@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label May 19, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

2 participants