← 返回命令列表

Linux command

biome 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Initialize Biome in a project

biome init

Check code for errors

biome check [path/to/directory]

Format code

biome format --write [path/to/directory]

Lint code and show issues

biome lint [path/to/directory]

Fix auto-fixable lint issues

biome lint --write [path/to/directory]

Check a single file

biome check [path/to/file.js]

Output in JSON format

biome check --reporter=json [path/to/directory]

CI mode

biome ci [path/to/directory]

说明

Biome is a fast code formatter, linter, and more for JavaScript, TypeScript, JSON, and CSS. It is designed as a unified toolchain to replace ESLint, Prettier, and other tools with a single, faster alternative. Written in Rust, Biome provides exceptional performance - often 10-100x faster than JavaScript-based alternatives. It requires minimal configuration, with sensible defaults out of the box while remaining highly customizable through biome.json. The tool integrates formatting and linting into a single pass, reducing overhead. Editor integrations provide real-time feedback, and the CLI supports various output formats for CI systems.

参数

init
Create a biome.json configuration file.
check
Run linter and formatter checks.
format
Format source files.
lint
Lint source files.
ci
Check for CI environments (stricter mode).
migrate
Migrate from other tools (ESLint, Prettier).
--write
Apply fixes and formatting to files.
--reporter _format_
Output format: summary, json, github, gitlab.
--config-path _path_
Path to configuration file.
--vcs-enabled _bool_
Use VCS ignore files (.gitignore).
--no-errors-on-unmatched
Don't error if no files match.
--diagnostic-level _level_
Minimum severity: info, warn, error.

FAQ

What is the biome command used for?

Biome is a fast code formatter, linter, and more for JavaScript, TypeScript, JSON, and CSS. It is designed as a unified toolchain to replace ESLint, Prettier, and other tools with a single, faster alternative. Written in Rust, Biome provides exceptional performance - often 10-100x faster than JavaScript-based alternatives. It requires minimal configuration, with sensible defaults out of the box while remaining highly customizable through biome.json. The tool integrates formatting and linting into a single pass, reducing overhead. Editor integrations provide real-time feedback, and the CLI supports various output formats for CI systems.

How do I run a basic biome example?

Run `biome init` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does init do in biome?

Create a biome.json configuration file.