javascript - 如何在 vs code 中完全删除 prettier code-formatter 插件?

标签 javascript visual-studio-code prettier

我通过卸载按钮卸载了prettier code-formatter插件,但是当我保存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 中相应设置的值。

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

关于javascript - 如何在 vs code 中完全删除 prettier code-formatter 插件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59643263/

相关文章:

javascript - 静态类变量

visual-studio-code - 使用远程 SSH 的 VS Code - 如何打开 "local"终端?

javascript - 无法加载配置 "prettier"以从

javascript - 图片上方的半透明div

java - 在线文档编辑器 - 我从哪里开始、从什么开始?

visual-studio-code - 如何在 Visual Studio Code 中启用文档映射?

intellij-idea - intellij 设置的更漂亮的配置

更漂亮:在函数和括号之间添加空格

javascript - setInterval 只运行一次

python - 如何在 Vscode 上更改 Python Interactive 的环境?