@biome-toolchain

Configure, run, and migrate JS/TS projects to Biome v2 formatting and linting. Separate safe from unsafe fixes, scope overrides, run biome ci, and pair with tsc for type-aware checks.

Biome Toolchain

When to Use

  • Set up or update biome.json (v2 schema, preset, formatter options, and per-path overrides) in a JavaScript or TypeScript repository.
  • Migrate formatting and linting from Prettier/ESLint to Biome while tracking gaps that still need tsc or type-aware lint rules.
  • Diagnose Biome diagnostics, distinguish safe vs unsafe autofixes, and wire deterministic biome ci checks.

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

  1. Match the installed schema version (for example Biome 2.6+ uses "linter": { "rules": { "preset": "recommended" } } rather than the deprecated "recommended": true key; run biome migrate when upgrading older configs).
  2. Enable VCS integration ("vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true }) when appropriate so .gitignore entries are respected without duplicating ignore globs, and use files.includes for generated or vendored exclusions.
  3. Scope rule relaxations narrowly with "overrides" (for example turning off suspicious/noExplicitAny only for tests/** rather than disabling it globally).
  4. In monorepos, place a shared root biome.json and 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 as let → const via useConst) while skipping unsafe fixes (such as renaming unused variables with _ or rewriting + concatenation into template literals, which can change coercion/runtime semantics).
  • Never pass --unsafe blindly 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 of biome 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 as no-floating-promises or 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 any in src/** while allowing it in tests/**, and prove biome check --write applies 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 --noEmit remains 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.