更新后 Prettier 在 VScode 上不起作用

Prettier doesn't work on VScode after update

我最近更新了 VSCode,Prettier 不再处理我的 JS 文件。之前,每当我保存我的 JS 文件时,Prettier 都会为我添加分号。现在当我保存时,没有添加分号。我启用了插件并检查了设置以确保我启用了分号插入。什么可能导致此错误?

这个对我有用:

  1. Select View -> Command Palette(或键入 CMD + shift+ P
  2. 类型:Format Document
  3. 选择 Prettier 作为默认格式化程序

原回答: