prettier没有.prettierrc
时间: 2023-10-31 19:55:10 浏览: 143
.prettierrc 代码格式化配置
回答: 如果你的项目中没有.prettierrc文件,Prettier将使用默认配置。你可以在项目的根目录中创建.prettierrc文件,并在其中指定自定义的Prettier配置。你可以参考以下示例配置文件:
{
"semi": false,
"singleQuote": true,
"arrowParens": "always",
"trailingComma": "all"
}
将你想要的配置选项添加到.prettierrc文件中,并保存。这样,Prettier将按照你的配置对代码进行格式化。希望对你有帮助!<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [vscode .prettierrc 文件的配置](https://blog.csdn.net/q1152345713/article/details/125734805)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [解决:.prettierrc 配置完后,自动保存并没有格式化代码](https://blog.csdn.net/Curry_On/article/details/131753002)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文