Skip to content Skip to sidebar Skip to footer

Is There A Way To Stop Prettier / Prettier-now From Breaking Function Arguments Into New Lines

When using prettier / prettier-now to format on save, when a function wraps around another function it breaks to a new line, I was wondering if there was a to stop this behavior? F

Solution 1:

You can tell prettier to stop formatting a block of code by using Comment // prettier-ignore

For example:

A(
  1, 0, 0,
  0, 1, 0,
  0, 0, 1
)

// prettier-ignore
B(
  1, 0, 0,
  0, 1, 0,
  0, 0, 1
)
will be transformed to:

A(1, 0, 0, 0, 1, 0, 0, 0, 1);
    
// prettier-ignore
B(
  1, 0, 0,
  0, 1, 0,
  0, 0, 1
)

Post a Comment for "Is There A Way To Stop Prettier / Prettier-now From Breaking Function Arguments Into New Lines"