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.
domainsstring[]noneRoot config only: globs naming directories that own their own config and baseline.
namestringthe directoryA domain's name in output and for --domain.

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.

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.