Biome Toolchain
When to Use
- Set up or update
biome.json(v2 schema,preset, formatter options, and per-pathoverrides) in a JavaScript or TypeScript repository. - Migrate formatting and linting from Prettier/ESLint to Biome while tracking gaps that still need
tscor type-aware lint rules. - Diagnose Biome diagnostics, distinguish safe vs unsafe autofixes, and wire deterministic
biome cichecks.
Prerequisites
Inspect the repository's package.json, lockfile, installed @biomejs/biome version (npx --no-install biome --version or ./node_modules/.bin/biome --version), existing biome.json / biome.jsonc, and any coexisting ESLint, Prettier, or tsconfig.json setup. Pin $schema in biome.json to the installed Biome version so schema validation matches the binary.
Configure Biome v2 cleanly
- Match the installed schema version (for example Biome 2.6+ uses
"linter": { "rules": { "preset": "recommended" } }rather than the deprecated"recommended": truekey; runbiome migratewhen upgrading older configs). - Enable VCS integration (
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true }) when appropriate so.gitignoreentries are respected without duplicating ignore globs, and usefiles.includesfor generated or vendored exclusions. - Scope rule relaxations narrowly with
"overrides"(for example turning offsuspicious/noExplicitAnyonly fortests/**rather than disabling it globally). - In monorepos, place a shared root
biome.jsonand extend it from packages with"extends": "//"(Biome v2 root-extends syntax) when packages need local overrides.
Separate safe fixes, unsafe fixes, and CI checks
- Run read-only
biome check .first to inspect both formatting and lint diagnostics before mutating files. biome check --write .applies formatting and safe fixes (such aslet→constviauseConst) while skipping unsafe fixes (such as renaming unused variables with_or rewriting+concatenation into template literals, which can change coercion/runtime semantics).- Never pass
--unsafeblindly across a codebase: inspect every unsafe suggestion and apply only within authorized scope, then re-run unit tests. - In CI pipelines, run
biome ci .instead ofbiome check --write .so CI stays strictly read-only, exits nonzero on unformatted code or errors, and emits CI-friendly diagnostics.
Pair Biome with tsc for type-checked invariants
- Biome replaces Prettier and many syntactic/structural ESLint rules at high speed, but it does not replace
tsc --noEmit. - When migrating off ESLint +
typescript-eslint, inventory every active type-aware rule (such asno-floating-promisesor strict unsafe-assignment rules) and confirm whether your Biome version covers it or whether ESLint/Oxlint/TypeScript checks must remain in CI.
Example
Configure a Biome 2.6 project that bans
anyinsrc/**while allowing it intests/**, and provebiome check --writeapplies safe fixes without silently applying unsafe rewrites.
Run the worked Biome check and safe-fix verification to verify biome.json schema compliance, per-directory overrides, safe vs unsafe autofix behavior, and a passing biome ci run after fixing the source error.
Limitations
- Biome does not perform full TypeScript type checking (
tsc --noEmitremains mandatory for type soundness). - ESLint ecosystem plugins with framework- or domain-specific rules (such as custom internal plugins) may not have a 1:1 Biome equivalent.
Safety and Side Effects
Inspect package.json scripts and run read-only biome check before --write. Do not run --write --unsafe without reviewing the affected files and running tests. Avoid using npx to download an unpinned Biome binary silently when the project already pins a version in node_modules.
Related Skills and Documentation
- For general multi-language lint and type-check command workflows, see Lint and Validate.
- For TypeScript type design and
tsconfigstrictness, see TypeScript Pro. - See the official Biome documentation on configuration, linter rules, and migrating from ESLint and Prettier.