Skip to content

Type safety: eliminate all any types across codebase #5

Description

@satsdisco

Summary

ESLint reports 45+ no-explicit-any errors scattered across the codebase. The worst offenders:

  • useNostr.ts — 17 instances (NDK signer wrappers, catch blocks, event types)
  • App.tsx — 5 instances (AppRoutes props, event handlers)
  • signer.ts — typed loosely
  • nostr.ts — event building/publishing
  • androidSigner.ts — intent handling
  • upload.ts — response handling
  • Various catch blocks using catch (e: any) instead of unknown

Approach

  1. Define proper interfaces for Nostr events, NDK signers, relay results
  2. Use nostr-tools built-in types where available
  3. Replace catch (e: any) with catch (e: unknown) + type narrowing
  4. Create a types/ directory with shared interfaces if needed
  5. Extend src/types/nostr.ts with missing types

Acceptance Criteria

  • Zero @typescript-eslint/no-explicit-any errors
  • No loss of functionality
  • Build passes cleanly

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions