Skip to content

Commit 611c6bf

Browse files
committed
chore: lint on commitmsg
1 parent 591aed5 commit 611c6bf

File tree

4 files changed

+335
-37
lines changed

4 files changed

+335
-37
lines changed

.huskyrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"hooks": {
3+
"pre-commit": "yarn validate",
4+
"commit-msg": "npx commitlint -E HUSKY_GIT_PARAMS"
5+
}
6+
}

commitlint.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
extends: [
3+
'@commitlint/config-conventional'
4+
]
5+
}

package.json

+13-5
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@
7070
"lint": "(yarn standard) | snazzy",
7171
"lint:fix": "(yarn standard --fix) | snazzy",
7272
"validate": "yarn lint:fix && yarn coverage",
73-
"precommit": "yarn validate",
7473
"document": "node src/CLI/hubi s -t site -o docs && mv docs/index.hubi.html docs/index.html",
7574
"document:watch": "npm-watch document",
7675
"coveralls": "cat ./nyc_output/lcov.info | coveralls",
7776
"dogfood": "node src/CLI/hubi s -st joi",
7877
"dogfood:watch": "npm-watch dogfood",
79-
"build": "yarn dogfood & yarn document"
78+
"build": "yarn dogfood & yarn document",
79+
"commit": "npx git-cz"
8080
},
8181
"dependencies": {
8282
"commander": "^2.15.1",
@@ -88,12 +88,15 @@
8888
"write": "^1.0.3"
8989
},
9090
"devDependencies": {
91+
"@commitlint/config-conventional": "^7.5.0",
9192
"@semantic-release/git": "^7.0.6",
9293
"@semantic-release/npm": "^5.1.2",
94+
"commitizen": "^3.0.7",
9395
"coveralls": "^3.0.0",
9496
"cucumber": "^4.0.0",
97+
"cz-conventional-changelog": "2.1.0",
9598
"faker": "^4.1.0",
96-
"husky": "^0.14.3",
99+
"husky": "^1.3.1",
97100
"mocha": "^5.0.5",
98101
"mocha-lcov-reporter": "^1.3.0",
99102
"npm-watch": "^0.3.0",
@@ -132,7 +135,7 @@
132135
"engines": {
133136
"node": ">=8.9.4",
134137
"npm": ">=5.6.0",
135-
"yarn": "1.3.2"
138+
"yarn": "1.13.0"
136139
},
137140
"standard": {
138141
"env": [
@@ -153,5 +156,10 @@
153156
"developer-tools",
154157
"domain-driven-design",
155158
"command-line"
156-
]
159+
],
160+
"config": {
161+
"commitizen": {
162+
"path": "./node_modules/cz-conventional-changelog"
163+
}
164+
}
157165
}

0 commit comments

Comments
 (0)