From 60ddf80e5c8f5e0f2cf7b00778feaaa668781f2d Mon Sep 17 00:00:00 2001 From: Bee <68532117+abeatrix@users.noreply.github.com> Date: Sat, 13 Sep 2025 04:21:18 -0700 Subject: [PATCH] Remove --no-stash flag from lint-staged in pre-commit hook (#6188) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Problem The `--no-stash` flag was originally added to work around issues where teammates hadn't installed Biome after our migration from Prettier. When the formatter failed, lint-staged's default stashing behavior would remove staged changes, causing frustration. However, this workaround now causes a different problem: lint-staged runs formatters on files containing both staged AND unstaged changes. When Biome formats these files, it inadvertently stages unstaged modifications, effectively merging work-in-progress changes into commits. ### Solution Remove the `--no-stash` flag to restore lint-staged's default behavior: - Stash unstaged changes before running formatters - Run formatters only on staged content - Restore the stash after formatting This ensures that only intentionally staged changes are included in commits, preventing accidental inclusion of work-in-progress modifications. ### Context It's been sufficient time since the Prettier → Biome migration that all team members should have the proper tooling installed. The original workaround is no longer needed and is now causing more problems than it solves. --- .husky/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 0482c53c..af5adff9 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -lint-staged --no-stash +lint-staged \ No newline at end of file