Skip to content

Commit 3b4921d

Browse files
committed
build: add git hook for commitlint with husky
This way commitlint will run locally so that contributors can fix their commit messages right away, rather than having to wait for CI.
1 parent 26f5c9b commit 3b4921d

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed

husky.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
hooks: {
3+
'commit-msg': 'commitlint -e $GIT_PARAMS',
4+
},
5+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"test": "npm run lint && npm run testonly",
88
"testonly": "jest --verbose",
99
"tdd": "jest --watch",
10-
"commitmsg": "commitlint -e $GIT_PARAMS",
1110
"build": "rimraf lib && babel src --out-dir lib && npm run build:dist && cp README.md LICENSE ./lib",
1211
"build:docs": "npm -C www run build",
1312
"build:dist": "rimraf lib/dist && webpack && NODE_ENV=production webpack -p",
@@ -92,6 +91,7 @@
9291
"eslint-plugin-jsx-a11y": "^4.0.0",
9392
"eslint-plugin-prettier": "^2.6.0",
9493
"eslint-plugin-react": "^6.10.3",
94+
"husky": "^1.0.0-rc.8",
9595
"jest": "^20.0.4",
9696
"prettier": "^1.11.1",
9797
"react": "^16.0.0",

yarn.lock

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3042,6 +3042,14 @@ cosmiconfig@^4.0.0:
30423042
parse-json "^4.0.0"
30433043
require-from-string "^2.0.1"
30443044

3045+
cosmiconfig@^5.0.2:
3046+
version "5.0.5"
3047+
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.5.tgz#a809e3c2306891ce17ab70359dc8bdf661fe2cd0"
3048+
dependencies:
3049+
is-directory "^0.3.1"
3050+
js-yaml "^3.9.0"
3051+
parse-json "^4.0.0"
3052+
30453053
cp-file@^5.0.0:
30463054
version "5.0.0"
30473055
resolved "https://registry.yarnpkg.com/cp-file/-/cp-file-5.0.0.tgz#bc700fd30ca32d24d46c7fb02b992e435fc5a978"
@@ -4521,6 +4529,10 @@ get-stdin@^4.0.1:
45214529
version "4.0.1"
45224530
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
45234531

4532+
get-stdin@^6.0.0:
4533+
version "6.0.0"
4534+
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b"
4535+
45244536
[email protected], get-stream@^3.0.0:
45254537
version "3.0.0"
45264538
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
@@ -5056,6 +5068,21 @@ https-proxy-agent@^2.2.0:
50565068
agent-base "^4.1.0"
50575069
debug "^3.1.0"
50585070

5071+
husky@^1.0.0-rc.8:
5072+
version "1.0.0-rc.8"
5073+
resolved "https://registry.yarnpkg.com/husky/-/husky-1.0.0-rc.8.tgz#2fa25d0b89269f5b8bfa1ca001370fdb058e8792"
5074+
dependencies:
5075+
cosmiconfig "^5.0.2"
5076+
execa "^0.9.0"
5077+
find-up "^2.1.0"
5078+
get-stdin "^6.0.0"
5079+
is-ci "^1.1.0"
5080+
pkg-dir "^2.0.0"
5081+
pupa "^1.0.0"
5082+
read-pkg "^3.0.0"
5083+
run-node "^1.0.0"
5084+
slash "^2.0.0"
5085+
50595086
hyphenate-style-name@^1.0.1, hyphenate-style-name@^1.0.2:
50605087
version "1.0.2"
50615088
resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.2.tgz#31160a36930adaf1fc04c6074f7eb41465d4ec4b"
@@ -5306,6 +5333,12 @@ is-ci@^1.0.10:
53065333
dependencies:
53075334
ci-info "^1.0.0"
53085335

5336+
is-ci@^1.1.0:
5337+
version "1.1.0"
5338+
resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5"
5339+
dependencies:
5340+
ci-info "^1.0.0"
5341+
53095342
is-data-descriptor@^0.1.4:
53105343
version "0.1.4"
53115344
resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56"
@@ -7896,6 +7929,10 @@ punycode@^2.1.0:
78967929
version "2.1.1"
78977930
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
78987931

7932+
pupa@^1.0.0:
7933+
version "1.0.0"
7934+
resolved "https://registry.yarnpkg.com/pupa/-/pupa-1.0.0.tgz#9a9568a5af7e657b8462a6e9d5328743560ceff6"
7935+
78997936
q@^1.1.2, q@^1.5.1:
79007937
version "1.5.1"
79017938
resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
@@ -8644,6 +8681,10 @@ run-async@^0.1.0:
86448681
dependencies:
86458682
once "^1.3.0"
86468683

8684+
run-node@^1.0.0:
8685+
version "1.0.0"
8686+
resolved "https://registry.yarnpkg.com/run-node/-/run-node-1.0.0.tgz#46b50b946a2aa2d4947ae1d886e9856fd9cabe5e"
8687+
86478688
run-queue@^1.0.0, run-queue@^1.0.3:
86488689
version "1.0.3"
86498690
resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47"
@@ -8933,6 +8974,10 @@ slash@^1.0.0:
89338974
version "1.0.0"
89348975
resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
89358976

8977+
slash@^2.0.0:
8978+
version "2.0.0"
8979+
resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
8980+
89368981
89378982
version "0.0.4"
89388983
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35"

0 commit comments

Comments
 (0)