Skip to content

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

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

Closed
mjbvz opened this issue Jan 8, 2018 · 4 comments
Closed

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

mjbvz opened this issue Jan 8, 2018 · 4 comments
Labels
Bug A bug in TypeScript Domain: Formatter The issue relates to the built-in formatter Fixed A PR has been merged for this issue VS Code Tracked There is a VS Code equivalent to this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Jan 8, 2018

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
    });
@mjbvz mjbvz added Domain: Formatter The issue relates to the built-in formatter VS Code Tracked There is a VS Code equivalent to this issue labels Jan 8, 2018
@mhegazy mhegazy added the Bug A bug in TypeScript label Jan 8, 2018
@mhegazy mhegazy assigned ghost Jan 8, 2018
@mhegazy mhegazy added this to the TypeScript 2.8 milestone Jan 8, 2018
@caub
Copy link

caub commented Jan 10, 2018

And same for

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

that becomes

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

@MJCD
Copy link

MJCD commented Jan 10, 2018

+1'd

@yume-chan
Copy link
Contributor

@caub #14494

@ghost
Copy link

ghost commented Jun 18, 2018

The original issues seems to have been fixed by #24312. The other issue is #14494.

@ghost ghost closed this as completed Jun 18, 2018
@ghost ghost added the Fixed A PR has been merged for this issue label Jun 18, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Formatter The issue relates to the built-in formatter Fixed A PR has been merged for this issue VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

5 participants