From 6a219d9d5f6a8d248e2e70c6c7702525ed9be3c9 Mon Sep 17 00:00:00 2001 From: i582 <51853996+i582@users.noreply.github.com> Date: Thu, 20 Feb 2025 12:22:33 +0400 Subject: [PATCH] use Tact approach for husky --- .husky/install.mjs | 8 ++++++++ eslint.config.mjs | 1 + package.json | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .husky/install.mjs diff --git a/.husky/install.mjs b/.husky/install.mjs new file mode 100644 index 0000000..6a3af39 --- /dev/null +++ b/.husky/install.mjs @@ -0,0 +1,8 @@ +// Makes all husky runs silent when it shouldn't have run +// And non-silent otherwise (direct installation of dependencies inside Tact repo) +// +// Taken from: +// https://typicode.github.io/husky/how-to.html#ci-server-and-docker + +const husky = (await import("husky")).default +console.log(husky()) diff --git a/eslint.config.mjs b/eslint.config.mjs index 1fee7ff..7e9b8cf 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -22,6 +22,7 @@ export default tseslint.config( "**/*.spec.ts", "eslint.config.mjs", "vitest.config.ts", + ".husky/install.mjs", ".github/*", ".yarn/*", ".testing/*", diff --git a/package.json b/package.json index 8646213..3d04c74 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "gen-spec": "ts-node scripts/gen-codepage.ts", "test": "vitest", "coverage": "c8 vitest", - "postinstall": "husky || true" + "postinstall": "node .husky/install.mjs || true" }, "devDependencies": { "@scaleton/func-debug-symbols": "0.1.5",