簡體   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