Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Indentation is too aggressive for ternary operator #3676

Copy link
Copy link
@JsonFreeman

Description

@JsonFreeman
Issue body actions

Actual:

var v =
    0 ? 1 :
        2 ? 3 :
            4;

Expected:

var v =
    0 ? 1 :
    2 ? 3 :
    4;

I believe the fix is that if the false branch of the ternary operator should have the same indentation as the true branch. In the case where the true branch is on the same line as the condition, it should not be considered indented, and therefore the false branch should not be indented.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    7.0 LS MigrationBugA bug in TypeScriptA bug in TypeScriptDomain: FormatterThe issue relates to the built-in formatterThe issue relates to the built-in formatterDomain: LS: Smart IndentationAutomatic indenting after a newline (not quite formatter/formatting)Automatic indenting after a newline (not quite formatter/formatting)Good First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.