From 129b14e9a79add937323091a978e6aaef5f172c2 Mon Sep 17 00:00:00 2001 From: RanGojo Date: Mon, 30 Oct 2023 10:52:03 +0000 Subject: [PATCH] feat: setup husky --- .husky/post-commit | 9 +++++++++ package.json | 4 +++- yarn.lock | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 .husky/post-commit diff --git a/.husky/post-commit b/.husky/post-commit new file mode 100755 index 0000000..80f94f2 --- /dev/null +++ b/.husky/post-commit @@ -0,0 +1,9 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +if [ -z "${GIT_COMMITTER_DATE:-}" ]; then + DATE="$(date -u +%Y-%m-%dT%H:%M:%S%z)"; + export GIT_AUTHOR_DATE="$DATE"; + export GIT_COMMITTER_DATE="$DATE" + git commit --amend --date "$DATE" --no-edit +fi \ No newline at end of file diff --git a/package.json b/package.json index 75cf665..710d0e6 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "prepare": "husky install" }, "dependencies": { "@react-spring/web": "^9.5.5", @@ -36,6 +37,7 @@ "eslint-plugin-n": "^15.5.1", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-react": "^7.31.11", + "husky": "^8.0.0", "postcss": "^8.4.19", "tailwindcss": "^3.2.4", "typescript": "^4.9.3" diff --git a/yarn.lock b/yarn.lock index 42e9aeb..856caf7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1889,6 +1889,11 @@ hasown@^2.0.0: dependencies: function-bind "^1.1.2" +husky@^8.0.0: + version "8.0.3" + resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184" + integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== + ignore@^5.1.1, ignore@^5.2.0: version "5.2.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324"