【发布时间】:2022-01-01 22:32:25
【问题描述】:
当我打开自动格式化保存文件时,类型
type Params = {
fileName: string,
isTxt: boolean
}
将保存为
type Params = {
fileName: string
isTxt: boolean
}
哪个 React 不再接受。在我将 React 添加到项目后,Prettier 才开始删除逗号。我怎样才能让更漂亮不要那样做?
我在 VScode 1.62.3 中使用 Prettier 扩展 v9.0.0 和 Typescript v4.5.2。
使用.prettierrc
{
"semi": false,
"trailingComma": "none",
"singleQuote": true,
"printWidth": 80
}
【问题讨论】:
标签: reactjs typescript visual-studio-code prettier