vscode 自动格式化时,去掉、添加逗号、分号,双引号变单引号

方法一: ctrl+shift+P,找到 settings.json:

 "prettier.semi": false, // 分号
  "prettier.singleQuote": true, // 单引号
  "prettier.trailingComma": "none" // 去掉结尾的逗号

方法二:项目根目录新建:.prettierrc.json,内容如下:

{
    "singleQuote": true,
    "semi": false,
    "trailingComma": "none"
}

posted @ 2022-03-23 11:46  柯宝宝智商感人  阅读(5065)  评论(0)    收藏  举报