Prettier Extension 不会在 VS Code 上格式化我的代码

时间:2021-04-15 17:28:29

标签: visual-studio-code prettier

一两个月前我第一次安装 Prettier 时,它运行良好。但是,我最终在某个时候禁用了它,因为我不想在其他项目中使用它。但是,重新启用它后,我发现它不再起作用了。大约三个星期以来,我一直无法让它再次工作。我已经尽力了。

我有 Prettier 作为我的默认格式化程序。 enter image description here

我已为用户和工作区打开“保存时格式化”,并将“保存时格式化”设置为 fileenter image description here

我尝试完全卸载并重新安装 VS Code,将 "editor.defaultFormatter": "esbenp.prettier-vscode" 添加到 settings.json 并卸载 ESlint,但没有任何效果。 Prettier 甚至不会出现在屏幕底部:(

1 个答案:

答案 0 :(得分:0)

尝试:

npm install --save-dev prettier