Skip to content
Latchkey

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

  1. Run prettier --write over your docs locally.
  2. Commit the reformatted files.
  3. Keep prettier --check in CI to gate future drift.
Terminal
npx prettier --write "**/*.md"
git add -A

Commit 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 --write in a pre-commit hook for Markdown.
  • Commit a .prettierrc with an explicit proseWrap setting.
  • Pin the Prettier version so formatting rules do not drift.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →