SuperAPI AI 工具集

biome-tooling

通用与其它

查看项目

更新于 10-15 23:49

技能介绍

用途:Biome 是面向 JavaScript、TypeScript、JSX、TSX、JSON、CSS 的一体化工具链,整合格式化、Lint 与导入排序,适合新 JS/TS 项目、需要快速 CI/CD 流水线,或从 ESLint+Prettier 迁移的场景。若需要特定 ESLint 插件(如 React hooks、a11y)、复杂自定义规则或框架专属规则(Next.js、Nuxt),资料建议改用其他方案,或采用混合方式:Biome 负责格式化,ESLint 负责专门 Lint。

主要能力:零配置即可使用;用 Rust 编写并并行处理文件;格式化与 Prettier 兼容度达 97% 以上。规则类别包括 recommended、correctness、suspicious、style、complexity、performance、a11y、security。

安装与用法:项目本地安装用 bun add --dev @biomejs/biome,验证用 bunx biome --version,初始化配置用 bunx biome init。常用命令:bunx biome format --write src/、bunx biome lint --write src/、bunx biome check --write src/、bunx biome check src/、bunx biome ci src/。迁移命令:bunx biome migrate eslint --write、bunx biome migrate prettier --write。解释规则:bunx biome explain noUnusedVariables。

配置:可在 biome.json 中设置 vcs、files.ignore、formatter、linter、organizeImports 等;也可通过 vcs.useIgnoreFile 自动读取 .gitignore。常用标志有 --write、--reporter=github、--reporter=json、--diagnostic-level=error、--max-diagnostics=N、--verbose、--no-errors-on-unmatched。

限制:资料未提供收费、价格、平台支持范围等细节;性能对比数据来自资料所述,实际效果可能因环境而异。