Biome
A fast formatter and linter for JavaScript, TypeScript, JSX, JSON, and CSS — a single tool replacing Prettier and ESLint, written in Rust.
Biome is a high-performance toolchain for the web ecosystem — a formatter and linter for JavaScript, TypeScript, JSX, TSX, JSON, JSONC, and CSS, all in a single binary written in Rust. It was forked from Rome and is designed to be a drop-in replacement for Prettier (formatting) and ESLint (linting) combined, without the slow startup, plugin complexity, or Node.js dependency.
Features
- Formatter — Prettier-compatible output for JS, TS, JSX, JSON, and CSS; passes 97% of the Prettier compatibility test suite
- Linter — over 300 lint rules ported from ESLint, TypeScript-ESLint, eslint-plugin-react, and other popular plugins
- Single binary — no Node.js required; one self-contained executable handles both formatting and linting
- Blazing fast — written in Rust with parallelism throughout; formats and lints large codebases in milliseconds
- First-class monorepo support — a single
biome.jsonat the workspace root, with per-package overrides - Editor integration — LSP server built in; integrates with VS Code, Helix, Neovim, Zed, and others via the official extension or LSP protocol
- Import sorting — organises import statements automatically as part of formatting
- Safe and unsafe fixes — lint rules are classified as safe (auto-fixable)
or unsafe (require review), so
--writenever surprises you
Installation
# via npm (recommended for JS projects — pins the version per project)
npm install --save-dev --save-exact @biomejs/biome
# via cargo
cargo install biome_cli
# macOS
brew install biome
# Nix
nix-env -iA nixpkgs.biome
# Debian / Fedora — install via npm (works on all Linux distributions, see npm install line above)
For JS projects, running via npx or bunx is common:
npx @biomejs/biome --versionSetup
Initialise a biome.json config file:
biome init
This creates a minimal biome.json:
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
}
}Usage
# Format all files in the project
biome format --write .
# Check formatting without modifying files (for CI)
biome format .
# Lint all files
biome lint .
# Lint and apply safe fixes automatically
biome lint --write .
# Format and lint together (the most common command)
biome check .
# Format, lint, and apply all safe fixes
biome check --write .
# Format or lint a specific file
biome format --write src/main.ts
biome lint src/main.ts
# Check only changed files (useful in pre-commit hooks)
biome check --changed
# Start the LSP server (used by editor integrations)
biome lsp-proxyConfiguration
biome.json gives fine-grained control over every aspect of formatting and
linting:
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"semicolons": "always",
"trailingCommas": "all"
}
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"noUnusedVariables": "error"
},
"style": {
"noVar": "error",
"useConst": "error"
}
}
},
"files": {
"ignore": ["node_modules", "dist", "build", ".next"]
}
}CI Integration
# GitHub Actions
- name: Run Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Check
run: biome ci .
biome ci is identical to biome check but exits with a non-zero code on any
formatting or linting issue, without modifying files.
Migrating from Prettier + ESLint
Biome provides a migration command that reads your existing .eslintrc and
.prettierrc configs and converts them to biome.json:
biome migrate eslint --write
biome migrate prettier --write
Not every ESLint plugin or Prettier option has an equivalent, but the migration command handles the common cases and tells you what it could not convert.
Why Biome over Prettier + ESLint?
- Speed — formats and lints a large TypeScript monorepo in under a second vs. tens of seconds for the Node.js equivalents
- Single dependency — one tool, one config file, one version to pin
- No plugin hell — 300+ rules built in; no need to install and reconcile a dozen ESLint plugins
- No Node.js — works in environments where Node.js is not available or not desired