Skip to content

Configuration

Configuration is optional. Without a bonsai-lint.toml anywhere, every language gets the default threshold and the scan behaves exactly as --over 15 would.

KeyTypeDefaultMeaning
thresholdinteger15Fail above this score. A per-language section overrides it.
excludestring[][]Globs, relative to the config's own directory.
toplevelbooleantrueScore code outside any function as <toplevel>.
baselinepath.bonsai-lint-baseline.jsonWhere this directory's baseline lives, relative to it.
strict-baselinebooleanfalseFail when the baseline has an entry looser than the code, as --strict-baseline does everywhere. A domain without it takes the root's, and with --baseline PATH the root's decides.
domainsstring[]noneRoot config only: globs naming directories that own their own config and baseline.
namestringits path from the rootA domain's name in output and for --domain. Two domains cannot share one.

A table named after a language id overrides the threshold for that language alone. The id is the same string --lang and --over LANG=N take.

Terminal window
threshold = 15
exclude = ["vendor/**", "**/*.generated.ts"]
[typescript]
threshold = 20
KeyTypeDefaultMeaning
thresholdintegerinheritedOverrides the domain's threshold for this language only.

A misspelt key fails to parse rather than falling back silently. A stray thresold = 20 stops the run instead of leaving you believing a threshold is in force when it isn’t.

A negated glob (!pattern) is rejected outright rather than being matched literally.