Skip to content

formatter: allow custom switch-case indentation #18682

Closed
@andreineculau

Description

@andreineculau

TypeScript Version: 2.5.2

Code

Format the following

switch (foo) {
case 'bar':
  break;
}

Expected behavior:

Keep it the same.

Actual behavior:

case is indented.

switch (foo) {
  case 'bar':
    break;
}

This becomes more problematic when used with tslint or javascript code with eslint, because on different systems we can see one winning over the other randomly i.e. sometimes the case is indented, sometimes it's not (eslint rule says do not indent).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: FormatterThe issue relates to the built-in formatterEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Experience EnhancementNoncontroversial enhancementsHelp WantedYou can do thisSuggestionAn idea for TypeScriptVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions