Biome — Fast Linter & Formatter for JS/TS
One Rust-powered tool replaces ESLint + Prettier. 200+ lint rules, instant formatting. 97% Prettier compatible. 24K+ GitHub stars.
Agent 可直接安装
这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。
npx -y tokrepo@latest install f6018b95-6783-42f1-8c39-a0d199f94504 --target codex先 dry-run 确认安装计划,再运行此命令。
What it is
Biome is a Rust-powered toolchain that replaces ESLint and Prettier with a single, fast tool. It formats and lints JavaScript, TypeScript, JSX, TSX, JSON, and CSS with 200+ lint rules and 97% Prettier compatibility. By parsing code once instead of twice (once for linting, once for formatting), Biome achieves significant speed improvements over the traditional ESLint + Prettier setup.
Biome targets JavaScript and TypeScript teams who want faster, simpler code quality tooling. It provides zero-config defaults, a VS Code extension, and built-in import sorting.
How it saves time or tokens
Biome processes files 25x faster than ESLint + Prettier combined because it runs in Rust and parses each file only once. The biome check --write command applies both formatting and lint fixes in a single pass. Zero-config defaults mean new projects get sensible rules immediately without configuring multiple tools.
How to use
- Install Biome:
npm install --save-dev --save-exact @biomejs/biome. - Initialize configuration:
npx @biomejs/biome init(creates biome.json). - Run formatting and linting:
npx biome check --write ..
Example
{
"$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
"formatter": {
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"organizeImports": {
"enabled": true
}
}
# Format all files
npx biome format --write .
# Lint all files
npx biome lint .
# Both at once
npx biome check --write .
Related on TokRepo
- AI Tools for Coding -- explore coding quality tools for JavaScript and TypeScript
- Automation Tools -- discover automated code quality workflows
Common pitfalls
- Biome does not yet support all ESLint plugins; check compatibility before migrating projects that rely on framework-specific rules like eslint-plugin-react-hooks.
- The 97% Prettier compatibility means 3% of edge cases format differently; run a diff comparison before committing to the migration.
- Biome's CSS support is newer and less mature than its JavaScript/TypeScript support; test CSS formatting thoroughly.
常见问题
Biome combines linting and formatting into one tool, runs 25x faster due to Rust and single-pass parsing, and requires less configuration. ESLint has a larger plugin ecosystem and more community rules.
Yes, 97% compatible. Biome aims to produce identical output to Prettier for most code. The remaining 3% involves edge cases in comment handling and some expression formatting.
Yes. The official Biome VS Code extension provides format-on-save, inline lint diagnostics, and quick-fix actions, similar to the ESLint and Prettier extensions.
Yes. Biome provides a migration command that translates your existing ESLint config into Biome rules. You can run both tools during the transition period and compare results.
Biome supports JavaScript, TypeScript, JSX, TSX, JSON, and CSS. Support for additional languages like HTML and GraphQL is planned.
引用来源 (3)
- Biome GitHub— Biome is a Rust-powered toolchain replacing ESLint and Prettier
- Biome Docs— Biome documentation and configuration reference
- Prettier Docs— Prettier code formatting specification
来源与感谢
讨论
相关资产
fnm — Fast and Simple Node.js Version Manager
fnm (Fast Node Manager) is a blazing-fast Node.js version manager built in Rust. It installs and switches Node.js versions instantly, supports .node-version and .nvmrc files, and is 40x faster than nvm with cross-platform support.
SQLFluff — Modular SQL Linter and Auto-Formatter
A configurable SQL linter and formatter supporting over 20 SQL dialects, designed to enforce style rules and catch errors in data pipelines.
golangci-lint — Fast Go Linter Aggregator
A fast linters runner for Go that executes dozens of linters in parallel with shared analysis results, replacing the need to manage individual linter binaries.
Hexo — Fast Node.js Blog Framework with Plugin Ecosystem
Hexo is a fast, simple, and extensible blog framework powered by Node.js. It renders Markdown posts into static HTML in seconds and supports hundreds of themes and plugins.