Skip to content

Commit 6742ff3

Browse files
authored
Merge pull request #62 from nebarf/conventional-commit
chore(git-commit): lint git commits to enforce convetional messages
2 parents 6993bb7 + b797e33 commit 6742ff3

File tree

5 files changed

+1000
-30
lines changed

5 files changed

+1000
-30
lines changed

.czrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "./node_modules/cz-conventional-changelog"
3+
}

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run commitlint -- --edit ""

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-conventional'] };

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
"react-fast-compare": "^3.2.0"
2323
},
2424
"devDependencies": {
25+
"@commitlint/cli": "^16.2.3",
26+
"@commitlint/config-conventional": "^16.2.1",
2527
"@testing-library/jest-dom": "^5.14.1",
2628
"@testing-library/react": "^13.1.1",
2729
"@testing-library/react-12": "npm:@testing-library/react@^12.1.2",
@@ -32,6 +34,8 @@
3234
"@typescript-eslint/eslint-plugin": "^4.33.0",
3335
"@typescript-eslint/parser": "^4.33.0",
3436
"auto-changelog": "^2.3.0",
37+
"commitizen": "^4.2.4",
38+
"cz-conventional-changelog": "^3.3.0",
3539
"eslint": "^7.32.0",
3640
"eslint-config-prettier": "^8.3.0",
3741
"eslint-import-resolver-typescript": "^2.5.0",
@@ -67,6 +71,9 @@
6771
"build:prod:cjs": "tsc -p tsconfig.prod.json --module commonjs --outDir lib/cjs",
6872
"clean-build": "shx rm -rf lib",
6973
"changelog": "auto-changelog -p --template ./changelog.template.hbs",
74+
"commit": "cz",
75+
"commitlint": "commitlint",
76+
"commitizen": "commitizen",
7077
"prepare": "husky install",
7178
"pre-commit": "lint-staged",
7279
"pre-push": "yarn test",

0 commit comments

Comments
 (0)