Ans*_*onH 8 visual-studio-code prettier
我正在使用Prettier v6.4.0,当它自动向我的函数参数添加新行时,我发现它很烦人。
例如,这是我想要的格式:
const Header1 = styled.h1`
${maxWidth(500, () => css`
font-size: 36px;
`)}
`;
Run Code Online (Sandbox Code Playgroud)
但是,Prettier 在格式化代码时会向函数参数添加新行:
const Header1 = styled.h1`
${maxWidth(
500,
() => css`
font-size: 36px;
`
)}
`;
Run Code Online (Sandbox Code Playgroud)
如何配置 Prettier 来阻止上述行为?不过,我不想// prettier-ignore在标记模板文字中添加,因为这种格式模式在我的代码库中非常常见。
| 归档时间: |
|
| 查看次数: |
1354 次 |
| 最近记录: |