Skip to content

Commit 0fade12

Browse files
authored
Format files before commit (RooCodeInc#4155)
Instead of doing a prettier check in the pre-commit, just format the staged changes. Use the package lint-stage to handle only formatting staged changes.
1 parent a4bf34f commit 0fade12

File tree

3 files changed

+799
-17
lines changed

3 files changed

+799
-17
lines changed

.husky/pre-commit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ npm run lint || {
99

1010
# Run Prettier
1111
echo "Running Prettier..."
12-
npm run format || {
13-
echo "❌ Prettier check failed. Run 'npm run format:fix' to automatically fix formatting issues."
14-
exit 1
15-
}
12+
npx lint-staged --verbose || {
13+
echo "❌ Prettier failed. Please fix the errors and try committing again."
14+
exit 1
15+
}
1616

1717
echo "✅ All checks passed!"

0 commit comments

Comments
 (0)