Skip to content

Commit

Permalink
Add pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
maxidragon committed Sep 20, 2023
1 parent 2321eb0 commit 6c95918
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Change to the frontend directory
cd frontend

# Run prettier
npm run format

# Run ESLint
npm run lint

# Capture the exit code of the previous command
result=$?

# If the exit code is non-zero, exit with that code to prevent the commit
if [ $result -ne 0 ]; then
echo "Pre-commit checks failed. Commit aborted."
exit $result
fi

0 comments on commit 6c95918

Please sign in to comment.