Skip to content

Commit

Permalink
Add Git Hooks (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
RishikeshNK authored Feb 2, 2024
1 parent 6afa958 commit cedfc23
Show file tree
Hide file tree
Showing 6 changed files with 2,215 additions and 21 deletions.
7 changes: 7 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm commitlint --edit

echo "$(cat .husky/commit-msg) \"\$1\""

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

pnpm lint-staged

4 changes: 4 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

exec < /dev/tty && pnpm cz --hook || true
1 change: 1 addition & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] };
22 changes: 20 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"lint": "next lint",
"format:check": "prettier --check --ignore-path .gitignore .",
"format": "prettier --write --ignore-path .gitignore .",
"start": "next start"
"start": "next start",
"prepare": "husky"
},
"dependencies": {
"@next-auth/prisma-adapter": "^1.0.7",
Expand All @@ -32,24 +33,41 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@commitlint/cli": "^18.6.0",
"@commitlint/config-conventional": "^18.6.0",
"@types/eslint": "^8.44.7",
"@types/node": "^18.17.0",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"autoprefixer": "^10.4.14",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.54.0",
"eslint-config-next": "^14.0.4",
"husky": "^9.0.10",
"lint-staged": "^15.2.1",
"postcss": "^8.4.31",
"prettier": "^3.1.0",
"prettier-plugin-tailwindcss": "^0.5.7",
"prisma": "^5.6.0",
"tailwindcss": "^3.3.5",
"typescript": "^5.1.6"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,md,json,yaml}": [
"prettier --write ."
],
"*.{ts,tsx}": "eslint --fix"
},
"ct3aMetadata": {
"initVersion": "7.25.2"
},
"packageManager": "pnpm@8.10.5"
"packageManager": "pnpm@8.10.5",
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
Loading

0 comments on commit cedfc23

Please sign in to comment.