biome check --apply: The v1 Fix Flag (Now --write)
biome check --apply is the Biome v1 way to apply safe fixes and formatting; in v2 it became --write.
If you read older docs or scripts you will see --apply. Knowing the rename to --write saves confusion when a pinned older runner image still uses it.
What it does
On Biome v1, check --apply applies safe fixes and formatting and check --apply-unsafe also applies unsafe ones. Biome v2 renamed both: --apply became --write and --apply-unsafe became --write --unsafe. The behavior is otherwise the same.
Common usage
# Biome v1 syntax
npx @biomejs/biome@1 check --apply ./src
npx @biomejs/biome@1 check --apply-unsafe ./src
# Biome v2 equivalent
npx @biomejs/biome check --write ./src
npx @biomejs/biome check --write --unsafe ./srcOptions
| Flag | What it does |
|---|---|
| --apply (v1) | Apply safe fixes and formatting; now --write |
| --apply-unsafe (v1) | Also apply unsafe fixes; now --write --unsafe |
| --write (v2) | The current name for --apply |
| --unsafe (v2) | Pairs with --write for unsafe fixes |
In CI
Pin the Biome version so the flag matches the syntax in your scripts. A job that calls --apply against a v2 binary fails; one that calls --write against a v1 binary fails the other way. Version pinning keeps the flag name stable.
Common errors in CI
"unexpected argument --apply found" means a v2 binary received the v1 flag; switch to --write. The reverse, "unexpected argument --write" on an old binary, means the pinned version predates the rename. Pin @biomejs/biome to a known major to avoid surprises across runner image updates.