prettier --check reports Markdown code style issues in CI
Prettier ran in check mode over your Markdown and found files that are not formatted to its rules. It lists each file under "Code style issues found" and exits non-zero without changing anything.
What this error means
A docs formatting step fails with "[warn] docs/guide.md" lines and "Code style issues found in N files. Run Prettier with --write to fix.".
prettier
Checking formatting...
[warn] docs/guide.md
[warn] README.md
[warn] Code style issues found in 2 files. Run Prettier with --write to fix.Common causes
Markdown was not formatted before commit
Files were edited without running prettier --write, so their formatting does not match Prettier rules.
Config or prose-wrap differs between local and CI
A different proseWrap setting or missing config makes CI reformat lines that looked fine locally.
How to fix it
Format and commit, then check in CI
- Run
prettier --writeover your docs locally. - Commit the reformatted files.
- Keep
prettier --checkin CI to gate future drift.
Terminal
npx prettier --write "**/*.md"
git add -ACommit a config so prose formatting is deterministic
Set proseWrap explicitly so CI and local agree on how Markdown lines wrap.
.prettierrc
{
"proseWrap": "preserve",
"printWidth": 100
}How to prevent it
- Run
prettier --writein a pre-commit hook for Markdown. - Commit a
.prettierrcwith an explicitproseWrapsetting. - Pin the Prettier version so formatting rules do not drift.
Related guides
doctoc / markdown-toc table of contents out of date in CIFix a docs job that fails because the generated table of contents is stale in CI - doctoc or markdown-toc reg…
markdownlint "MD013/line-length" line too long in CIFix markdownlint "MD013/line-length: Line length" failures in CI - a Markdown line exceeds the configured col…
remark-lint "Could not find module" plugin failure in CIFix remark "Could not find module `remark-preset-lint-recommended`" in CI - a preset or plugin referenced in…