Skip to content

TL-M0-06 · Biome

Why: Biome formats and lints the whole repository from one config at the root (D6). The config turns on the Next.js and React rules, and blocks direct Postgres drivers and ORMs outside tools/ (D4).

ID TL-M0-06 · Level L0 · Run order row 6

pnpm lint checks the repository with Biome 2.5.15 and passes.

TL-M0-05 is Done.

Terminal window
pnpm add -Dw -E @biomejs/biome@2.5.15

2 · Write the config. The setopt line stops zsh from treating the ! characters in the file as history commands

Section titled “2 · Write the config. The setopt line stops zsh from treating the ! characters in the file as history commands”
Terminal window
setopt no_bang_hist
cat > biome.json <<'EOF'
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "main"
},
"files": {
"ignoreUnknown": true,
"includes": ["**", "!**/*.svg", "!packages/db-types/src/database.ts"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"linter": {
"enabled": true,
"rules": {
"preset": "recommended",
"style": {
"noRestrictedImports": {
"level": "error",
"options": {
"paths": {
"pg": "Apps never connect to Postgres directly; use @supabase/ssr.",
"postgres": "Apps never connect to Postgres directly; use @supabase/ssr.",
"drizzle-orm": "No ORM in v2 (D4)."
}
}
}
}
},
"domains": {
"next": "recommended",
"react": "recommended"
}
},
"overrides": [
{
"includes": ["tools/**"],
"linter": { "rules": { "style": { "noRestrictedImports": "off" } } }
}
],
"assist": {
"enabled": true,
"actions": { "source": { "organizeImports": "on" } }
}
}
EOF

3 · Root scripts, then check the repository

Section titled “3 · Root scripts, then check the repository”
Terminal window
pnpm pkg set scripts.lint="biome check ." scripts.format="biome check --write ."
pnpm lint
Terminal window
git add -A
git commit -m "build: add Biome"
  • Block 1: “+ @biomejs/biome 2.5.15”.
  • Block 3: “Checked … files in …ms. No fixes applied.”
  • Block 4: the commit line.
Terminal window
pnpm biome --version
pnpm biome ci .
echo $?

Version: 2.5.15, then “No fixes applied”, then 0.

  • “zsh: event not found”: the setopt line was skipped. Run it, then paste block 2 again.
  • Biome reports a configuration error: check the version first (the config was tested with 2.5.15), then paste the error.
Terminal window
git reset --hard HEAD~1
pnpm install

Done 2026-10-05 (zuki)