Skip to content

Commit

Permalink
Merge pull request #53 from frankiefab100/add-git-hooks
Browse files Browse the repository at this point in the history
feat: add git hooks (#52)
  • Loading branch information
frankiefab100 committed Jul 9, 2023
2 parents fbd382c + 6a68aa4 commit 54c3668
Show file tree
Hide file tree
Showing 6 changed files with 6,234 additions and 1,316 deletions.
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx commitlint --edit
11 changes: 11 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged

branch="$(git rev-parse --abbrev-ref HEAD)"

if [ "$branch" = "main" ]; then
echo "You can't commit directly to \"$branch\" branch"
exit 1
fi
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
};
5 changes: 5 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
"*.{js,jsx}": ["prettier --write"],
"*.{css,scss,html,json,graphql}": ["prettier --write"],
"*.{yaml,yml}": ["prettier --write"],
};
Loading

1 comment on commit 54c3668

@vercel
Copy link

@vercel vercel bot commented on 54c3668 Jul 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.