简体   繁体   English

代码格式化程序“无法格式化”JavaScript 文件

[英]Code formatter 'cannot format' JavaScript file

I am using Macbook and suddenly my Prettier in VSCode didn't work and show a message in the bottom bar like this:我正在使用 Macbook,突然我在 VSCode 中的 Prettier 无法正常工作,并在底部栏中显示如下消息:在此处输入图像描述

Here is my settings.json file:这是我的 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
     
} 

Also in the bottom right corner, it shows the check tick for Prettier like that:同样在右下角,它显示了 Prettier 的复选标记,如下所示:

在此处输入图像描述

Can someone please help me to fix it, I have been trying to uninstall and installed again Prettier or VScode but it still shows the same error message.有人可以帮我修复它,我一直在尝试卸载并再次安装 Prettier 或 VScode,但它仍然显示相同的错误消息。

I know this can't be your issue because your issue is 10 months old now, but for me the version was updated a few days ago from 9.0.0 to 9.1.0 and it stopped working.我知道这不是你的问题,因为你的问题已经 10 个月了,但对我来说,几天前版本从 9.0.0 更新到 9.1.0 并且停止工作。 I selected "uninstall/install another version" and went back to 9.0.0 and it started working again.我选择了“卸载/安装另一个版本”并回到 9.0.0,它又开始工作了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 扩展“Prettier - Code Formatter”无法格式化 - (Mac v8.0) - Extension 'Prettier - Code Formatter' Cannot Format - (Mac v8.0) 扩展“eslint”被配置为格式化程序,但它无法格式化“JavaScript”文件 - Extension 'eslint' is configured as formatter but it cannot format 'JavaScript'-files 我无法在Visual Studio Code上格式化Python文件:“没有安装用于'python'文件的文档格式化程序。” - I can't format Python file on Visual Studio Code: “There is no document formatter for 'python'-files installed.” 从 formatting.env 文件停止 vs 代码格式化程序 - Stop vs code formatter from formatting .env file 更漂亮的代码格式化程序不适用于 javscript 语言或任何其他语言上的 Vs 代码,即使是保存格式或任何其他形式 - Prettier Code formatter not working on Vs Code on javscript language or any other even on format on save or any other form 即使在将 Black 配置为格式化程序后,获取“扩展 'Python Language Basics' 无法格式化 ~'/'” - Getting “Extension 'Python Language Basics' cannot format ~'/'” even after configuring Black as formatter 用于 VS Code 的 Ruby 格式化程序 - Ruby formatter for VS Code 无法使用VS代码格式化文档 - Cannot format document in VS code 尝试格式化我的 Java 代码时出现“没有安装 'java' 文件的格式化程序”消息 - "There is no formatter for 'java' files installed" message when trying to format my Java code 我可以使用什么 Visual Studio 代码格式化程序来格式化.hbs 车把文件? - What visual studio code formatter can i use to format .hbs handlebars files?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM