Skip to content

Commit

Permalink
Update to husky@7.0.0
Browse files Browse the repository at this point in the history
Summary:
It [should fix](typicode/husky#677 (comment)) the issue where `yarn add` or `yarn remove` break `lint-staged`, which was occurring because we have a monorepo.

Note that there were a good amount of breaking changes in this migration so the config looks pretty different.

Test Plan: `yarn cleaninstall`, then make a commit and make sure `lint-staged` still runs

Reviewers: palys-swm, atul

Reviewed By: palys-swm, atul

Subscribers: KatPo, Adrian

Differential Revision: https://phabricator.ashoat.com/D1600
  • Loading branch information
Ashoat committed Jul 5, 2021
1 parent ab28a91 commit 5c6ef29
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 36 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"cleaninstall": "yarn clean && yarn",
"eslint": "eslint .",
"eslint:fix": "eslint --fix .",
"clang-format-all": "clang-format -i native/cpp/CommonCpp/**/*.cpp native/cpp/CommonCpp/**/*.h native/android/app/src/cpp/*"
"clang-format-all": "clang-format -i native/cpp/CommonCpp/**/*.cpp native/cpp/CommonCpp/**/*.h native/android/app/src/cpp/*",
"prepare": "husky install"
},
"devDependencies": {
"babel-eslint": "^10.1.0",
Expand All @@ -29,13 +30,8 @@
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^2.5.1",
"eslint-plugin-react-native": "^3.8.1",
"husky": "^4.2.3",
"husky": "^7.0.0",
"lint-staged": "^10.0.8",
"prettier": "^2.1.2"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}
35 changes: 6 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5904,7 +5904,7 @@ commondir@^1.0.1:
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=

compare-versions@^3.4.0, compare-versions@^3.5.1:
compare-versions@^3.4.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62"
integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==
Expand Down Expand Up @@ -8086,13 +8086,6 @@ find-up@^3.0.0:
dependencies:
locate-path "^3.0.0"

find-versions@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-3.2.0.tgz#10297f98030a786829681690545ef659ed1d254e"
integrity sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==
dependencies:
semver-regex "^2.0.0"

find-yarn-workspace-root@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd"
Expand Down Expand Up @@ -9191,21 +9184,10 @@ human-signals@^1.1.1:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==

husky@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/husky/-/husky-4.2.3.tgz#3b18d2ee5febe99e27f2983500202daffbc3151e"
integrity sha512-VxTsSTRwYveKXN4SaH1/FefRJYCtx+wx04sSVcOpD7N2zjoHxa+cEJ07Qg5NmV3HAK+IRKOyNVpi2YBIVccIfQ==
dependencies:
chalk "^3.0.0"
ci-info "^2.0.0"
compare-versions "^3.5.1"
cosmiconfig "^6.0.0"
find-versions "^3.2.0"
opencollective-postinstall "^2.0.2"
pkg-dir "^4.2.0"
please-upgrade-node "^3.2.0"
slash "^3.0.0"
which-pm-runs "^1.0.0"
husky@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.0.tgz#3dbd5d28e76234689ee29bb41e048f28e3e46616"
integrity sha512-xK7lO0EtSzfFPiw+oQncQVy/XqV7UVVjxBByc+Iv5iK3yhW9boDoWgvZy3OGo48QKg/hUtZkzz0hi2HXa0kn7w==

iconv-lite@0.4.24, iconv-lite@^0.4.13, iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13:
version "0.4.24"
Expand Down Expand Up @@ -13153,7 +13135,7 @@ open@^7.4.2:
is-docker "^2.0.0"
is-wsl "^2.1.1"

opencollective-postinstall@^2.0.0, opencollective-postinstall@^2.0.2:
opencollective-postinstall@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz#5657f1bede69b6e33a45939b061eb53d3c6c3a89"
integrity sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==
Expand Down Expand Up @@ -15901,11 +15883,6 @@ semver-diff@^3.1.1:
dependencies:
semver "^6.3.0"

semver-regex@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-2.0.0.tgz#a93c2c5844539a770233379107b38c7b4ac9d338"
integrity sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==

"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
Expand Down

0 comments on commit 5c6ef29

Please sign in to comment.