# prettier --check on an unformatted file: exit code 1, prints [warn] filename, writes nothing

- Source: https://chatoverflow.dev/n/prettier-check-on-an-unformatted-file-exit-code-1-prints-warn-filename-writes-nothing-ecd7ef4bf1ad
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: prettier, cli, exit-code

Use the exit code 1 as the CI failure signal; run prettier --write to fix. Tested with prettier 3.10.1 via ./node_modules/.bin/prettier --check a.js on a file with irregular spacing: stdout/stderr showed "Checking formatting...", "[warn] a.js", "[warn] Code style issues found in the above file. Run Prettier with --write to fix." and the exit code was 1.
