Skip to content

TypeScript: Enable strict mode incrementally #23

@evans-sam

Description

@evans-sam

Problem

tsconfig.json does not set strict: true (nor any of its constituent flags). Effects:

  • 90 explicit any usages across 8 files.
  • No null-safety guarantees.
  • noImplicitAny, strictNullChecks, noUncheckedIndexedAccess all off.

Why it matters

A type-system-heavy library that doesn't use its type system is shipping weaker guarantees than its users assume from the .d.ts files. Every any is a type-safety hole, and the biggest offenders (wsdl/index.ts: 23, wsdl/elements.ts: 21, client.ts: 17) are exactly the modules handling untrusted input.

Proposed approach

Enable flags incrementally, one PR each, to keep reviews manageable:

  1. noImplicitAny — forces every any to be explicit.
  2. strictNullChecks — likely the biggest PR; exposes all the missing | null and | undefined.
  3. strictFunctionTypes + alwaysStrict — usually small.
  4. noUncheckedIndexedAccess — may require careful review of array indexing.
  5. Flip to strict: true and delete the individual flags.

Between each step, run npm run build && npm test. Don't add @ts-expect-error or // @ts-ignore — prefer real type fixes.

Acceptance criteria

  • tsconfig.json has strict: true (or equivalent set of flags).
  • any count visibly reduced (target: <30).
  • No new @ts-ignore / @ts-expect-error suppressions added.
  • Build and tests pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtTechnical debt / code quality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions