【问题标题】:Code formatter 'cannot format' JavaScript file代码格式化程序“无法格式化”JavaScript 文件
【发布时间】:2021-03-15 06:58:07
【问题描述】:

我正在使用 Macbook,突然我在 VSCode 中的 Prettier 无法正常工作,并在底部栏中显示如下消息:

这是我的 settings.json 文件:

   "editor.formatOnSave": true,
   "workbench.colorTheme": "Material Theme Darker",
   "workbench.iconTheme": "material-icon-theme",
   "editor.fontSize": 13,
   "[json]": {
       "editor.quickSuggestions": {
           "strings": true
       },
       "editor.suggest.insertMode": "replace"
   },
   "terminal.integrated.automationShell.osx": "",
   "terminal.integrated.shell.osx": "",
   "terminal.integrated.fontFamily": "\"Meslo LG M for Powerline\"",
   "editor.defaultFormatter": "esbenp.prettier-vscode",
   "[javascript]": {
       "editor.defaultFormatter": "esbenp.prettier-vscode"
   },
   "prettier.enableDebugLogs": true
     
} 

同样在右下角,它显示了 Prettier 的复选标记,如下所示:

谁能帮我修复它,我一直在尝试卸载并重新安装 Prettier 或 VScode,但它仍然显示相同的错误消息。

【问题讨论】:

    标签: visual-studio-code prettier prettier-vscode jsprettier


    【解决方案1】:

    我知道这不是您的问题,因为您的问题已经存在 10 个月了,但对我来说,几天前版本已从 9.0.0 更新到 9.1.0 并且停止工作。我选择了“卸载/安装另一个版本”,然后回到 9.0.0,它又开始工作了。

    【讨论】:

      猜你喜欢
      • 2023-01-31
      • 1970-01-01
      • 2010-09-28
      • 2011-12-14
      • 2022-07-04
      • 2012-11-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多