Skip to content

Formatter adds extra indent to arrow function returning object literal #21068

Closed

Description

@mjbvz

microsoft/vscode#41288 (comment)

TypeScript Version: 2.7.0-dev.20180108

Code

const foo = ({
	x,
	y
}) => ({
	y: x,
	x: y
});

Run format

Expected behavior:

Code unchanged

Actual behavior:

const foo = ({
	x,
    y
}) => ({
        y: x,
        x: y
    });

Activity

  1. caub commented on Jan 10, 2018

    @caub

    And same for

    const x = true ? (
    	2
    ) : (
    	3
    );

    that becomes

    const x = true ? (
    	2
    ) : (
    		3
    	);
  2. MJCD commented on Jan 10, 2018

    @MJCD

    +1'd

  3. yume-chan commented on Jan 10, 2018

    @yume-chan
    Contributor
  4. ghost closed this as completedon Jun 18, 2018
  5. ghost added
    FixedA PR has been merged for this issue
    on Jun 18, 2018
  6. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: FormatterThe issue relates to the built-in formatterFixedA PR has been merged for this issueVS 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