Skip to content

[P1] Incrementally type-check packages/dredd/lib (.js → typed) #28

Description

@dalberola

Priority 1 of the modernization milestone. Now that strict is enabled (#26), progressively bring the 41 untyped .js files in packages/dredd/lib under the type checker. allowJs is on but checkJs is off, so today only the 6 .ts files are checked.

Strategy (incremental, one small PR per slice)

  1. Opt files in with a top-of-file // @ts-check (lightest — no rename), fixing the few strict errors each surfaces (JSDoc types / guards). Start with small leaf utilities, work up to hot modules.
  2. Once a file is @ts-check-clean and would benefit from real types, convert it .js.ts.
  3. When all lib/**/*.js are @ts-check/converted, flip checkJs: true (or finish removing allowJs) and drop the per-file pragmas.

Rules

  • One branch + PR per slice (a few files at a time). Gate every merge on gh pr checks.
  • No behavior change — types/guards only. Keep diffs reviewable.
  • Prefer fixing a real unsafe access over an any cast; note any any escape hatches.

Done when

All packages/dredd/lib/**/*.js are type-checked (via @ts-check or conversion) and checkJs is enabled, with the build green under strict.

Tracking checklist will be updated per merged slice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions