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)
- 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.
- Once a file is
@ts-check-clean and would benefit from real types, convert it .js → .ts.
- 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.
Priority 1 of the modernization milestone. Now that
strictis enabled (#26), progressively bring the 41 untyped.jsfiles inpackages/dredd/libunder the type checker.allowJsis on butcheckJsis off, so today only the 6.tsfiles are checked.Strategy (incremental, one small PR per slice)
// @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.@ts-check-clean and would benefit from real types, convert it.js→.ts.lib/**/*.jsare@ts-check/converted, flipcheckJs: true(or finish removingallowJs) and drop the per-file pragmas.Rules
gh pr checks.anycast; note anyanyescape hatches.Done when
All
packages/dredd/lib/**/*.jsare type-checked (via@ts-checkor conversion) andcheckJsis enabled, with the build green understrict.Tracking checklist will be updated per merged slice.