Skip to content

Commit 71be075

Browse files
committed
🐙(git hook): add commitlint with gitmoji
New commitlint configuration to add convention and gitmoji to prepare for auto-generation of changelog
1 parent c214b74 commit 71be075

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

.husky/prepare-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+
yarn commit

commitlint.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = {
3131
prompt: {
3232
questions: {
3333
type: {
34-
description: "Select the type of change that you're committing",
34+
description: "Select the TYPE of change that you're committing",
3535
enum: {
3636
'✨': {
3737
description: 'A new feature',
@@ -69,11 +69,11 @@ module.exports = {
6969
},
7070
scope: {
7171
description:
72-
'What is the scope of this change (e.g. component or file name)',
72+
'What is the SCOPE of this change (e.g. component or file name)',
7373
},
7474
subject: {
7575
description:
76-
'Write a short, imperative tense description of the change',
76+
'Write a short, imperative tense DESCRIPTION of the change',
7777
},
7878
body: {
7979
description: 'Provide a longer description of the change',

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"main": "post-init.script.js",
1616
"scripts": {
1717
"test": "echo \"Error: no test specified\" && exit 1",
18-
"commit": "cz"
18+
"commit": "cz",
19+
"prepare": "husky install"
1920
},
2021
"keywords": [
2122
"react",
@@ -36,7 +37,8 @@
3637
"@commitlint/cz-commitlint": "^16.0.0",
3738
"@commitlint/prompt-cli": "^16.0.0",
3839
"commitizen": "^4.2.4",
39-
"cz-conventional-changelog": "^3.3.0"
40+
"cz-conventional-changelog": "^3.3.0",
41+
"husky": "^7.0.4"
4042
},
4143
"config": {
4244
"commitizen": {

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,11 @@ human-signals@^2.1.0:
875875
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
876876
integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==
877877

878+
husky@^7.0.4:
879+
version "7.0.4"
880+
resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535"
881+
integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==
882+
878883
iconv-lite@^0.4.24:
879884
version "0.4.24"
880885
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"

0 commit comments

Comments
 (0)