Skip to content

Bug: Nested ternary operator indentation issueΒ #62539

@harshith1118

Description

@harshith1118

πŸ”Ž Search Terms

ternary indentation, nested ternary, formatter, typescript indentation

πŸ•— Version & Regression Information

This changed in PR #62537 (#62537)
Unsure if this is a regression or longstanding bug.

⏯ Playground Link

No response

πŸ’» Code

const result = condition1 ? (condition2 ? value1 : value2) : value3;

Expected formatter to indent nested ternary consistently.

πŸ™ Actual behavior

Formatter does not indent nested ternary operators correctly, causing confusion in complex expressions.

πŸ™‚ Expected behavior

Nested ternary operators should be indented to clearly reflect their structure, improving code readability.

Additional information about the issue

Related PR: #62537

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions