Skip to content

build: raise TypeScript to 6.0 - #1745

Draft
shivoomiess wants to merge 1 commit into
developfrom
upgrade-typescript-6
Draft

build: raise TypeScript to 6.0#1745
shivoomiess wants to merge 1 commit into
developfrom
upgrade-typescript-6

Conversation

@shivoomiess

@shivoomiess shivoomiess commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

First of three pull requests that reorder the frontend upgrade work. The earlier stack (#1694, #1707, #1708, #1709, #1710, #1727) is still open as drafts and is not affected by this.

Order

The earlier stack had Material UI v9 at the bottom, with everything else built on top of it. This meant the branches in the middle could not be checked on their own. The new order places the two upgrades that touch no end-to-end tests first, so each can be run against the existing test suite without changes to that suite.

  1. TypeScript 6 (this pull request)
  2. React 19
  3. Material UI v9 together with material-table v8

Contents

TypeScript is raised from 4.9 to 6.0, and typescript-eslint to ^8.66.0. The changes are the same as in #1707. The only difference is that they are applied to the current state of develop rather than to the Material UI branch.

#1707 was written on top of Material UI v9, so it was not known whether TypeScript 6 would accept the v5 code. It does, without changes.

Checks

tsc --noEmit, npm run lint, npm run build and npm ci all pass.

@shivoomiess
shivoomiess requested a review from a team as a code owner August 25, 2026 20:11
@shivoomiess
shivoomiess requested review from SourangshuSTFC and removed request for a team August 25, 2026 20:11
@shivoomiess
shivoomiess marked this pull request as draft August 25, 2026 20:50
@shivoomiess
shivoomiess force-pushed the upgrade-typescript-6 branch from c32a490 to 83499ba Compare August 27, 2026 18:30
The frontend declared `typescript: ^4.7.4` in `dependencies` while the backend
and e2e workspaces were already on 5.x, and 4.9.5 was what actually resolved.
React 19 forces the issue: `@types/react@19` declares `typeScriptVersion: 5.6`.

Targets 6.0.3 rather than 7.0.2. TypeScript 7 ships without a programmatic API -
`exports["."]` resolves to `lib/version.cjs`, and there is no `tsserver` binary -
so typescript-eslint cannot run on it, and npm refuses the install outright
against its `>=4.8.4 <6.1.0` peer range. That API is expected in 7.1. 6.0 is the
bridge release: it reports every option 7 removes, so the remaining work is
visible rather than discovered later.

Moved to `devDependencies`, where the rest of the build tooling already sits.

Raises the typescript-eslint packages to ^8.66.0 in the same change. 8.56.0
declares `typescript: ">=4.8.4 <6.0.0"`, which TypeScript 6 violates; 8.66.0
widened it to `<6.1.0`. The three declarations are moved together so they cannot
drift - `@typescript-eslint/parser` and `eslint-plugin` had already floated to
8.66.0 while the unified `typescript-eslint` package stayed pinned at 8.56.0.

Two tsconfig entries, both explained in place:

- `ignoreDeprecations: "6.0"` keeps this bump separate from the TypeScript 7
  config migration (`target`, `moduleResolution`, `baseUrl`). That migration
  needs no import changes - Vite resolves the absolute imports through its own
  aliases - but it does surface 11 errors in 9 files, 6 of which disappear once
  React 19 upgrades html-react-parser.
- `types: ["node", "vite/client"]` - TypeScript 6 no longer includes `@types/*`
  automatically, which dropped the `process` and `NodeJS` globals.

Fixes the three latent type errors the bump surfaced. None are new bugs; all
were mistyped in ways 4.9 did not check:

- MultistepWizard: `WizardStep.validationSchema` was `Yup.AnyObjectSchema`, i.e.
  `ObjectSchema<any, any, any, any>`. From TypeScript 5 a concrete `ObjectSchema`
  is not assignable to it, because `concat` is invariant in the schema's shape,
  so every real schema was rejected. The step never reads the prop - the wizard
  forwards it to Formik - so the polymorphic `Yup.ISchema` is the accurate type.

- QuestionaryDetails: `TableRowData.label`/`value` were
  `JSX.Element | string | null`, but both are produced by
  `React.FunctionComponent` renderers, which return `ReactNode`, and the only
  reader renders them straight into a `TableCell`. Widened to `ReactNode`.

- ProposalContainer: `(<CopyToClipboard .../>) || 'DRAFT'` - a JSX element is
  always truthy, so the fallback was unreachable. Removed the dead operand,
  which leaves behaviour unchanged.

Note the removed `|| 'DRAFT'` reveals intent that never took effect: when a
proposal has no id the inner ternary already renders an empty string, so the UI
shows an empty clickable CopyToClipboard rather than "DRAFT". Left as-is because
correcting it is a product decision, not part of a TypeScript upgrade.
@shivoomiess
shivoomiess force-pushed the upgrade-typescript-6 branch from 83499ba to 927b071 Compare August 28, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant