@biomejs/biome
Biome is a formatter and linter for JavaScript, TypeScript, JSX, JSON, CSS, and GraphQL shipped as a single fast native binary written in Rust. The formatter scores 97% compatibility with Prettier; the linter carries more than 500 rules ported from ESLint, typescript-eslint, and other sources, with detailed diagnostics and safe autofixes. It is built for editor-first use through LSP and replaces the usual ESLint plus Prettier plus plugin stack with one tool and one config file.
The strongest single-tool replacement for the ESLint plus Prettier stack today: one fast binary, one config, very good defaults. Check the rule and plugin coverage against your current setup before migrating, because that gap is the whole decision.
Use it if
- You want to collapse ESLint, Prettier, and their config sprawl into one tool with a single biome.json
- Lint and format time in CI or pre-commit hooks is a real cost on a large codebase or monorepo
- You want sane defaults without assembling plugins; biome check --write formats, lints, and organizes imports in one pass
- You need the same binary in the editor, in scripts, and in CI (biome ci), including machines without Node.js
- Your lint setup depends on ESLint plugins with no Biome equivalent, including custom in-house rules written for ESLint's API
- You rely on the full depth of type-aware linting from typescript-eslint; Biome's type inference covers a narrower slice
- You format languages Biome does not handle, such as Markdown or YAML, so you would keep Prettier anyway and end up running both tools
- Your team treats formatting diffs as sacred: 97% Prettier compatibility means some files will change on migration, so budget a one-shot reformat commit
Setup reality
npm install --save-dev --save-exact @biomejs/biome fetches a platform-specific native binary, and biome init writes a starter biome.json. biome migrate eslint --write and biome migrate prettier --write translate existing configs, but rule mapping is not one-to-one, so expect a triage pass of re-enabling rules and adding suppressions. In editors you must disable the ESLint and Prettier extensions or they will fight Biome over formatting. The README's --save-exact hint matters: formatter and rule output can shift between releases, so pin it.
Patterns
Format files in placeformat-files
npx @biomejs/biome format --writeWithout --write it only prints the diff and exits non-zero when files would change.
Lint and apply safe fixeslint-fix
npx @biomejs/biome lint --write--write applies only fixes marked safe; add --unsafe to apply the rest, and review that diff.
Format, lint, and organize imports in one passcheck-all
npx @biomejs/biome check --writecheck is the everyday command; it runs the formatter, linter, and assist actions together.
Fail CI on formatting or lint issuesci-check
npx @biomejs/biome cici never writes files and exits non-zero on any diagnostic, which is exactly what you want in a pipeline.
Create a starter biome.jsoninit-config
npx @biomejs/biome initBiome works with zero config; init just gives you a file with the schema reference to grow into.
Import an existing ESLint or Prettier configmigrate-eslint
npx @biomejs/biome migrate eslint --write
npx @biomejs/biome migrate prettier --writeRules without a Biome equivalent are dropped silently, so diff the generated biome.json against expectations.
Turn individual lint rules on or offconfigure-rules
{
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": { "noExplicitAny": "off" },
"style": { "useConst": "error" }
}
}
}Rules live in groups (suspicious, style, correctness, and so on) with severities off, warn, or error.
Suppress a rule on one linesuppress-line
// biome-ignore lint/suspicious/noExplicitAny: third-party payload is untyped
const data: any = JSON.parse(raw);The full rule path is required and the explanation after the colon is expected; biome-ignore-all at the top of a file covers the whole file.
Scope which files Biome touchesignore-files
{
"files": {
"includes": ["src/**", "!**/generated/**", "!**/dist/**"]
}
}Biome 2 replaced separate ignore lists with includes plus ! negation patterns; older files.ignore configs need biome migrate.
Respect .gitignore automaticallyvcs-gitignore
{
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}With useIgnoreFile on, build output ignored by git stays out of lint runs without duplicating globs in biome.json.
Enable import sortingorganize-imports
{
"assist": {
"actions": {
"source": { "organizeImports": "on" }
}
}
}In Biome 2 import sorting is an assist action that runs during check, not a standalone command.
Alternatives
| Package | Registry | Pick it when |
|---|---|---|
| eslint | npm | You depend on its plugin ecosystem or need custom rules beyond what Biome has ported |
| prettier | npm | You only want formatting, with the widest language and ecosystem coverage including Markdown and YAML |
| oxlint | npm | You want a fast native linter but plan to keep Prettier as your formatter |