From 0fcf7b6da5e6d4ff319b3ad602ca5185be713e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Tue, 3 Aug 2021 18:49:43 +0200 Subject: [PATCH 1/4] build(deps-dev): upgrade husky to v7 --- .husky/commit-msg | 4 ++++ .husky/pre-commit | 4 ++++ .huskyrc | 6 ------ package.json | 5 +++-- 4 files changed, 11 insertions(+), 8 deletions(-) create mode 100755 .husky/commit-msg create mode 100755 .husky/pre-commit delete mode 100644 .huskyrc diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 00000000..e8511eae --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..d37daa07 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install lint-staged diff --git a/.huskyrc b/.huskyrc deleted file mode 100644 index 914cf42e..00000000 --- a/.huskyrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "hooks": { - "pre-commit": "lint-staged", - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" - } -} diff --git a/package.json b/package.json index 7480c391..806a9ae8 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ "test:update": "npm run test -- --u", "test:watch": "npm run test -- --watch", "type-check": "tsc --noEmit", - "semantic-release": "semantic-release" + "semantic-release": "semantic-release", + "prepare": "husky install" }, "dependencies": { "@typescript-eslint/experimental-utils": "^4.24.0" @@ -60,7 +61,7 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^3.4.0", "eslint-plugin-promise": "^5.1.0", - "husky": "^4.3.8", + "husky": "^7.0.0", "jest": "^27.0.4", "lint-staged": "^10.5.4", "prettier": "2.3.2", From 87133e8bd19199e2d44e4ce738015b094b01eddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Tue, 3 Aug 2021 18:50:24 +0200 Subject: [PATCH 2/4] build(deps-dev): skip husky on CI --- .husky/commit-msg | 3 +++ .husky/pre-commit | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.husky/commit-msg b/.husky/commit-msg index e8511eae..8a634330 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,7 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" +# Skip commit-msg hook on CI +[ -n "$CI" ] && exit 0 + npx --no-install commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit index d37daa07..8e873e96 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,7 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" +# Skip pre-commit hook on CI +[ -n "$CI" ] && exit 0 + npx --no-install lint-staged From 74e5f2d07846d53b095ec4a120eaf9ae16e984c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Tue, 3 Aug 2021 18:56:09 +0200 Subject: [PATCH 3/4] build(deps-dev): bump lint-staged --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 806a9ae8..783888a8 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "eslint-plugin-promise": "^5.1.0", "husky": "^7.0.0", "jest": "^27.0.4", - "lint-staged": "^10.5.4", + "lint-staged": "^11.1.1", "prettier": "2.3.2", "semantic-release": "^17.4.3", "ts-jest": "^27.0.3", From e7d1ec2798dbea73452b5583898990001bb28280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Wed, 4 Aug 2021 20:39:57 +0200 Subject: [PATCH 4/4] refactor: remove --no-install flag from husky hooks --- .husky/commit-msg | 2 +- .husky/pre-commit | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.husky/commit-msg b/.husky/commit-msg index 8a634330..f137fefd 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -4,4 +4,4 @@ # Skip commit-msg hook on CI [ -n "$CI" ] && exit 0 -npx --no-install commitlint --edit $1 +npx commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit index 8e873e96..1500ab63 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -4,4 +4,4 @@ # Skip pre-commit hook on CI [ -n "$CI" ] && exit 0 -npx --no-install lint-staged +npx lint-staged