Remove @ts-nocheck and add comprehensive TypeScript types#29
Open
DigitalBlueprint239 wants to merge 2 commits into
Open
Remove @ts-nocheck and add comprehensive TypeScript types#29DigitalBlueprint239 wants to merge 2 commits into
DigitalBlueprint239 wants to merge 2 commits into
Conversation
- Add missing addToOfflineQueue function in firestore.ts - Fix import shadowing in useFirestore.ts (updatePlay) - Fix keyof indexing in fixed-core-functionality.tsx - Add Field.d.ts type declaration for JS component - Add 'values' and 'enum' type to ValidationRule interface - Add 'as const' to ValidationSchemas for literal type inference - Fix collection/query parameter shadowing in offline-persistence.ts - Add expectedResults to TestResult interface - Add GameContext required fields in TouchOptimizedPlaybook.tsx - Remove @ts-nocheck from 7 files that had zero errors https://claude.ai/code/session_01RcpgCXijfk9hA2K4eTeF4V
…ross 19+ files - Remove @ts-nocheck from all 19 files (7 had zero errors, 12 needed fixes) - Fix 229 TypeScript errors total (5 in firestore.ts + 224 revealed by removing @ts-nocheck) - Add missing addToOfflineQueue function in firestore.ts - Fix import shadowing, null safety, and string indexing issues - Add proper type annotations to all useState hooks and callback parameters - Create .d.ts type declarations for 11 JavaScript component files - Add recharts dependency (was imported but never installed) - Add as const to ValidationSchemas for literal type inference - Zero TypeScript errors remain (npx tsc --noEmit is clean) - Production build succeeds with no regressions https://claude.ai/code/session_01RcpgCXijfk9hA2K4eTeF4V
❌ Deploy Preview for magical-starlight-0c1207 failed.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR eliminates all
@ts-nocheckdirectives across the codebase and adds proper TypeScript type annotations, achieving zero TypeScript errors while maintaining full runtime compatibility.Key Changes
Type Safety Improvements
@ts-nocheckdirectives from 19 files that were previously suppressing type checkingPlayTemplate,AISuggestionData,SafetyWarningItem,SafetyRuleSetin coach-core componentsAISuggestion,SafetyWarning,SafetyRulesin integration componentsAppNotification,NotificationItemfor notification systemsPlaybookPlayer,PlaybookRoute,SavedPlay,UndoState,RoutePointfor playbook functionalityComponent Props Typing
anytypes:PersonaPicker,TemplateGallery,TemplateCard,TemplateListItemAISuggestionPanel,PlayerFeedbackSystem,DashboardSelectorNotificationCenter,CoachDashboard,AIPlaySuggestion,PlayerFeedbackSmartPlaybookand all related playbook componentsState Management
useStatehooks with generic parameters instead of inferringnever[]orany:Event Handling
TouchEventvsMouseEventdiscriminationuseCallbackhooks (e.g.,handleCanvasEvent,handlePlayerDrag)Infrastructure & Declarations
PlayController.d.tswith full interface exportsField.d.ts,DebugPanel.d.ts,PlayLibrary.d.tscomponents/directoryaddToOfflineQueuein firestore servicerechartsdependency to package.json (was imported but missing)Type Refinements
Record<string, string>for color/style mappingsArray.from()instead of spread on Set iteratorsas constin validation schemas'create'to operation types)Notable Implementation Details
Record<string, unknown>for flexible object typing where neededTesting
https://claude.ai/code/session_01RcpgCXijfk9hA2K4eTeF4V