Skip to content

Commit

Permalink
Add husky hooks (#1010)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterMuriuki authored May 22, 2022
1 parent 8130c4c commit b1d5515
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
22 changes: 7 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,21 @@
"test:watch": "TZ='UTC' jest --watch",
"lint": "eslint {packages,app}/**/*.{js,ts,tsx} --max-warnings 0",
"postinstall": "patch-package",
"extractTranslations": "lerna run extractTranslations"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
"extractTranslations": "lerna run extractTranslations",
"prepare": "husky install"
},
"lint-staged": {
"!(*d).ts": [
"eslint --fix --max-warnings 0",
"git add"
"eslint --fix --max-warnings 0"
],
"*.tsx": [
"eslint --fix --max-warnings 0",
"git add"
"eslint --fix --max-warnings 0"
],
"!(**/*dist/**/*)(*eslint).{js,jsx}": [
"eslint --fix --max-warnings 0",
"git add"
"eslint --fix --max-warnings 0"
],
"*.{json,js,jsx,ts,tsx,css,scss,md}": [
"prettier --write",
"git add"
"prettier --write"
],
"*.{snap, test.tsx}": [
"eslint"
Expand Down Expand Up @@ -97,7 +89,7 @@
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-sonarjs": "^0.12.0",
"flush-promises": "^1.0.2",
"husky": "^7.0.4",
"husky": "^8.0.0",
"i18next": "^21.6.6",
"jest": "27.5.1",
"jest-environment-jsdom-sixteen": "^2.0.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10299,10 +10299,10 @@ humanize-ms@^1.2.1:
dependencies:
ms "^2.0.0"

husky@^7.0.4:
version "7.0.4"
resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535"
integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==
husky@^8.0.0:
version "8.0.1"
resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.1.tgz#511cb3e57de3e3190514ae49ed50f6bc3f50b3e9"
integrity sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw==

i18next-parser@^3.5.0:
version "3.11.0"
Expand Down

0 comments on commit b1d5515

Please sign in to comment.