Biome 配置

安装

npx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/biome-rules.json
yarn dlx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/biome-rules.json
pnpx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/biome-rules.json
bunx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/biome-rules.json

参考

最佳实践

请根据项目需求调整配置文件内容。

  • biome.json 文件放置在项目根目录。
  • 使用 biome check 命令检查代码质量,代替eslint。
  • 使用 biome format 命令格式化代码。

package.json 示例:

{
  "scripts": {
    "lint": "biome check --write",
    "format": "biome format --write"
  }
}