Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm install
18 changes: 1 addition & 17 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
#!/bin/sh
if npm list prettier | grep -q prettier@ ; then
echo husky - prettier is installed
else
echo husky - prettier is not installed, skipping format check
exit 0
fi

# run prettier on all .ts files that are in the commit
changed=$(git diff --diff-filter=ACM --cached --name-only | grep .ts$ | tr '\n' ' ')

if [ -z "$changed" ]; then
echo husky - No modified files to check
exit 0
fi

npx prettier $changed --check
npm exec lint-staged
5 changes: 5 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
branch_name="$(git symbolic-ref --short HEAD)"
if [ "$branch_name" = "main" ]; then
echo "Pushing directly to main is not allowed."
exit 1
fi
Loading