vscode保存格式化自动去掉分号、逗号、双引号

之前每次写完代码都是双引号还有分号,看着很难受,就像修改一下,让它变成单引号,并且不加上引号:如下形式,看着简洁清晰明了

修改方式:更改 settings.json 文件

快捷键"Ctrl + Shift + P"打开命令面板

加上这几个配置:

贴上我的完整配置:

javascript 复制代码
{
    "editor.fontSize": 18,
    "editor.linkedEditing": true,
    "editor.unicodeHighlight.ambiguousCharacters": false,
    "extensions.ignoreRecommendations": true,
    "editor.unicodeHighlight.invisibleCharacters": false,
    "explorer.confirmDragAndDrop": false,
    "editor.formatOnSave": true,
    "editor.formatOnType": true,
    "css.hover.references": false,
    "editor.hover.enabled": false,
    "html.hover.references": false,
    "prettier.useEditorConfig": true,
    "prettier.jsxSingleQuote": true,
    "prettier.singleQuote": true,
    "prettier.trailingComma": "none",
    "prettier.semi": false,
    "explorer.confirmDelete": false,
    "security.workspace.trust.untrustedFiles": "open",
    "cssrem.rootFontSize": 80,
    "liveServer.settings.donotShowInfoMsg": true,
    "terminal.integrated.fontSize": 13,
    "liveServer.settings.donotVerifyTags": true,
    "vetur.validation.template": false,
    "vetur.validation.script": false,
    "eslint.enable": false,
    "gitlens.advanced.messages": {
        "suppressLineUncommittedWarning": true
    },
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "workbench.iconTheme": "vscode-icons",
    "workbench.colorTheme": "One Dark Pro Flat",
    "terminal.external.osxExec": "iTerm.app",
    "workbench.startupEditor": "none",
    "path-intellisense.mappings": {
        "@": "${workspaceRoot}/src"
    },
    "vsicons.dontShowNewVersionMessage": true,
    "emmet.triggerExpansionOnTab": true,
    "[javascript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "[vue]": {
        "editor.defaultFormatter": "octref.vetur"
    },
    "[typescriptreact]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "[typescript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    }
}
相关推荐
远游客-蜡台3 小时前
vscode使用claude code的一点记录
vscode·ai
小碗童6 小时前
解决 Vscode SSH远程连接上后,点击打开文件无响应问题。
ide·windows·vscode·ssh
笑望灬星辰12 小时前
VS Code 编辑器 Git 工具 - 分支操作【保姆级教程】
git·vscode·编辑器
Java小白中的菜鸟12 小时前
创建自己的obsidian模版
ide
山峰哥15 小时前
SQL性能提升20倍的秘密:这些优化技巧让DBA都惊叹
开发语言·数据库·sql·编辑器·深度优先·宽度优先
Peter·Pan爱编程16 小时前
第六篇:VS Code + Continue 插件:开源爱好者的低成本高自由度方案
ide·开源·ai编程
Karle_17 小时前
为AI编辑器准备c++编译环境,onnxruntime、cmake、cl,网上坑太多备份记录后续方便使用。
开发语言·c++·编辑器
la_vie_est_belle18 小时前
Pygame Studio——用Python自制的一款可视化游戏编辑器
python·游戏·编辑器·游戏引擎·pygame·pyside6·pygame-ce
Thanks_ks18 小时前
【第 002 讲】Python 标准开发环境搭建:运行环境 | 环境变量 | IDE 部署 | 配置优化
ide·python·pycharm·开发工具·环境配置·环境变量·编程基础
shughui18 小时前
2026年最新版Python安装和PyCharm安装教程(图文详细 附安装包)
开发语言·windows·python·pycharm·编辑器