Skip to content

test(types): restore TypeScript 5.9 to CI matrix #2441

@joshuaellis

Description

@joshuaellis

Context

TypeScript 5.9 was provisionally added to the test-types CI matrix when expanding from ['5.0', '5.1', '5.2'] to broader coverage, but was dropped before merge because pnpm test:ts (tsc --noEmit) fails on it.

The repo currently develops against 5.7.2 and the matrix has been updated to ['5.0', '5.4', '5.7']. This issue tracks restoring 5.9 once the failures below are addressed.

Reproduction

pnpm install --frozen-lockfile
pnpm build-ci
pnpm add -w typescript@5.9
pnpm test:ts

tsc --version5.9.3.

Failure output

packages/core/src/helpers.ts(19,43): error TS2322: Type 'T' is not assignable to type 'T extends AnyFn<any, infer U> ? U : T'.
packages/core/src/helpers.ts(55,9): error TS2322: Type 'undefined' is not assignable to type 'T[P]'.
  'undefined' is assignable to the constraint of type 'T[P]', but 'T[P]' could be instantiated with a different subtype of constraint 'any'.
packages/core/src/helpers.ts(188,7): error TS2322: Type 'any[]' is not assignable to type 'T'.
  'T' could be instantiated with an arbitrary type which could be unrelated to 'any[]'.
packages/shared/src/helpers.ts(71,15): error TS2322: Type 'never[]' is not assignable to type 'Arrify<Exclude<T, void>>'.
packages/shared/src/helpers.ts(71,45): error TS2322: Type 'T[]' is not assignable to type 'Arrify<Exclude<T, void>>'.

All five come from tightened conditional-type narrowing in 5.9 — the spring engine leans on any deliberately, so some of these are likely intentional escape hatches that 5.9 now refuses to infer through.

Definition of done

  • Failures resolved in source (preferred) or scoped behind narrowly-targeted @ts-expect-error annotations with a TS-5.9-specific comment.
  • pnpm test:ts clean on 5.9.
  • 5.9 added back to the matrix.ts array in .github/workflows/tests.yml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions