Skip to content

Forbid the any type across the codebase #133

@dlrice

Description

@dlrice

Context
After the TypeScript 6 upgrade, we unblocked the build pragmatically by disabling noImplicitAny and strictNullChecks in tsconfig.json, and by typing the adapter dispatch map in src/protvista-uniprot.ts as Record<string, (...args: any[]) => any>. This pushed ~99 latent type errors out of the way but did not fix them. any now hides real mismatches (for example, the adapter map previously masked a genuine signature mismatch between variation-adapter and the ProteomicsPtm-typed dispatch entry).

Task
Eliminate both implicit and explicit any from src/, then re-enable strict defaults and lint for any going forward.

Scope:

  • Enable "noImplicitAny": true and "strictNullChecks": true in tsconfig.json (or flip "strict": true).
  • Add @typescript-eslint/no-explicit-any: "error" to the ESLint config so new any uses fail CI.

Notes:
Consider doing this incrementally — fix one directory at a time (adapters → tooltips → top-level components), merging as each lands green. Flipping strict on globally in one PR would touch ~100 errors and invite mistakes. The two genuine bugs surfaced during the earlier triage (adapter-map signature mismatch at protvista-uniprot.ts:182 / :221) should be re-validated after the adapter map is properly typed, rather than left behind the any[] cast.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions