We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 160a25a commit 84a286cCopy full SHA for 84a286c
.husky/pre-commit
@@ -1,3 +1,11 @@
1
-#!/usr/bin/env sh
+#!/bin/sh
2
+FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
3
+[ -z "$FILES" ] && exit 0
4
-npm run format
5
+# Prettify all selected files
6
+echo "$FILES" | xargs ./node_modules/.bin/prettier --ignore-unknown --write
7
+
8
+# Add back the modified/prettified files to staging
9
+echo "$FILES" | xargs git add
10
11
+exit 0
0 commit comments