Biome 配置
Biome 代码检查和格式化配置
安装
npx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/biome-rules.jsonyarn dlx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/biome-rules.jsonpnpx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/biome-rules.jsonbunx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/biome-rules.json框架适配
Next.js 项目:添加 next domain
{
"linter": {
"domains": {
"next": "recommended",
"react": "recommended"
}
}
}TanStack 项目:默认配置即可(仅 react domain)
特性
- useSortedClasses:自动排序 Tailwind CSS 类名
- organizeImports:自动整理 import 语句
- tailwindDirectives:支持
@tailwind等指令
使用
package.json 示例:
{
"scripts": {
"lint": "biome check --write"
}
}