Skip to content

Proxy-based config loses TypeScript safety #243

Description

@DeFiVC

Problem

In src/config/index.ts lines 90-94, the config export uses a Proxy that returns (ensureConfig() as any)[prop]. Any property access on config returns any, bypassing TypeScript's type checking.

If someone writes config.NONEXISTENT_KEY, it compiles fine but returns undefined at runtime.

Fix

Consider eagerly loading config at startup (with the test-mode fallback) instead of using a Proxy, to preserve type safety.

Scope

  • src/config/index.ts -- refactor config loading

Acceptance Criteria

  1. Config properties are type-checked at compile time
  2. Typo in config property name causes compile error
  3. Existing tests pass

Technical Context

  • src/config/index.ts:90-94 -- Proxy-based config

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglow

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions