繁体   English   中英

如何在 vs 代码中完全删除漂亮的代码格式化插件?

[英]how to remove prettier code-formatter plugin completely in vs code?

我通过卸载按钮卸载了漂亮的代码格式化插件,但是当我保存 react js 文件时,它会自动格式化代码。

这是 setting.json 文件的样子

{
"workbench.iconTheme": "material-icon-theme",
"window.zoomLevel": 1,
"editor.fontFamily": "Monaco, Menlo, 'Courier New', monospace",
"files.autoSave": "afterDelay",
"npm.enableScriptExplorer": true,
"[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"debug.node.autoAttach": "on",
"diffEditor.ignoreTrimWhitespace": true,
"window.zoomLevel": 2,
"prettier.jsxSingleQuote": true,
"editor.codeActionsOnSave": {
    "source.organizeImports": true
},
"editor.formatOnSave": true,
"prettier.endOfLine": "auto",
"eslint.autoFixOnSave": true,
"git.autofetch": true,
"[ruby]": {},
"terminal.integrated.shell.osx": "/bin/bash"

}

我想知道如何摆脱esbenp.prettier-vscode

打开命令面板 > 格式化文档... > 配置默认格式化程序

您需要在活动选项卡中打开一个 HTML 文件。 这应该为您提供选择内置 HTML 语言功能的选项,从而更改 JSON 中相应设置的值。

要完全禁用格式,您需要取消选中“格式保存”和“类型格式”或使用false值编辑相应的"editor.formatOnSave""editor.formatOnType"字段。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM