Biomeは、Rust製の次世代Lint+Formatterで、ESLint・Prettierを統合した代替として注目を集めています。設定が一元化されており、爆速で動くのが特徴です。本記事では、BiomeとESLintを比較し、選び方を解説します。
Biomeとは
Rome(旧プロジェクト)の後継として誕生したRust製のツール群です。Linter・Formatter・Importsの整理などをまとめて担い、JavaScript / TypeScript / JSON / Vue / Astro / Svelteなどに対応しています。
項目別比較
- 速度:Biomeが10〜100倍速い(Rust製)
- 設定:BiomeはJSON1ファイル、ESLintはルール群+プラグイン
- ルール数:ESLintが圧倒的に多い(プラグインで無限)
- エコシステム:ESLintが歴史長く広範
- Format同梱:BiomeはPrettier相当を内包
導入手順
npm i -D --save-exact @biomejs/biome
npx biome init
# Lint
npx biome lint .
# Format
npx biome format --write .
# Lint + Format + Import整理
npx biome check --write .
設定ファイル例
// biome.json
{
"$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
"formatter": {
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"linter": {
"rules": { "recommended": true }
},
"javascript": {
"formatter": { "quoteStyle": "single", "semicolons": "always" }
}
}
選び方の指針
- 新規プロジェクト・速度重視:Biome(設定一元・爆速)
- 既存ESLint資産・特殊ルール:ESLint継続
- Reactなど特殊フレームワーク向けルール多用:ESLint
- シンプル運用・少人数:Biome
段階的移行のコツ
- FormatterだけBiomeに置き換える(Prettierと互換性高い)
- Lintは既存ESLintを残し、徐々にBiomeへ
- biome migrate eslint コマンドで設定移行を支援
注意点
- React-specific ルール(react-hooksなど)は段階的サポート
- 独自プラグインはまだ少なめ
- エコシステム拡張はESLintに分がある
まとめ
Biomeは「速い・設定が楽・Lint+Format統合」が大きな魅力。新規や中小規模プロジェクトならBiome、ESLint資産が大きいなら段階移行が現実的です。今後のJS/TSエコシステムで存在感が増す注目ツールです。