Biome
Fast formatter, linter, and code-assist toolchain for JavaScript, TypeScript, JSON, CSS, GraphQL, and modern web projects.
Installation & Setup
Install a pinned Biome release and create the project configuration.
Install the native Biome CLI as an exact development dependency.
npm i -D -E @biomejs/biome
npx @biomejs/biome versionGenerate biome.json, then enable the shared project defaults.
{
"$schema": "https://biomejs.dev/schemas/2.5.6/schema.json",
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"linter": {
"enabled": true,
"rules": {
"preset": "recommended"
}
}
}Core Commands
Run formatting, linting, and Assist checks from one CLI.
Choose the combined command or run each tool independently.
# Format, lint, and run Assist checks
npx @biomejs/biome check .
# Run one tool only
npx @biomejs/biome format .
npx @biomejs/biome lint .Apply fixes deliberately and limit work to relevant Git changes.
# Apply formatting and safe fixes
npx @biomejs/biome check --write .
# Include fixes that may change behavior
npx @biomejs/biome check --write --unsafe .Formatter
Configure consistent formatting globally and per language.
Set indentation, line width, line endings, and EditorConfig behavior.
{
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100,
"lineEnding": "lf"
}
}Override JavaScript, JSON, and CSS formatting or parser options.
{
"javascript": {
"formatter": {
"quoteStyle": "single",
"semicolons": "asNeeded",
"trailingCommas": "all"
}
},
"json": {
"formatter": {
"trailingCommas": "none"
}
}
}Linter Rules
Choose a stable rule preset and tune rule severity.
Start from a preset, then adjust groups and individual rules.
{
"linter": {
"enabled": true,
"rules": {
"preset": "recommended",
"suspicious": {
"noExplicitAny": "warn"
},
"style": {
"useConst": "error"
}
}
}
}Enable rules that understand frameworks, tests, and project structure.
{
"linter": {
"domains": {
"react": "recommended",
"test": "recommended",
"project": "recommended"
}
}
}Assist Actions
Configure safe source transformations alongside linting and formatting.
Sort, merge, and group imports with the recommended source action.
{
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}Enable opt-in sorting actions for common JavaScript structures.
{
"assist": {
"actions": {
"source": {
"useSortedAttributes": "on",
"useSortedEnumMembers": "on",
"useSortedInterfaceMembers": "on",
"useSortedKeys": "on"
}
}
}
}Files & Version Control
Control the project file set and integrate checks with Git.
Use ordered glob patterns to define what Biome processes or scans.
{
"files": {
"includes": [
"src/**",
"tests/**",
"!**/*.generated.ts",
"!!**/dist",
"!!**/coverage"
],
"ignoreUnknown": true
}
}Read Git ignore files and define the comparison branch for focused checks.
{
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "main"
}
}Suppressions
Document narrow exceptions without weakening a rule globally.
Suppress a diagnostic for one line, one file, or a bounded range.
// Suppress the next line
// biome-ignore lint/suspicious/noDebugger: browser debugging session
debugger;Overrides & Language Support
Apply targeted settings and opt into experimental language support carefully.
Change formatter and linter behavior for tests, generated code, or scripts.
{
"overrides": [
{
"includes": ["**/*.test.ts", "**/*.spec.ts"],
"linter": {
"domains": {
"test": "recommended"
},
"rules": {
"suspicious": {
"noExplicitAny": "off"
}
}
}
}
]
}Know which file types are stable and which require explicit opt-in.
{
"html": {
"experimentalFullSupportEnabled": true
}
}Editor Integration
Use the official VS Code extension for formatting and fixes on save.
Select Biome as the formatter and apply safe actions explicitly on save.
{
"[javascript][typescript][javascriptreact][typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
},
"editor.codeActionsOnSave": {
"source.fixAll.biome": "explicit",
"source.organizeImports.biome": "explicit"
}
}Migration
Convert existing ESLint and Prettier configuration into Biome.
Translate supported ESLint settings, plugins, ignores, and rules.
# Preview the migration
npx @biomejs/biome migrate eslint
# Write the converted configuration
npx @biomejs/biome migrate eslint --writeConvert supported Prettier options and ignore patterns.
# Preview the migration
npx @biomejs/biome migrate prettier
# Write the converted configuration
npx @biomejs/biome migrate prettier --writeMonorepos
Share root settings while allowing package-specific configuration.
Extend the root config from packages with the Biome v2 microsyntax.
{
"$schema": "https://biomejs.dev/schemas/2.5.6/schema.json",
"linter": {
"rules": {
"preset": "recommended"
}
},
"formatter": {
"lineWidth": 100
}
}Continuous Integration
Run non-writing checks locally and in hosted CI systems.
Run CI-focused checks with annotations and no write option.
# Check the complete repository
npx @biomejs/biome ci .
# Fail when warnings are present
npx @biomejs/biome ci --error-on-warnings .Install a pinned Biome binary with the first-party setup action.
name: Code quality
on:
pull_request:
push:
jobs:
biome:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- uses: biomejs/setup-biome@v2
with:
version: 2.5.6
- run: biome ci .Troubleshooting
Inspect configuration, diagnostics, daemon state, and slow project scans.
Use built-in reports and tracing before changing project rules.
# Show version and platform information
npx @biomejs/biome version
# Print a debugging report
npx @biomejs/biome rage
# Explain a diagnostic or daemon topic
npx @biomejs/biome explain noDebugger
npx @biomejs/biome explain daemon-logs