build: raise frontend typescript to 6 - #1745
shivoomiess wants to merge 2 commits into
Conversation
83499ba to
927b071
Compare
7c429a5 to
b62247d
Compare
bfe543c to
8cb3e4e
Compare
NOTE: It is a Stacked PRdevelop <-- typescript upgrade <-- react upgrade <-- mui, table upgrade <-- mobile view
|
| "react-router-dom": "^6.30.3", | ||
| "reactflow": "^11.11.4", | ||
| "tinymce": "^7.5.1", | ||
| "typescript": "^4.7.4", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 = ( |
There was a problem hiding this comment.
Can delete "| string "
|
The PR is good, but I did change the title to speciffically indicate that the upgrade is only for Frontend. Interstingly I found also that $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 |
a4c4b8a to
424b5be
Compare
Thanks. Here is the ticket UserOfficeProject/issue-tracker#1707 |
164c859 to
36766bc
Compare
682ac17 to
05a73de
Compare
ee56c5a to
7018b61
Compare
7018b61 to
2a2e696
Compare
Description
Upgrades the frontend to TypeScript 6.0 and bumps the
@typescript-eslinttoolchain to^8.66.0to 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:sdkthentsc --noEmit— passes with no errors.npm run lint(frontendtsc --noEmit && eslint .) — clean.|| 'DRAFT'branch inProposalContainerwas provably unreachable dead code).Fixes
Changes
package.jsontypescript^4.7.4→^6.0.3, moved fromdependenciestodevDependencies.@typescript-eslint/eslint-plugin,@typescript-eslint/parser,typescript-eslint→^8.66.0(TS 6 parser support).tsconfig.json"ignoreDeprecations": "6.0"to silence TS 7 removal errors fortarget,moduleResolutionandbaseUrl(temporary; tracked separately)."types": ["node", "vite/client"]since TS 6 no longer auto-includes@types/*globals.MultistepWizard.tsx—validationSchematypeYup.AnyObjectSchema→
Yup.ISchema<unknown>(concrete object schemas are no longer assignable toAnyObjectSchemaunder TS 6's stricter variance checking;unknownavoidsanyand the eslint suppression).ProposalContainer.tsx— removed unreachable|| 'DRAFT'fallback (a JSX element is always truthy).QuestionaryDetails.tsx—TableRowDatafieldsJSX.Element | string | null→React.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?
Follow-up: migrating the deprecated tsconfig options before TS 7 is tracked in UserOfficeProject/issue-tracker#1706.