Biome is a toolchain for the web: formatter, linter and more
npx @tessl/cli install tessl/npm-biomejs--biome@2.3.0Biome is a performant toolchain for web projects that provides fast formatting, linting, and code quality tools in a single unified package. Built on a Rust core for maximum performance, Biome offers 97% compatibility with Prettier for formatting and includes over 340 linting rules from ESLint, typescript-eslint, and other sources. It's designed for interactive use within editors with LSP support and can format and lint malformed code in real-time with detailed diagnostics.
npm install --save-dev --save-exact @biomejs/biomeBiome is invoked via the biome command-line interface. The CLI provides multiple commands for different workflows.
# Format files
npx @biomejs/biome format --write ./src
# Lint files and apply safe fixes
npx @biomejs/biome lint --write ./src
# Run format, lint, and import sorting with safe fixes
npx @biomejs/biome check --write ./src
# Check all files in CI (read-only mode)
npx @biomejs/biome ci ./srcBiome uses a biome.json or biome.jsonc configuration file:
{
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
}
}# Initialize a new Biome project
npx @biomejs/biome init
# Format and lint a project
npx @biomejs/biome check --write
# Run checks in CI environment
npx @biomejs/biome ciBiome consists of several key components:
Primary commands for formatting, linting, and checking code.
# Format files
biome format [OPTIONS] [PATHS]...
# Lint files
biome lint [OPTIONS] [PATHS]...
# Run formatter, linter, and import sorting
biome check [OPTIONS] [PATHS]...
# CI mode (read-only)
biome ci [OPTIONS] [PATHS]...Initialize, migrate, and manage Biome configuration.
# Initialize new project
biome init [--jsonc]
# Migrate from other tools
biome migrate [prettier|eslint] [OPTIONS]Configuration file structure:
interface BiomeConfiguration {
$schema?: string;
root?: boolean;
extends?: string[];
files?: FilesConfiguration;
formatter?: FormatterConfiguration;
linter?: LinterConfiguration;
assist?: AssistConfiguration;
javascript?: JavaScriptConfiguration;
json?: JsonConfiguration;
css?: CssConfiguration;
graphql?: GraphqlConfiguration;
html?: HtmlConfiguration;
vcs?: VcsConfiguration;
overrides?: OverrideConfiguration[];
plugins?: string[];
}Options available across most commands for controlling output, diagnostics, and behavior.
# Color control
--colors <off|force>
# Configuration path
--config-path <PATH>
# Verbosity
--verbose
--max-diagnostics <none|NUMBER>
--diagnostic-level <info|warn|error>
# Error handling
--skip-parse-errors
--error-on-warnings
--no-errors-on-unmatched
# Reporting format
--reporter <json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>
# Logging
--log-file <PATH>
--log-level <none|debug|info|warn|error>
--log-kind <pretty|compact|json>
# Server mode
--use-serverEnvironment variables that control Biome's behavior.
# Biome-specific
BIOME_CONFIG_PATH # Path to configuration file
BIOME_BINARY # Override native binary path
BIOME_LOG_PATH # Daemon log directory
BIOME_LOG_PREFIX_NAME # Log file prefix
BIOME_THREADS # Thread count
# Standard variables
NO_COLOR # Disable color output
TERM # Terminal typeAdditional capabilities for debugging, search, and server management.
# Search with GritQL patterns (experimental)
biome search <PATTERN> [PATHS]...
# Print debugging information
biome rage [OPTIONS]
# Show rule documentation
biome explain <RULE_NAME>
# Daemon server management
biome start [OPTIONS]
biome stop
# LSP server
biome lsp-proxy [OPTIONS]
# Clean daemon logs
biome cleanBiome uses standard Unix exit codes:
Exit code behavior:
--error-on-warnings, warnings result in exit code 1--no-errors-on-unmatched) results in exit code 1Biome supports formatting and linting for:
.js, .mjs, .cjs).ts, .mts, .cts).jsx, .tsx).json, .jsonc).css).graphql, .gql).html, .htm).vue - with caveats).astro - with caveats).svelte - with caveats)Biome provides native binaries for:
The npm package automatically installs the appropriate binary for your platform via optional dependencies.