Prettier-vscode: Problem with decorators format after upgrading eslint from 1.13 to 1.14.2 using vscode

Created on 15 Aug 2018  路  4Comments  路  Source: prettier/prettier-vscode

After upgrading eslint to 1.14.2, as stated in the docs, the decorators now have a line break when declared within attributes. When using vscode (with the plugins eslint-config-prettier and eslint-plugin-prettier), the CLI formats it correctly, but it looks like vs code tries to format the code using the .eslintrc config file.

I searched the docs but didn't find any property that could explicitly state that the decorators should have a line break before the attribute name. Could you please help me?

In my .eslintrc file I am extending the rules "prettier", "eslint:recommended", "plugin:react/recommended", but I couldn't find any rule to override / configure.

Input:

@observable attribName;

Output:

@observable
attribName;
locked

Most helpful comment

Is there any config we could use to make it behave the same way as using eslint --fix?
I ask because I had to go back to the version 1.13 because when I save my project using vs-code, it formats the code the wrong way

All 4 comments

This just started happening in my react-native project using vscode and the always the latest plugins

Is there any config we could use to make it behave the same way as using eslint --fix?
I ask because I had to go back to the version 1.13 because when I save my project using vs-code, it formats the code the wrong way

See https://github.com/prettier/prettier/issues/4924 for a discussion.

Installing prettier 1.13 is the only solution I see.
There may be a plugin for eslint which does that.

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