Skip to content

Objects in ternary has extra indent when using --use-tabs #2771

@jishaal

Description

@jishaal

Prettier Version: 1.6.1

Code

(playground)

const abc = props.something
    ? xyz
    : {
          prop1: a,
          prop2: b,
          prop3: false,
      };

Expected behavior:

The object in the ternary has the correct indentation as above JS snippet

Actual behavior:

We get an extra level of indentation in the object. This seems to only happen if using the --use-tabs option. If spaces are used, there is no issue.

const abc = props.something
	? xyz
	: {
			prop1: a,
			prop2: b,
			prop3: false,
		};

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:javascriptIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions