VS Code Prettier - How to disable auto new lines in function arguments?

Viewed 415

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.

0 Answers
Related