Prettier: 1.7.1 – Inconsistent object formatting in function

Created on 27 Sep 2017  Â·  3Comments  Â·  Source: prettier/prettier

Prettier 1.7.1
Playground link

Input:

let thing = {
  foo: "foo",
  bar: "bar",
  baz: "baz",
  qux: "qux",
  abc: "abc",
  def: "def",
  ghi: "ghi"
};

test("it ...", function(assert) {
  let thing = {
    foo: "foo",
    bar: "bar",
    baz: "baz",
    qux: "qux",
    abc: "abc",
    def: "def",
    ghi: "ghi"
  };
});

Output:

let thing = {
  foo: "foo",
  bar: "bar",
  baz: "baz",
  qux: "qux",
  abc: "abc",
  def: "def",
  ghi: "ghi"
};

test("it ...", function(assert) {
  let thing = { foo: "foo", bar: "bar", baz: "baz", qux: "qux", abc: "abc", def: "def", ghi: "ghi" };
});

Expected behavior:
Formatting for the object should be consistent.

locked-due-to-inactivity duplicate

All 3 comments

This is the same as #2909, #2910 and #2915

@duailibe Sorry, I didn't search correctly. I'll close this issue in favor of #2909

Just released 1.7.2 where this is fixed. Sorry about that!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rattrayalex picture rattrayalex  Â·  3Comments

tjvr picture tjvr  Â·  3Comments

SimenB picture SimenB  Â·  3Comments

grgur picture grgur  Â·  3Comments

brigand picture brigand  Â·  3Comments