eslint object-curly-newline conflicts prettier multi-line rationale eslint object-curly-newline conflicts prettier multi-line rationale typescript typescript

eslint object-curly-newline conflicts prettier multi-line rationale


I prefer the way Prettier handles this as well.

In your .eslintrc.js add this to your rules.

'object-curly-newline': 'off',


I was having same issue and didn't want to turn it off completely. Fortunately, there is a configuration-option for this rule, which you can look up here object-curly-newline

It allows configuring line breaks if there are line breaks inside properties, between properties and even least number of properties or even to enforce consistency (both curly braces, or neither directly enclose newlines).

Here is how I am using it:

/* inside .eslintrc.json */"rules": {  "object-curly-newline": [    "error",    {      "ObjectExpression": { "consistent": true, "multiline": true },      "ObjectPattern": { "consistent": true, "multiline": true },      "ImportDeclaration": "never",      "ExportDeclaration": { "multiline": true, "minProperties": 3 }    }  ]}


According to my own testing, you should add the following to your rules in the .eslintrc.js (somewhat in line with GollyJer's answer)

'object-curly-newline': 0,