Home >Web Front-end >JS Tutorial >Why Isn\'t Prettier Formatting My Vue Files in VS Code?

Why Isn\'t Prettier Formatting My Vue Files in VS Code?

Barbara Streisand
Barbara StreisandOriginal
2024-10-27 07:07:03349browse

Why Isn't Prettier Formatting My Vue Files in VS Code?

Prettier Non-responsive in VS Code

Despite having ESlint and Prettier installed and enabled in your Nuxt application, attempting to format a .vue file in Visual Studio Code using the CMD Shift P shortcut and selecting "Format Document" has no effect.

Debug:

To address this issue, consider the following steps:

  1. Navigate to File -> Preferences -> Settings (Ctrl comma) and conduct a search for "formatter."
  2. Designate Prettier as the Default formatter. If this proves unsuccessful, follow the alternative method:
  3. Utilize the shortcut ctrl shift p to access "Format Document With..." > Configure Default Formatter... > Prettier - Code formatter.

Alternatively, the shortcut ctrl shift I can also accomplish the same result.

The above is the detailed content of Why Isn\'t Prettier Formatting My Vue Files in VS Code?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn