很基本,但我被卡住了。更漂亮的扩展不是在保存在 VS Code 中格式化我的代码。
- VS"编辑器:保存时格式化"在"设置"中处于选中状态。
- 更漂亮(最新版本 9.3.0):已安装,在设置中启用,并设置为 VS 的默认格式化程序。
- 设置.json 文件看起来像这样...
{"prettier.useTabs": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnPaste": true,
"prettier.jsxSingleQuote": true,
"prettier.jsxBracketSameLine": true,
"workbench.iconTheme": "vscode-icons",
"editor.formatOnSave": true }
不过,Prettier并没有工作。我错过了什么?
尝试添加更漂亮的作为您的"默认格式化程序"。 在此处查看@Hamed帖子