Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn lint-staged
19 changes: 19 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

branch=$(git rev-parse --abbrev-ref HEAD)
pattern='^[a-z][a-z0-9\/\-]{1,29}$'

if [[ ! "$branch" =~ $pattern ]]; then
echo """
❌ Invalid branch name: '$branch'
➡️ Branch names must match regex: $pattern
- Start with a lowercase letter
- Can contain lowercase letters, numbers, and hyphens
- Length between 2 and 30 characters
- Slashes '/' are allowed for hierarchical branch names
Example: ocrvs-12345, feature-login, fix-bug123, refactor-api
"""
exit 1
fi

exit 0
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,8 @@
"node": "22.x.x"
},
"license": "MPL-2.0",
"husky": {
"hooks": {
"pre-commit": "yarn precommit"
}
},
"scripts": {
"dev": "yarn start",
"precommit": "lint-staged",
"test": "vitest",
"test:compilation": "tsc --noEmit",
"lint": "eslint -c .eslintrc.js",
Expand Down Expand Up @@ -50,7 +44,7 @@
"eslint": "^8.43.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"husky": "1.0.0-rc.13",
"husky": "^9.1.7",
"inquirer": "^9.2.12",
"js-yaml": "^4.1.0",
"kleur": "^4.1.5",
Expand Down Expand Up @@ -129,5 +123,8 @@
},
"resolutions": {
"acorn": "^6.4.1"
},
"husky": {
"hooks": {}
}
}
Loading
Loading