Home > OS >  Prettier format code write by me, not the whole team
Prettier format code write by me, not the whole team

Time:03-24

I am a programmer, and I started using prettier, I want prettier to format the code write only by me, for example if I open a JavaScript file pushed on Git by other members of the team, I dont want that code to be formated. Is there any posibility?

Searched on the web but nothing found

CodePudding user response:

There is no option for that, but you can ignore the code you don't want to format with specific comments.

e.g. to ignore js code you need to type // prettier-ignore

// prettier-ignore
matrix(
  1, 0, 0,
  0, 1, 0,
  0, 0, 1
)

You can check their documentation to learn more: enter image description here

  • Related