Skip to content
Latchkey

biome format: Check Formatting Without Writing

biome format runs only the formatter, reporting which files would change unless you tell it to write.

format is the analog of prettier --check / --write. In CI you run it without --write so it fails when a file is not formatted.

What it does

biome format formats the given paths. Without --write it prints a diff of files that are not correctly formatted and exits non-zero, so CI fails on unformatted code. With --write it rewrites the files in place.

Common usage

Terminal
# verify formatting (CI), exits non-zero if anything would change
npx @biomejs/biome format ./src
# apply formatting in place
npx @biomejs/biome format --write ./src

Options

FlagWhat it does
--writeRewrite files in place (replaces v1 --write was already used; v1 also had no --apply for format)
--indent-style=tab|spaceOverride the indent style for this run
--indent-width=<n>Override indent width
--line-width=<n>Override the print width
--quote-style=single|doubleOverride JS quote style
--reporter=githubEmit GitHub Actions annotations

In CI

Run biome format without --write in CI; a non-zero exit means a file needs formatting and the developer should run --write locally. Most projects use biome check or ci instead so formatting and linting share one parse.

Common errors in CI

format exits 1 when at least one file is not formatted and prints the diff. If it reports unexpected changes, a CLI override such as --indent-style is fighting biome.json; remove the flag and rely on config. "File not found" means a path argument that does not exist.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →