From 6a3d22f3c766e9a87489db8774e3ebc81a999ebb Mon Sep 17 00:00:00 2001 From: Stefan Lew Date: Tue, 26 May 2026 19:19:07 +0200 Subject: [PATCH] feat: add hooks.biome.settings.flags for extra CLI flags Mirrors the existing 'black' hook pattern so users can pass arbitrary CLI flags such as --no-errors-on-unmatched (commonly needed when staged files are all excluded by biome's own config, e.g. dep-only or generated- file-only commits). Unblocks workarounds that override hooks.biome.entry via lib.mkForce. --- modules/hooks.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/hooks.nix b/modules/hooks.nix index d1bf0191..722580d9 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -216,6 +216,13 @@ in # underlying biome binary (i.e biome.json if exists) default = ""; }; + + flags = mkOption { + type = types.str; + description = "Additional flags passed to biome. See all available [here](https://biomejs.dev/reference/cli/)."; + default = ""; + example = "--no-errors-on-unmatched"; + }; }; }; }; @@ -2669,6 +2676,7 @@ in mkCmdArgs [ [ (hooks.biome.settings.write) "--write" ] [ (hooks.biome.settings.configPath != "") "--config-path ${hooks.biome.settings.configPath}" ] + [ (hooks.biome.settings.flags != "") hooks.biome.settings.flags ] ]; in "${binPath} check ${cmdArgs}";