Prettier-vscode: destructuring/object literals are always expanded to multiline.

Created on 8 May 2018  路  4Comments  路  Source: prettier/prettier-vscode

The prettier vscode plugin is amazing. However I cannot use it for the whole file because it always expands objects/destructuring to multiline:

Before:

const { a } = {};

After:

const {
    a
} = {};

Before:

const a = { a: 5 };

After:

const a = {
    a: 5
};

This is not a problem with prettier but most probably with the plugin itself because as suggested by @j-f1 it does work well in the playground: https://github.com/prettier/prettier/issues/2550#issuecomment-387359141

However in vscode it does not:

ezgif-1-d9de541b60

locked

Most helpful comment

Indeed some other formatter https://marketplace.visualstudio.com/items?itemName=HookyQR.beautify
was running. Sorry for not checking it first.

All 4 comments

This is most certainly an other formater running. When prettier runs, bottom right _prettier_ ends in prettier: :white_check_mark: or prettier: :x: (success or failure).

See #439

Indeed some other formatter https://marketplace.visualstudio.com/items?itemName=HookyQR.beautify
was running. Sorry for not checking it first.

Hello, I do not have beautify snippet running and am still encountering this issue. It looks like there is a PR out (15 days ago) for the prettier 'object-property-newline.js'. Anyone know more about this?
https://github.com/eslint/eslint/pull/9563 (edited)

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings