如何在 vs 代码中完全删除漂亮的代码格式化插件? [英] how to remove prettier code-formatter plugin completely in vs code?

查看:45
本文介绍了如何在 vs 代码中完全删除漂亮的代码格式化插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过卸载按钮卸载了 prettier code-formatter 插件,但是当我保存 react js 文件时,它会自动格式化代码.

I uninstall the prettier code-formatter plugin by uninstalling button but when I save the react js file it automatically formats the code.

这里是 setting.json 文件的样子

Here what setting.json file looks like

{
"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.

推荐答案

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

open command palette > Format Document With... > Configure Default Formatter

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

You need to have an HTML file open in your active tab. 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.

要完全禁用格式,您需要取消选中Format On Save"和Format on Type"或编辑各自的 "editor.formatOnSave""editor.formatOnType" 带有 false 值的字段.

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.

这篇关于如何在 vs 代码中完全删除漂亮的代码格式化插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆