Prettier: Objects in ternary has extra indent when using --use-tabs

Created on 8 Sep 2017  路  1Comment  路  Source: prettier/prettier

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,
        };
javascript locked-due-to-inactivity has pr bug

Most helpful comment

That is certainly not very pretty!

>All comments

That is certainly not very pretty!

Was this page helpful?
0 / 5 - 0 ratings