Skip to content

Commit 4a40e31

Browse files
committed
Set up pre-commit hooks for prettier
1 parent 8f75101 commit 4a40e31

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hooks/pre-commit

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ do
99
# Get staged content of the file
1010
staged_content=$(git show ":$file")
1111

12+
# Format staged files
13+
npx prettier --write $file
14+
1215
# Run ESLint with the staged content and filename
1316
# echo "$staged_content" | npm run eslint -- --stdin
1417
npx eslint $file
@@ -20,4 +23,4 @@ done
2023

2124
if [ $flag -eq 1 ]; then
2225
exit 1
23-
fi
26+
fi

0 commit comments

Comments
 (0)