简体   繁体   English

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

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

I uninstall the prettier code-formatter plugin by uninstalling button but when I save the react js file it automatically formats the code.我通过卸载按钮卸载了漂亮的代码格式化插件,但是当我保存 react js 文件时,它会自动格式化代码。

Here what setting.json file looks like这是 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"

} }

I want to know how to get rid of the esbenp.prettier-vscode .我想知道如何摆脱esbenp.prettier-vscode

open command palette > Format Document With... > Configure Default Formatter打开命令面板 > 格式化文档... > 配置默认格式化程序

You need to have an HTML file open in your active tab.您需要在活动选项卡中打开一个 HTML 文件。 That should give you the option of picking the builtin HTML language features and consequently change the value of the respective setting in your JSON.这应该为您提供选择内置 HTML 语言功能的选项,从而更改 JSON 中相应设置的值。

To disable formatting altogether you need to uncheck "Format On Save" and "Format on Type" or edit the respective "editor.formatOnSave" and "editor.formatOnType" fields with a false value.要完全禁用格式,您需要取消选中“格式保存”和“类型格式”或使用false值编辑相应的"editor.formatOnSave""editor.formatOnType"字段。

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

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