Phase 1 complete — src/utils/ is fully typed (8 files, ~300 lines).
TypeScript is configured in strict mode with allowJs: true / checkJs: false so the remaining .jsx/.js files compile without errors while migration continues incrementally.
| Layer | Files | Status |
|---|---|---|
src/utils/ |
validateAmount, validateStellarAddress, errorMessages, errorLogger, formatBalance, searchHighlighter, animations, webVitals |
✅ Converted to .ts |
Convert .jsx → .tsx for files in src/design-system/:
Button, Input, Modal, Badge, Card (plus their .stories.jsx files).
Each component has clear props and no external API calls; adding interface Props is mechanical.
Convert src/hooks/*.js to .ts. Hooks have explicit inputs/outputs and no JSX, making them straightforward candidates after the design system.
Priority order: useMessages, useNetworkStatus, useExchangeRate, useWebSocket, useOfflineQueue, usePWA, useRTL, useCopy, useFileUpload, useFocusTrap.
Convert src/store/ and src/contexts/:
reducer.js→reducer.ts(type the action union)AppStateContext.jsx→AppStateContext.tsxpersistence.js→persistence.tstabSync.js→tabSync.tsThemeContext.jsx→ThemeContext.tsx
Define a State interface in reducer.ts and propagate it through context so all consumers get typed state.
Spinner, CopyButton, StatusMessage, NetworkBadge, NetworkStatusBanner, XLMInfoIcon, LanguageSelector, FileUpload, NotificationBell.
TransactionHistory, PaymentConfirmationModal, QRCodeModal, QRScanner, ImportAccountForm, ConfirmSendDialog, FeeDisplay, InlineConfirmation, AccountCreatedCelebration, TxLookup, AddressBook, AccountSettings, NotificationPreferences, BackupSettings.
AMMPoolBrowser, StreamPayment, PathPayment, ConvertWidget, AccountRecovery, MultiSigTransactions, KYCForm, ComplianceDashboard.
App.jsx → App.tsx (convert last; it imports everything above and benefits most from having upstream types settled).
- Rename
.jsx→.tsx(or.js→.ts). - Add
interface Props { ... }for component props; useReact.FC<Props>or the equivalent function signature. - Replace
prop-typesguards with TypeScript types and remove theprop-typesimport. - Run
npm run typecheckafter each file to catch issues early. - Do not silence errors with
@ts-ignore— fix them or open a follow-up issue.
Once all files in a phase are converted, enable checkJs: true (or remove allowJs) and tighten flags:
"noUncheckedIndexedAccess": true, // after Phase 4
"exactOptionalPropertyTypes": true // after Phase 7npm run typecheck (tsc --noEmit) runs in CI on every push and pull request (see .github/workflows/test.yml).