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"
    }
}
相关推荐
一苓二肆27 分钟前
代码常用工具使用
git·vscode·docker·github·vim
jiayong235 小时前
Markdown编辑完全指南
java·编辑器
jimy16 小时前
切换、退出GitHub account with Copilot,github copilot账号,自动补全没额度了
vscode·copilot
试着6 小时前
【VSCode+AI+测试】连接ai大模型
ide·人工智能·vscode·python·学习·编辑器·ai-test
程序员zgh6 小时前
CMake 项目构建工具介绍
c语言·开发语言·c++·编辑器
水木姚姚8 小时前
VSCode 调试 C++ 之 cin 输入
c++·windows·vscode·开发工具·调试
第二只羽毛9 小时前
图书管理系统项目PPT文稿
java·大数据·开发语言·ide
TeleostNaCl10 小时前
如何在 Vim 启用行号显示和语法高亮功能
linux·经验分享·编辑器·vim
艾莉丝努力练剑10 小时前
【Linux进程(一)】深入理解计算机系统核心:从冯·诺依曼体系结构到操作系统(OS)
java·linux·运维·服务器·git·编辑器·操作系统核心
围炉聊科技10 小时前
两周实测:Kiro与Trae cn谁是我更中意的AI IDE?
ide·人工智能