Prettier code formatter does not work like what I want

39 Views Asked by At

Prettier getting hard to read my code, it refixed like that:

 let justBlackKingOverThere = pieceNameInTheBoard.map(
    (item) => item.slice(0, 11) == "blackKnight"
  );

but I want that:

let justBlackKingOverThere = pieceNameInTheBoard.map((item) => item.slice(0, 11) == "blackKnight")

Is there a solution or different code formatter that you recommend?

I try also different formatter but some of them are same.

1

There are 1 best solutions below

0
DevKaranJ On

You can config Prettier to avoid breaking lines within arrow function parameter by setting 'arrowParens' to "avoid".

{
  "arrowParens": "avoid"
}