Skip to content
Latchkey

Prettier "Code style issues found" with --check in CI

Prettier --check lists files whose formatting differs from Prettier's output, then exits 1. It does not change files; it only reports that they are not formatted.

What this error means

The format check prints "Checking formatting..." then "[warn] Code style issues found in the above file(s). Run Prettier with --write to fix." and exits with code 1.

Prettier
Checking formatting...
[warn] src/app.tsx
[warn] src/utils/format.ts
[warn] Code style issues found in the above file(s). Run Prettier with --write to fix.

Common causes

Files were committed without running Prettier

The listed files differ from Prettier's canonical output, so --check flags them and fails the job.

A Prettier version or config change shifted formatting

A different Prettier version or a changed setting (printWidth, singleQuote) reformats code differently than what is committed.

How to fix it

Format the files and commit

  1. Run Prettier with --write across the repo.
  2. Commit the reformatted files.
  3. Re-run --check to confirm a clean exit 0.
Terminal
npx prettier --write .
npx prettier --check .

Pin the Prettier version across local and CI

Lock Prettier so local --write and CI --check agree on formatting.

Terminal
npm install --save-dev --save-exact prettier@3.3.3

How to prevent it

  • Run prettier --write in a pre-commit hook.
  • Pin Prettier to an exact version in devDependencies.
  • Keep one .prettierrc shared by local and CI.

Frequently asked questions

What causes ""Code style issues found in the above file(s)""?
The listed files differ from Prettier's canonical output, so --check flags them and fails the job.
How do I fix "Code style issues found in the above file(s)"?
Format the files and commit

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card