From f553298e507c6a05cc1fcf6c43c5837e1bd2adb8 Mon Sep 17 00:00:00 2001 From: Will Manning Date: Mon, 4 May 2026 14:51:23 -0400 Subject: [PATCH] Enable noUncheckedIndexedAccess; guard touch-event index access Co-Authored-By: Claude Opus 4.7 (1M context) Signed-off-by: Will Manning --- src/components/hero-404/index.tsx | 6 ++++-- src/components/hero/index.tsx | 6 ++++-- tsconfig.json | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/hero-404/index.tsx b/src/components/hero-404/index.tsx index 9f06b2f..0300715 100644 --- a/src/components/hero-404/index.tsx +++ b/src/components/hero-404/index.tsx @@ -218,8 +218,10 @@ void main() { e.preventDefault(); } - const touchX = e.touches[0].clientX; - const touchY = e.touches[0].clientY; + const touch = e.touches[0]; + if (!touch) return; + const touchX = touch.clientX; + const touchY = touch.clientY; const x = (touchX / window.innerWidth) * 2 - 1; const y = (touchY / window.innerHeight) * 2 - 1; diff --git a/src/components/hero/index.tsx b/src/components/hero/index.tsx index 0d75ee3..c114e2d 100644 --- a/src/components/hero/index.tsx +++ b/src/components/hero/index.tsx @@ -227,8 +227,10 @@ void main() { e.preventDefault(); } - const touchX = e.touches[0].clientX; - const touchY = e.touches[0].clientY; + const touch = e.touches[0]; + if (!touch) return; + const touchX = touch.clientX; + const touchY = touch.clientY; const x = (touchX / window.innerWidth) * 2 - 1; const y = (touchY / window.innerHeight) * 2 - 1; diff --git a/tsconfig.json b/tsconfig.json index 93359ad..230f450 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,6 +13,7 @@ "moduleResolution": "bundler", "noUnusedLocals": true, "noUnusedParameters": true, + "noUncheckedIndexedAccess": true, "resolveJsonModule": true, "isolatedModules": true, "jsx": "react-jsx",