From 5b3187dabfb089124e731ab1a0ece566f354ac87 Mon Sep 17 00:00:00 2001 From: kirill Date: Fri, 27 Jun 2025 15:59:33 +0300 Subject: [PATCH 1/7] refactor: move typecheck from pre-commit to pre-push --- .husky/pre-commit | 1 - .husky/pre-push | 5 +++++ .../dashboard/client/src/shared/lib/isValidEvmAddress.ts | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100755 .husky/pre-push diff --git a/.husky/pre-commit b/.husky/pre-commit index 19c3fa6e16..b1dd4d8a8e 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,4 @@ yarn dlx lint-staged -yarn workspaces foreach --all -p run typecheck # Format python file changes cd packages/sdk/python/human-protocol-sdk diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 0000000000..36743eabcb --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +echo "Running typecheck before push..." +yarn workspaces foreach --all -p run typecheck \ No newline at end of file diff --git a/packages/apps/dashboard/client/src/shared/lib/isValidEvmAddress.ts b/packages/apps/dashboard/client/src/shared/lib/isValidEvmAddress.ts index 375c45011b..ddbefd46b9 100644 --- a/packages/apps/dashboard/client/src/shared/lib/isValidEvmAddress.ts +++ b/packages/apps/dashboard/client/src/shared/lib/isValidEvmAddress.ts @@ -1,4 +1,5 @@ -const isValidEVMAddress = (input: string): boolean => { +const isValidEVMAddress = (input: string, mask: string): boolean => { + mask.split('').join(''); const evmRegex = /^0x[a-fA-F0-9]{40}$/; return evmRegex.test(input); }; From 9e314af7769df0c9e7e2d410f8f2033de3ac4ce7 Mon Sep 17 00:00:00 2001 From: kirill Date: Fri, 27 Jun 2025 16:01:37 +0300 Subject: [PATCH 2/7] refactor: move typecheck out of lint command --- packages/apps/dashboard/client/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/apps/dashboard/client/package.json b/packages/apps/dashboard/client/package.json index 254001622b..80032a771a 100644 --- a/packages/apps/dashboard/client/package.json +++ b/packages/apps/dashboard/client/package.json @@ -9,7 +9,7 @@ "clean": "tsc --build --clean && rm -rf dist", "start": "vite", "build": "tsc --build && vite build", - "lint": "yarn typecheck && eslint . --report-unused-disable-directives --max-warnings 0", + "lint": "eslint . --report-unused-disable-directives --max-warnings 0", "lint:fix": "eslint . --fix", "preview": "vite preview", "vercel-build": "yarn workspace human-protocol build:libs && yarn build", From 3e66b5fa037aa16a07a5a4f5c5ca0575caac0d38 Mon Sep 17 00:00:00 2001 From: kirill Date: Fri, 27 Jun 2025 16:06:34 +0300 Subject: [PATCH 3/7] test: improving error message --- .husky/pre-push | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.husky/pre-push b/.husky/pre-push index 36743eabcb..e8f51ae1cf 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -2,4 +2,9 @@ . "$(dirname -- "$0")/_/husky.sh" echo "Running typecheck before push..." -yarn workspaces foreach --all -p run typecheck \ No newline at end of file + +if ! yarn workspaces foreach --all -p run typecheck 2>&1; then + echo "" + echo "Typecheck failed! Please fix the errors above before pushing." + exit 1 +fi \ No newline at end of file From 25c7f4b43f90db8c31ffec6d3e32ab27eac726d8 Mon Sep 17 00:00:00 2001 From: kirill Date: Fri, 27 Jun 2025 16:21:02 +0300 Subject: [PATCH 4/7] test: trying to get output --- .husky/pre-push | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.husky/pre-push b/.husky/pre-push index e8f51ae1cf..71ffc9b580 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -3,8 +3,10 @@ echo "Running typecheck before push..." -if ! yarn workspaces foreach --all -p run typecheck 2>&1; then +if ! yarn workspaces foreach --all -p run typecheck; then echo "" echo "Typecheck failed! Please fix the errors above before pushing." exit 1 -fi \ No newline at end of file +fi + +echo "Typecheck passed! Ready to push." \ No newline at end of file From b5c31ab1ba9f91cfe429bd70f9c7045f7f9b5b7f Mon Sep 17 00:00:00 2001 From: kirill Date: Fri, 27 Jun 2025 16:24:13 +0300 Subject: [PATCH 5/7] remove unnecessary code --- .husky/pre-push | 3 --- 1 file changed, 3 deletions(-) diff --git a/.husky/pre-push b/.husky/pre-push index 71ffc9b580..c78af83cc4 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,6 +1,3 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - echo "Running typecheck before push..." if ! yarn workspaces foreach --all -p run typecheck; then From 90807eb0199b7904bd4da8be5f22f47742f14d96 Mon Sep 17 00:00:00 2001 From: kirill Date: Fri, 27 Jun 2025 16:36:07 +0300 Subject: [PATCH 6/7] remove line --- .husky/pre-push | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.husky/pre-push b/.husky/pre-push index c78af83cc4..c961ffea30 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -4,6 +4,4 @@ if ! yarn workspaces foreach --all -p run typecheck; then echo "" echo "Typecheck failed! Please fix the errors above before pushing." exit 1 -fi - -echo "Typecheck passed! Ready to push." \ No newline at end of file +fi \ No newline at end of file From bf23d121d5d81407daeb36b6eb99bfbaf4658889 Mon Sep 17 00:00:00 2001 From: kirill Date: Fri, 27 Jun 2025 16:40:12 +0300 Subject: [PATCH 7/7] remove the code, that triggers type error --- .../apps/dashboard/client/src/shared/lib/isValidEvmAddress.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/apps/dashboard/client/src/shared/lib/isValidEvmAddress.ts b/packages/apps/dashboard/client/src/shared/lib/isValidEvmAddress.ts index ddbefd46b9..375c45011b 100644 --- a/packages/apps/dashboard/client/src/shared/lib/isValidEvmAddress.ts +++ b/packages/apps/dashboard/client/src/shared/lib/isValidEvmAddress.ts @@ -1,5 +1,4 @@ -const isValidEVMAddress = (input: string, mask: string): boolean => { - mask.split('').join(''); +const isValidEVMAddress = (input: string): boolean => { const evmRegex = /^0x[a-fA-F0-9]{40}$/; return evmRegex.test(input); };