6

当我尝试使用 prettier --check 检查样式时遇到此问题

Code style issues found in the above file(s). Forgot to run Prettier?
4

2 回答 2

11

您需要先格式化您的代码。运行以下命令:

# Install Prettier CLI globally on your machine
1. npm i -g prettier

# Format all files supported by Prettier in the current directory and its subdirectories
2. prettier --write .

# Output a human-friendly message and a list of unformatted files, if any
3. prettier --check .
于 2021-11-01T13:56:40.060 回答
0
 npx prettier --write .

覆盖代码并使其美观。

于 2022-02-24T11:58:07.613 回答