Override a rule or formatter setting
Settings in your own biome.json win over the ones in the config you extend. This guide shows each kind of change.
Each example was run with Biome 2.5.15.
-
Extend the preset first, then add your own keys below it.
biome.json {"extends": ["@repobuddy/biome"]} -
Change a formatter setting. Name the key the preset sets.
{"extends": ["@repobuddy/biome"],"formatter": { "indentStyle": "space", "indentWidth": 2 },"javascript": { "formatter": { "semicolons": "always" } }}With this config,
biome formatrewrites tab-indented code to two spaces. -
Change a rule level.
{"extends": ["@repobuddy/biome"],"linter": { "rules": { "suspicious": { "noExplicitAny": "warn" } } }}noExplicitAnyisoffin both presets. This sets it towarn. -
Change a rule only for some files, with
overrides.{"extends": ["@repobuddy/biome"],"overrides": [{"includes": ["scripts/**"],"linter": { "rules": { "suspicious": { "noConsole": "off" } } }}]}console.logis still an error insrc/, and allowed inscripts/. -
Change a rule’s options. State the whole option, because an option you set replaces the preset’s value.
{"extends": ["@repobuddy/biome"],"linter": {"rules": {"suspicious": {"noConsole": { "level": "error", "options": { "allow": ["log", "info"] } }}}}}With this config,
console.logis allowed andconsole.warnis an error. The preset’sallowlist ofinfo,warn,error, and others is gone.
Extending order
Section titled “Extending order”extends is an array, and later entries win over earlier ones. Your own keys, written in the same file, win over
everything in extends.
{ "extends": ["@repobuddy/biome", "./team.json"]}With ./team.json last, its settings override the preset’s. Swapping the order makes the preset override ./team.json.
Verified with suspicious/noConsole: with the preset last, the preset’s allow list applied.
See the Biome configuration reference for the full merge rules.
Verify
Section titled “Verify”Run biome check and confirm the finding you changed appears, or stops appearing, at the level you set.
Related
Section titled “Related”- recommended and performant: the settings you override
- recommended vs performant