Make prettier to format like eslint

Viewed 372

I see a lot of questions relating to my problem but according to what I've found, people want eslint to ignore prettier's rules.
In my case I want prettier to have the same behavior than eslint.

I want this format

const bar = foo.fn()
.then(() => ...)
.then(() => ...)
.catch(() => ...);

in .eslintrc

"rules" : [ "indent": ["error", 2, { "MemberExpression": 0, "SwitchCase": 1 }] ]

but prettier format my code like this

const bar = foo.fn()
  .then(() => ...)
  .then(() => ...)
  .catch(() => ...);

Is it possible to make prettier to format like eslint ?

1 Answers

prettier and eslint --fix have different configuration options, prettier is mostly opinionated, so it's very difficult to configure them to do the same thing, but it's possible to automatically run eslint --fix after prettier with this tool.

Related