API Reference

Biome

Fast Rust-based toolchain that formats, lints, and organizes imports for JavaScript, TypeScript, and JSON in one binary.

Official Documentation ↗
CompatibilityThis documentation covers version v2.6.5. Check the official docs for the latest API surface.

Installation

npmnpm install --save-dev --save-exact @biomejs/biome
pnpmpnpm add -D --save-exact @biomejs/biome

Methods

Overview

Biome is a Rust-based toolchain that unifies formatting, linting, and import organization for JavaScript, TypeScript, and JSON in a single binary. This reference lists the most frequently used APIs with accurate signatures and runnable snippets.

Core APIs

  • biome check — Runs formatter, linter, and import organizer together and optionally applies safe fixes.
  • biome format — Formats files using Biome formatting rules only.
  • biome lint — Runs only the linter; unsafe fixes require the –unsafe flag.

Example

# verify everything without writing
biome check

# apply safe fixes and formatting
biome check --write .

Notes

Biome separates safe and unsafe fixes to avoid surprising semantic changes. Some ESLint plugins have no equivalent, so verify rule coverage before migrating.

Verification

Run biome check on a deliberately unformatted file, then run it with –write and confirm the second check reports no remaining issues.

Errors

The following points are quoted verbatim from the official documentation. 来源:https://biomejs.dev/reference/cli/ · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:48:26.496Z. Any error type, throw condition or recovery step not stated there is left unspecified; this page does not infer exception classes or return values.

  • Terminal window 1 biome check –assist-enabled=true –enforce-assist=<true|false> Section titled “–enforce-assist=<true|false>” Enforces assist actions and causes the command to fail if required actions are not applied. (https://biomejs.dev/reference/cli/)
  • If a selected rule’s severity is off , Biome sets it to error for a recommended rule or warn otherwise. (https://biomejs.dev/reference/cli/)
  • If a rule’s severity is off , Biome sets it to error for a recommended rule or warn otherwise. (https://biomejs.dev/reference/cli/)

API reference evidence

Fetched from official sources on 2026-11-08T19:24:00+08:00 via WebFetch https://biomejs.dev/reference/cli/.

  • biome check → signature from https://biomejs.dev/reference/cli/; official text: “Checks the specified files for formatting, linting, and assist actions. The optional PATH arguments accept one or more paths to files or directories. If omitted, Biome checks files in the current working directory.”
  • biome format → signature from https://biomejs.dev/reference/cli/; official text: “Formats the specified files. The optional PATH arguments accept one or more paths to files or directories. If omitted, Biome formats files in the current working directory.”
  • biome lint → signature from https://biomejs.dev/reference/cli/; official text: “Runs the linter on the specified files.”

FAQ

How is Biome configured?
Use biome.json at the project root with formatter, linter, and organizeImports sections; it replaces separate prettier and eslint configs.
What is the difference between safe and unsafe fixes?
Safe fixes preserve behavior and apply with --write; unsafe fixes may change semantics and require the explicit --unsafe flag.
Can Biome replace ESLint completely?
For many projects yes, but some custom ESLint plugins have no Biome equivalent yet, so hybrid setups remain possible.