Skip to content

Commit

Permalink
Adds pre-commit hook for linting (#146)
Browse files Browse the repository at this point in the history
* ➕ ADDS: pre-commit hook

* 💫 UPDATE: pre-commit hook to not run during rebase
  • Loading branch information
mehmoodak authored Oct 4, 2024
1 parent 8baa63d commit f150571
Show file tree
Hide file tree
Showing 4 changed files with 847 additions and 109 deletions.
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if [ -d "$(git rev-parse --git-path rebase-merge)" ] || [ -d "$(git rev-parse --git-path rebase-apply)" ]; then
echo "Rebase in progress. Skipping pre-commit hook.\n";
exit 0;
fi

lint-staged
6 changes: 6 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"*.css": [ "npm run lint:css" ],
"*.{js,jsx,ts,tsx}": [ "npm run lint:js" ],
"*.php": [ "npm run lint:php" ],
"*.{js,json,jsx,md,ts,tsx,yml,yaml}": [ "npm run format:check" ]
}
Loading

0 comments on commit f150571

Please sign in to comment.