Skip to content

Commit

Permalink
feat : enforce linting / formatting standards (#80)
Browse files Browse the repository at this point in the history
 - enforce linting / formatting standards (#80) by using husky hooks the linting enforced before pushing
  • Loading branch information
abdrahmanES1 authored and dillionverma committed Jul 1, 2024
1 parent 8a5a1e5 commit be01769
Show file tree
Hide file tree
Showing 3 changed files with 321 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BRANCH_NAME=$(git branch --show-current)

if [ "$BRANCH_NAME" = "main" ]; then

exit 1
fi

pnpm lint-staged
17 changes: 16 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,20 @@
"dev:email": "email dev -p 3004",
"dev:stripe": "stripe listen --forward-to localhost:3003/api/webhooks/stripe",
"prod:migrate": "dotenv -e .env -- npx prisma db push",
"prod:seed": "dotenv -e .env -- npx tsx prisma/seed.ts"
"prod:seed": "dotenv -e .env -- npx tsx prisma/seed.ts",
"prepare": "husky"
},
"husky": {
"hooks": {
"pre-push": "lint-staged"
}
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write",
"git add ."
]
},
"dependencies": {
"@heroicons/react": "^2.1.3",
Expand Down Expand Up @@ -93,6 +106,8 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-tailwindcss": "^3.17.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.5",
"mdast-util-toc": "^6.1.1",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.0",
Expand Down
Loading

0 comments on commit be01769

Please sign in to comment.