Biome (ESLint + Prettier Alternative)
Use Biome as a single, fast tool for linting, formatting, and import organization - replacing both ESLint and Prettier.
Search across all documentation pages
Use Biome as a single, fast tool for linting, formatting, and import organization - replacing both ESLint and Prettier.
🤖 Read the SystemsArchitect.io Blog for over 100+ cloud architecture articles 🔥
Quick-reference recipe card - copy-paste ready.
# Install Biome
npm install --save-dev @biomejs/biome
# Initialize config
npx biome init
# Format files
npx biome format --write .
# Lint files
npx biome lint .
# Lint + format + organize imports in one command
npx biome check --write .When to reach for this: When you want a single tool that is significantly faster than ESLint + Prettier combined, with minimal configuration.
// biome.json
{
"$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
"organizeImports": {
"enabled": true
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80,
"lineEnding": "lf"
},
"javascript": {
"formatter": {
"semicolons": "always",
"quoteStyle": "double",
"trailingCommas": "all",
"arrowParentheses": "always"
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"useExhaustiveDependencies": "warn",
"noUnusedVariables": "error",
"noUnusedImports": "error"
},
"suspicious": {
"noExplicitAny": "warn"
},
"style": {
"useConst": "error",
"noNonNullAssertion": "warn"
},
"a11y": {
"useAltText": "error",
"useAnchorContent": "warn"
}
}
},
"files": {
"ignore": [
"node_modules/",
".next/",
"out/",
"coverage/",
"*.min.js"
]
}
}// package.json scripts
{
"scripts": {
"lint": "biome lint .",
"format": "biome format --write .",
"check": "biome check --write .",
"check:ci": "biome check ."
}
}What this demonstrates:
biome.json replaces both .eslintrc and .prettierrcbiome check runs lint + format + import organization in one passcorrectness, suspicious, style, a11y, complexity, performance, securityrecommended preset enables sensible defaults similar to eslint:recommended + react/recommendedMigrating from ESLint + Prettier:
# Biome can migrate your ESLint config
npx biome migrate eslint --write
# Migrate Prettier config
npx biome migrate prettier --writePerformance comparison:
| Tool | Time (1000 files) | Notes |
|---|---|---|
| ESLint + Prettier | 5 to 15 seconds | Two separate AST parses |
| Biome | 100 to 500 milliseconds | Single Rust-based parse |
IDE integration:
// .vscode/settings.json
{
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
}
}// .vscode/extensions.json
{
"recommendations": ["biomejs.biome"]
}Selective overrides per directory:
{
"overrides": [
{
"include": ["tests/**"],
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "off"
}
}
}
}
]
}// Biome understands TypeScript natively - no parser plugin needed.
// It catches:
// Unused imports
import type { User } from "@/types"; // Removed if unused
// Unused variables
const unused = "hello"; // Error: noUnusedVariables
// Explicit any
const data: any = fetch("/api"); // Warn: noExplicitAny
// Non-null assertions
const name = user!.name; // Warn: noNonNullAssertionThings that will bite you. Each gotcha includes what goes wrong, why it happens, and the fix.
No plugin ecosystem - Biome does not support third-party plugins. No equivalent of eslint-plugin-tailwindcss or eslint-plugin-testing-library. Fix: If you need Tailwind class sorting, use prettier-plugin-tailwindcss alongside Biome (Biome for linting, Prettier only for Tailwind class sorting), or accept the limitation.
No Next.js-specific rules - Biome does not include eslint-plugin-next rules (no-img-element, no-head-element, etc.). Fix: Run next lint alongside Biome for Next.js-specific checks, or accept the gap.
Different rule names - Rule names differ from ESLint (e.g., noUnusedVariables vs no-unused-vars). Fix: Use npx biome migrate eslint to convert your config automatically.
Formatting differences from Prettier - Biome aims for Prettier compatibility but is not 100% identical. Some edge cases in JSX and TypeScript formatting differ. Fix: Run npx biome format across your codebase once and review the diff. Most differences are minor.
Other ways to solve the same problem - and when each is the better choice.
| Alternative | Use When | Don't Use When |
|---|---|---|
| ESLint + Prettier | You need the full plugin ecosystem (Tailwind, testing, etc.) | Performance is a top concern |
oxlint + Prettier | You want fast linting but keep Prettier for formatting | You want a single unified tool |
dprint + ESLint | You want a fast Rust formatter with ESLint for linting | You want to reduce tooling complexity |
--write applies all fixes and formatting changes in place.--write, it only reports issues (use this mode in CI).npx biome migrate eslint --write
npx biome migrate prettier --writeThese commands convert your existing configs into biome.json equivalents.
eslint-plugin-tailwindcss or eslint-plugin-testing-library.prettier-plugin-tailwindcss alongside Biome for that single task.eslint-plugin-next equivalents (no-img-element, no-head-element, etc.).next lint alongside Biome for Next.js-specific checks.noUnusedVariables instead of no-unused-vars.correctness, suspicious, style, a11y, complexity.npx biome migrate eslint to convert rule names automatically.{
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
}
}any, and non-null assertions.npx biome format across your codebase and review the diff before committing.{
"overrides": [
{
"include": ["tests/**"],
"linter": {
"rules": {
"suspicious": { "noExplicitAny": "off" }
}
}
}
]
}correctness -- bugs and logic errors (exhaustive deps, unused variables)suspicious -- code that is likely wrong (explicit any, duplicate keys)style -- code style preferences (const, naming)a11y -- accessibility checks (alt text, ARIA)complexity -- overly complex codeperformance -- performance anti-patternssecurity -- security vulnerabilitiesReviewed by Chris St. John·Last updated Jul 10, 2026
🤖 Read the SystemsArchitect.io Blog for over 100+ cloud architecture articles 🔥