0

My project has a prettier.config.js. My colleagues and I use prettier, and format documents on save.

On my machine, but not my colleague's machines, saving files changes the indentation for multiline code (function arguments, objects, etc). See below.

On my colleagues machines it doesn't - if I give them I file I have saved with prettier, it will change the multiline formatting back.

I have deleted and reinstalled the prettier (esbenp.prettier-vscode) extension and this has not solved the problem.

  1. What is this setting called? I have looked in the prettier docs regarding multiline statements.

  2. Why is prettier using a different setting from prettier.config.js?

Here is a diff, when I saved (and ran prettier) over some vcode that my colleagues have already ran prettier over:

enter image description here

mikemaccana
  • 110,530
  • 99
  • 389
  • 494
  • The green code on your screen shot doesn't look like something Prettier can output. Some other tool in your colleague's environment does that. You should check what other VS Code extensions he has installed. – thorn0 May 22 '20 at 12:41
  • 1
    @thorn̈ just to clarify: it's not green code, it's just a change being highlighted. This is my environment, not my colleagues. – mikemaccana May 22 '20 at 13:44

0 Answers0