Skip to content

Commit 44d6618

Browse files
committed
Upgrade husky and husky pre-commit script
Upgrade husky to the latest version and upgrade the husky config to use the new configuration. `yarn run prepare` must be used to prepare the git hooks in the repository. Closes colbyfayock#240
1 parent 4e34bf4 commit 44d6618

File tree

3 files changed

+13
-85
lines changed

3 files changed

+13
-85
lines changed

Diff for: .husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn run lint-staged

Diff for: package.json

+3-7
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,8 @@
1313
"format:no-path": "yarn lint:no-path --fix",
1414
"lint": "eslint .",
1515
"lint:no-path": "eslint",
16-
"start": "next start -p ${PORT:=3000}"
17-
},
18-
"husky": {
19-
"hooks": {
20-
"pre-commit": "lint-staged"
21-
}
16+
"start": "next start -p ${PORT:=3000}",
17+
"prepare": "husky install"
2218
},
2319
"lint-staged": {
2420
"**/*.js": "yarn format:no-path",
@@ -55,7 +51,7 @@
5551
"eslint-plugin-prettier": "^4.0.0",
5652
"eslint-plugin-react": "^7.26.1",
5753
"eslint-plugin-react-hooks": "^4.2.0",
58-
"husky": "4.3.8",
54+
"husky": "^7.0.4",
5955
"lint-staged": ">=11.2.3",
6056
"prettier": "2.4.1"
6157
},

Diff for: yarn.lock

+6-78
Original file line numberDiff line numberDiff line change
@@ -824,11 +824,6 @@ chownr@^1.1.4:
824824
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
825825
integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==
826826

827-
ci-info@^2.0.0:
828-
version "2.0.0"
829-
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
830-
integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==
831-
832827
cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3:
833828
version "1.0.4"
834829
resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de"
@@ -913,11 +908,6 @@ commondir@^1.0.1:
913908
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
914909
integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=
915910

916-
compare-versions@^3.6.0:
917-
version "3.6.0"
918-
resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62"
919-
integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==
920-
921911
922912
version "0.0.1"
923913
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
@@ -955,7 +945,7 @@ core-util-is@~1.0.0:
955945
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
956946
integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==
957947

958-
cosmiconfig@^7.0.0, cosmiconfig@^7.0.1:
948+
cosmiconfig@^7.0.1:
959949
version "7.0.1"
960950
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d"
961951
integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==
@@ -1683,21 +1673,6 @@ find-up@^4.0.0:
16831673
locate-path "^5.0.0"
16841674
path-exists "^4.0.0"
16851675

1686-
find-up@^5.0.0:
1687-
version "5.0.0"
1688-
resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc"
1689-
integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==
1690-
dependencies:
1691-
locate-path "^6.0.0"
1692-
path-exists "^4.0.0"
1693-
1694-
find-versions@^4.0.0:
1695-
version "4.0.0"
1696-
resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-4.0.0.tgz#3c57e573bf97769b8cb8df16934b627915da4965"
1697-
integrity sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==
1698-
dependencies:
1699-
semver-regex "^3.1.2"
1700-
17011676
flat-cache@^3.0.4:
17021677
version "3.0.4"
17031678
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11"
@@ -1999,21 +1974,10 @@ human-signals@^2.1.0:
19991974
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
20001975
integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==
20011976

2002-
2003-
version "4.3.8"
2004-
resolved "https://registry.yarnpkg.com/husky/-/husky-4.3.8.tgz#31144060be963fd6850e5cc8f019a1dfe194296d"
2005-
integrity sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==
2006-
dependencies:
2007-
chalk "^4.0.0"
2008-
ci-info "^2.0.0"
2009-
compare-versions "^3.6.0"
2010-
cosmiconfig "^7.0.0"
2011-
find-versions "^4.0.0"
2012-
opencollective-postinstall "^2.0.2"
2013-
pkg-dir "^5.0.0"
2014-
please-upgrade-node "^3.2.0"
2015-
slash "^3.0.0"
2016-
which-pm-runs "^1.0.0"
1977+
husky@^7.0.4:
1978+
version "7.0.4"
1979+
resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535"
1980+
integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==
20171981

20181982
[email protected], iconv-lite@^0.4.4:
20191983
version "0.4.24"
@@ -2494,13 +2458,6 @@ locate-path@^5.0.0:
24942458
dependencies:
24952459
p-locate "^4.1.0"
24962460

2497-
locate-path@^6.0.0:
2498-
version "6.0.0"
2499-
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286"
2500-
integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==
2501-
dependencies:
2502-
p-locate "^5.0.0"
2503-
25042461
lodash.clonedeep@^4.5.0:
25052462
version "4.5.0"
25062463
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
@@ -2994,11 +2951,6 @@ onetime@^5.1.0, onetime@^5.1.2:
29942951
dependencies:
29952952
mimic-fn "^2.1.0"
29962953

2997-
opencollective-postinstall@^2.0.2:
2998-
version "2.0.3"
2999-
resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259"
3000-
integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==
3001-
30022954
optimism@^0.16.1:
30032955
version "0.16.1"
30042956
resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.16.1.tgz#7c8efc1f3179f18307b887e18c15c5b7133f6e7d"
@@ -3054,7 +3006,7 @@ osenv@^0.1.4:
30543006
os-homedir "^1.0.0"
30553007
os-tmpdir "^1.0.0"
30563008

3057-
[email protected], p-limit@^3.0.2:
3009+
30583010
version "3.1.0"
30593011
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b"
30603012
integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==
@@ -3089,13 +3041,6 @@ p-locate@^4.1.0:
30893041
dependencies:
30903042
p-limit "^2.2.0"
30913043

3092-
p-locate@^5.0.0:
3093-
version "5.0.0"
3094-
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834"
3095-
integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==
3096-
dependencies:
3097-
p-limit "^3.0.2"
3098-
30993044
p-map@^4.0.0:
31003045
version "4.0.0"
31013046
resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b"
@@ -3234,13 +3179,6 @@ pkg-dir@^4.1.0:
32343179
dependencies:
32353180
find-up "^4.0.0"
32363181

3237-
pkg-dir@^5.0.0:
3238-
version "5.0.0"
3239-
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760"
3240-
integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==
3241-
dependencies:
3242-
find-up "^5.0.0"
3243-
32443182
32453183
version "1.3.6"
32463184
resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7"
@@ -3650,11 +3588,6 @@ semver-compare@^1.0.0:
36503588
resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
36513589
integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w=
36523590

3653-
semver-regex@^3.1.2:
3654-
version "3.1.3"
3655-
resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-3.1.3.tgz#b2bcc6f97f63269f286994e297e229b6245d0dc3"
3656-
integrity sha512-Aqi54Mk9uYTjVexLnR67rTyBusmwd04cLkHy9hNvk3+G3nT2Oyg7E0l4XVbOaNwIvQ3hHeYxGcyEy+mKreyBFQ==
3657-
36583591
semver@^5.3.0:
36593592
version "5.7.1"
36603593
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
@@ -4350,11 +4283,6 @@ which-boxed-primitive@^1.0.2:
43504283
is-string "^1.0.5"
43514284
is-symbol "^1.0.3"
43524285

4353-
which-pm-runs@^1.0.0:
4354-
version "1.0.0"
4355-
resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb"
4356-
integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=
4357-
43584286
which-typed-array@^1.1.2:
43594287
version "1.1.7"
43604288
resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.7.tgz#2761799b9a22d4b8660b3c1b40abaa7739691793"

0 commit comments

Comments
 (0)