I'm using Prettier v6.4.0 and I found it annoying when it automatically add new lines to my function arguments.
For example, this is the format that I desire:
const Header1 = styled.h1`
${maxWidth(500, () => css`
font-size: 36px;
`)}
`;
However, Prettier would add new lines to the function arguments when it formats the code:
const Header1 = styled.h1`
${maxWidth(
500,
() => css`
font-size: 36px;
`
)}
`;
How can I configure Prettier to stop the above behavior? I do not want to add // prettier-ignore inside the tagged template literal though, since this format pattern would be very common in my codebase.

If you change the width print width from default 80 to 160, it will not add new lines while formatting
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With