build: raise TypeScript to 6.0 - #1745
Draft
shivoomiess wants to merge 1 commit into
Draft
Conversation
shivoomiess
requested review from
SourangshuSTFC
and removed request for
a team
August 25, 2026 20:11
shivoomiess
marked this pull request as draft
August 25, 2026 20:50
shivoomiess
force-pushed
the
upgrade-typescript-6
branch
from
August 27, 2026 18:30
c32a490 to
83499ba
Compare
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
force-pushed
the
upgrade-typescript-6
branch
from
August 28, 2026 12:25
83499ba to
927b071
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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 buildandnpm ciall pass.