Skip to content

build: raise frontend typescript to 6 - #1745

Open
shivoomiess wants to merge 2 commits into
developfrom
upgrade-typescript-6
Open

shivoomiess wants to merge 2 commits into
developfrom
upgrade-typescript-6

Conversation

@shivoomiess

@shivoomiess shivoomiess commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Description

Upgrades the frontend to TypeScript 6.0 and bumps the @typescript-eslint toolchain to ^8.66.0 to support it. Includes the small source and config adjustments required for the codebase to type-check cleanly under TS 6.

Motivation and Context

TypeScript 6 brings stricter type-checking (notably tighter generic variance) and changes to default behaviour (no automatic @types/* inclusion, and deprecation errors for options slated for removal in TS 7). Staying current keeps us on supported tooling and surfaces latent type issues early. This is the base of a larger upgrade stack (React 19 → MUI 9 → mobile-responsive).

How Has This Been Tested

  • npm run generate:sdk then tsc --noEmit — passes with no errors.
  • npm run lint (frontend tsc --noEmit && eslint .) — clean.
  • Verified no behavioural change in the touched components (the removed
    || 'DRAFT' branch in ProposalContainer was provably unreachable dead code).

Fixes

Changes

  • package.json
    • typescript ^4.7.4^6.0.3, moved from dependencies to devDependencies.
    • @typescript-eslint/eslint-plugin, @typescript-eslint/parser, typescript-eslint^8.66.0 (TS 6 parser support).
  • tsconfig.json
    • Added "ignoreDeprecations": "6.0" to silence TS 7 removal errors for target, moduleResolution and baseUrl (temporary; tracked separately).
    • Added "types": ["node", "vite/client"] since TS 6 no longer auto-includes @types/* globals.
  • MultistepWizard.tsxvalidationSchema type Yup.AnyObjectSchema
    Yup.ISchema<unknown> (concrete object schemas are no longer assignable to AnyObjectSchema under TS 6's stricter variance checking; unknown avoids any and the eslint suppression).
  • ProposalContainer.tsx — removed unreachable || 'DRAFT' fallback (a JSX element is always truthy).
  • QuestionaryDetails.tsxTableRowData fields JSX.Element | string | nullReact.ReactNode.

Depends on

None — this is the base of the upgrade stack, based directly on develop. (PRs #1746, #1747, #1758 are stacked on top of this one.)

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

Follow-up: migrating the deprecated tsconfig options before TS 7 is tracked in UserOfficeProject/issue-tracker#1706.

@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 2 times, most recently from 83499ba to 927b071 Compare August 28, 2026 12:25
@yoganandaness
yoganandaness force-pushed the upgrade-typescript-6 branch 2 times, most recently from 7c429a5 to b62247d Compare September 7, 2026 09:54
@yoganandaness
yoganandaness force-pushed the upgrade-typescript-6 branch 2 times, most recently from bfe543c to 8cb3e4e Compare September 7, 2026 10:53
@yoganandaness
yoganandaness marked this pull request as ready for review September 7, 2026 10:59
@yoganandaness

Copy link
Copy Markdown
Contributor

NOTE: It is a Stacked PR

develop <-- typescript upgrade <-- react upgrade <-- mui, table upgrade <-- mobile view

  1. Each PR is functional and can be reviewed individually.
  2. Merging is sequential. With the bottom PR being merged into develop, following with next bottom

"react-router-dom": "^6.30.3",
"reactflow": "^11.11.4",
"tinymce": "^7.5.1",
"typescript": "^4.7.4",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to move it out of the dependencies list into dev dependencies in the same PR as updating the version? I guess it is probably fine, but no reason to cause more potential problems for ourselves in one go.

Maybe someone in the colab uses it in a prod pipeline for example.

I don't really mind, just worth flagging

@yoganandaness yoganandaness Sep 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the Dockerised app is being used and hence it wouldn't cause problems. I could be wrong as well.

Also I thought it would avoid overloading the node_modules. btw in backend, typescript is situated in devDependencies.

{proposalId ? `Proposal ID: ${proposalId}` : ''}
</CopyToClipboard>
) || 'DRAFT';
let info: JSX.Element | string = (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can delete "| string "

@jekabs-karklins jekabs-karklins changed the title build: raise TypeScript to 6.0 build: raise FE TypeScript to 6.0 Sep 8, 2026
@jekabs-karklins

Copy link
Copy Markdown
Contributor

The PR is good, but I did change the title to speciffically indicate that the upgrade is only for Frontend.
And that is what I would like to flag is that the backend still sits on TS5. Although not a big issue, I would suggest uppgrading BE to 6 in the near future to keep both code bases consistent.

Interstingly I found also that validation library includes TypeScript as a peer dependnecy from ts-jest

$npm why typescript
typescript@5.9.3 dev peer
node_modules/typescript
  peer typescript@">=4.3 <7" from ts-jest@29.4.11
  node_modules/ts-jest
    dev ts-jest@"^29.1.1" from the root project

@yoganandaness yoganandaness changed the title build: raise FE TypeScript to 6.0 build: raise frontend typescript to 6 Sep 8, 2026
@yoganandaness

Copy link
Copy Markdown
Contributor

The PR is good, but I did change the title to speciffically indicate that the upgrade is only for Frontend. And that is what I would like to flag is that the backend still sits on TS5. Although not a big issue, I would suggest uppgrading BE to 6 in the near future to keep both code bases consistent.

Interstingly I found also that validation library includes TypeScript as a peer dependnecy from ts-jest

$npm why typescript
typescript@5.9.3 dev peer
node_modules/typescript
  peer typescript@">=4.3 <7" from ts-jest@29.4.11
  node_modules/ts-jest
    dev ts-jest@"^29.1.1" from the root project

Thanks. Here is the ticket UserOfficeProject/issue-tracker#1707

@yoganandaness
yoganandaness force-pushed the upgrade-typescript-6 branch 2 times, most recently from 682ac17 to 05a73de Compare September 9, 2026 09:53
@yoganandaness
yoganandaness force-pushed the upgrade-typescript-6 branch 2 times, most recently from ee56c5a to 7018b61 Compare September 11, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants