Skip to content

refactor: enforce TypeScript strict mode and eliminate all any types#1

Open
shivv23 wants to merge 10 commits into
IPFS-Meshkit:mainfrom
shivv23:refactor/strict-typescript
Open

refactor: enforce TypeScript strict mode and eliminate all any types#1
shivv23 wants to merge 10 commits into
IPFS-Meshkit:mainfrom
shivv23:refactor/strict-typescript

Conversation

@shivv23

@shivv23 shivv23 commented Jul 21, 2026

Copy link
Copy Markdown

Enables TypeScript strict mode and eliminates all implicit and explicit any types across the codebase.

Changes

tsconfig.json - "strict": false to "strict": true

Type declarations (new src/types/ directory):

  • socialcalc.d.ts - typed declarations for the vendored SocialCalc JS module
  • meshkit-ionic.d.ts - typed declarations for @meshkit/ionic (local file dependency)

src/vite-env.d.ts - added VITE_PINATA_JWT to ImportMetaEnv

src/components/Storage/LocalStorage.ts - added FileData and FileListItem interfaces; typed _getFile and _getAllFiles return types; added null guard on Preferences.get()

src/services/MeshkitService.ts - typed function params and return types

src/components/Dashboard/Dashboard.tsx - typed state with FileListItem, guarded optional cid access, cast device type for DATA index

src/components/Menu/Menu.tsx - created MenuProps interface; typed all callback params; made doSave async; null-guarded window.open()

src/components/Files/Files.tsx - created FilesProps interface; typed state, callbacks, and null-guarded cid access

src/components/NewFile/NewFile.tsx - created NewFileProps interface; typed callback params; cast device type for DATA index

src/pages/Home.tsx - narrowed device state to "default" literal; typed activateFooter param

src/pages/MeshKit.tsx - replaced useState<any> with useState<Record<string, unknown> | null>; added explicit generic to retrieveJSON

Verification

npx tsc --noEmit passes with zero errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant