Drop-in betterhook.toml configurations for common stacks. Each recipe is a
working starting point — copy it into your repo, edit the globs and tools,
and betterhook install.
Option A: copy the file. Pick the closest match, copy to your repo as
betterhook.toml, edit to taste.
cp recipes/typescript.toml /path/to/your-repo/betterhook.tomlOption B: extend it. Keep recipes versioned in your org and inherit:
extends = ["./.betterhook/typescript.toml"]
[hooks.pre-commit.jobs.lint]
glob = ["src/**/*.ts"] # override just the bits you needCross-format extends works (a TOML file can extend a YAML file).
| Recipe | Stack | Highlights |
|---|---|---|
typescript.toml |
TypeScript / JS monorepo | Prettier + ESLint + tsc, parallel, isolated eslint, sharded tsc |
rust.toml |
Rust workspace | rustfmt + clippy + cargo test, per-worktree CARGO_TARGET_DIR |
python.toml |
Python project | Ruff (lint + format) + mypy, fail-fast off |
go.toml |
Go module | gofmt + govet + go test, builtins where possible |
polyglot.toml |
Mixed-language monorepo | All four stacks above in one config, glob-routed |
betterhook explain --hook pre-commit --worktree /path/to/repoPrints the resolved DAG without executing. A non-zero exit means the config
didn't parse — exit code 2 with a miette diagnostic pointing at the line.