用途:为 BiomeJS 配置提供快速指引,适合需要配置 Biome、扩展配置、设置覆盖规则、接入 lint-staged 或排查配置问题的场景。
主要能力:通过 npm 包导出扩展共享配置,使用项目必须自行提供 files.includes;monorepo 中工作区配置用 "//" 继承根配置。文档给出常见 files.includes 模式:库为 /.{js,json,jsonc,ts},UI/前端为 **/.{css,js,jsx,json,jsonc,ts,tsx},含 GraphQL 时增加 graphql,并用 !node_modules//*、!**/generated、!dist 排除。常见 overrides 包括测试文件放宽 noNonNullAssertion/noExplicitAny、生成文件或 ABI 关闭 useSortedKeys 与 compact 格式、以及用 noRestrictedImports 强制 barrel 导入。关键规则涵盖 noFloatingPromises、noUnusedImports、noUnusedVariables、useImportType、useSortedKeys、useSortedClasses、useFilenamingConvention 等。
使用方式:Git 钩子中常用 lint-staged 配置,例如 "*.{json,jsonc,ts,tsx}": "bun biome check --write",并单独对 ts/tsx 运行 bun biome check --write --only=correctness/noUnusedImports 以在提交时清理未用导入。UI 项目可开启 tailwindDirectives、useSortedAttributes 与 useSortedClasses。
限制与说明:需用本地 schema 引用以获得 IDE 支持;Biome 负责 JS/TS/JSON/CSS,Markdown 与 YAML 仍建议用 Prettier。v2.4+ 中 biome check 与 biome ci 支持 --only/--skip,--write 也应用格式化,配置查找支持隐藏文件与用户配置目录,并新增 formatter.trailingNewline;HTML 格式化行为变化明显。资料未提供收费、价格、平台或效果信息。