-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: upgrade to typescript 5 #2345
Conversation
fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators
fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators
forceConsistentCasingInFileNames defaults to true in ts 5.0
✅ Deploy Preview for brilliant-pasca-3e80ec canceled.
|
@@ -10,7 +10,7 @@ function coerceUInt8Value(value: number | string | unknown): number { | |||
throw new TypeError('Provided value is not number or string.') | |||
} | |||
const nValue = Number(value) | |||
if (Number.isInteger(nValue) && value >= 0 && value <= 255) { | |||
if (Number.isInteger(nValue) && nValue >= 0 && nValue <= 255) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(same change made in backend)
fixes new rule: Forbidden Implicit Coercions in Relational Operators
// Only accepts Middleware<DefaultState, DefaultContext> for some reason, koa is Middleware<DefaultState, AppContext> | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
koa as any | ||
koa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found that this "any" assertion wasn't needed
@@ -10,7 +10,6 @@ | |||
"target": "ES2019", | |||
"strict": true, | |||
"allowJs": true, | |||
"forceConsistentCasingInFileNames": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(same change made a few other places)
forceConsistentCasingInFileNames
is now true
by default so I removed this because its now redundant. Just wanted to clarify that this isnt changing the configuration.
I also went through the list of settings being deprecated and found that we are not using any of them: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#deprecations-and-default-changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @BlairCurrey ! Just one small question.
tsconfig.build.json
Outdated
/* Advanced Options */ | ||
"skipLibCheck": true /* Skip type checking of declaration files. */, | ||
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, | ||
// "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, | ||
"resolveJsonModule": true | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something off with the curly braces or why is that highlighted in red?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think github's syntax highlighting for json just doesnt understand comments in json. You can see the same thing here for example: https://github.com/mui/material-ui/blob/4b735de27e84a0221f42530d281f6d718ee8a7e1/packages/mui-utils/tsconfig.build.json#L4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you're referring to the curly brace specifically... part of the same issue though it looks like. It's fine locally. As a sanity check I added an extra brace and that makes the build command fail. Which is not happening here in CI so I think we're good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the unused option for good measure but it doesnt change anything. looks like that's just the way it is on main too https://github.com/interledger/rafiki/blob/main/tsconfig.build.json
This is actually kinda weird, since some other tsconfigs with comments show the same way: https://github.com/yurtsiv/mermaid/blob/5d4d7c5fbfa21bc9d4974613fb7052144df336e0/todo-fix-root-level-tsconfig.json
while others do not: https://github.com/Ejden/vuetify/blob/1b8a04b9d936ba98d9e37ce711fd49aef53b1213/tsconfig.json
In the ones with red syntax highlighting the comma is at the end of the comment instead of the value. Not sure if thats the cause but prettier forces that on our end and it's just a display issue on github after all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for digging so deep into this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After you pointed it out it really bugged me that I wasn't entirely sure why this happens 😆
packages/backend/package.json
Outdated
@@ -42,7 +42,7 @@ | |||
"testcontainers": "^10.5.0", | |||
"tmp": "^0.2.1", | |||
"ts-node": "^10.9.2", | |||
"typescript": "^4.9.5" | |||
"typescript": "^5.3.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we actually need to specify this across all of the different packages, or is having it once in the root package.json enough?
chore: upgrade to typescript 5 (#2345) * feat: upgrade ts to 5.0 * fix(auth): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore(auth): rm unecessary type assertion * fix(backend): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore: rm default tsconfig option forceConsistentCasingInFileNames defaults to true in ts 5.0 * chore: update package versions * chore: rm unused optoin * chore: rm typescript dev dep from pacakges
chore: upgrade to typescript 5 (#2345) * feat: upgrade ts to 5.0 * fix(auth): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore(auth): rm unecessary type assertion * fix(backend): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore: rm default tsconfig option forceConsistentCasingInFileNames defaults to true in ts 5.0 * chore: update package versions * chore: rm unused optoin * chore: rm typescript dev dep from pacakges
* chore(frontend): update error boundaries to v2 * chore(frontend): update meta to v2 * chore(frontend): update headers to v2 * chore(frontend): update form method to v2 * chore(frontend): update to v2 dev server * chore(frontend): update server module format to v2 * feat(frontend): typecheck cmd * fix(frontend): type only import * feat(frontend): ugprade remix to v2 - upgrades all remix package versions - fixes breaking v2 change - removes v2 future flags - removes skipLibCheck from tsconfig * feat: add frontend typecheck to ci * chore(MASE): upgrade routes to remix v2 * chore(MASE): upgrade module format to v2 * chore(MASE): update to v2 dev server * chore(MASE): update headers to v2 * chore(MASE): update form method to v2 * chore(MASE): update meta to v2 * chore(MASE): update error/catch boundary to v2 * feat(MASE): upgrade remix to v2 * fix(MASE): ts errors * feat(MASE): add typecheck cmd to ci * fix(frontend, MASE): remix server start * fix(MASE): eslint * refactor(MASE): parseQueryString to URLSearchParams * Update .github/workflows/lint_test_build.yml Co-authored-by: Radu-Cristian Popa <[email protected]> * fix(frontend,MASE): update entry.server request handlers * chore(MASE): format * chore(MASE): rm unused quotes route * Revert "Merge branch 'main' into bc/1464/remix-v2-updates" This reverts commit f7149aa, reversing changes made to 41673bb. * chore: cherry pick merge commit after reverting in f7149aa chore: upgrade to typescript 5 (#2345) * feat: upgrade ts to 5.0 * fix(auth): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore(auth): rm unecessary type assertion * fix(backend): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore: rm default tsconfig option forceConsistentCasingInFileNames defaults to true in ts 5.0 * chore: update package versions * chore: rm unused optoin * chore: rm typescript dev dep from pacakges * fix(frontend,MASE): mobile view * fix(frontend): no flash on mobile * refactor: rework new cookie secure env var * fix: move env var declaration from dockerfile to compose * feat(backend): upgrade Rafiki to open payments package v6.5 (#2337) * feat(backend): upgrade to open payments 6.5 * refactor: one singleton for openApi specs * chore(deps): update dependency autoprefixer to ^10.4.17 (#2352) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: update lockfile * chore: rm extra space * chore: rm unnecessary eslint ignore --------- Co-authored-by: Radu-Cristian Popa <[email protected]> Co-authored-by: Sabine Schaller <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* feat: upgrade ts to 5.0 * fix(auth): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore(auth): rm unecessary type assertion * fix(backend): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore: rm default tsconfig option forceConsistentCasingInFileNames defaults to true in ts 5.0 * chore: update package versions * chore: rm unused optoin * chore: rm typescript dev dep from pacakges
* chore(frontend): update error boundaries to v2 * chore(frontend): update meta to v2 * chore(frontend): update headers to v2 * chore(frontend): update form method to v2 * chore(frontend): update to v2 dev server * chore(frontend): update server module format to v2 * feat(frontend): typecheck cmd * fix(frontend): type only import * feat(frontend): ugprade remix to v2 - upgrades all remix package versions - fixes breaking v2 change - removes v2 future flags - removes skipLibCheck from tsconfig * feat: add frontend typecheck to ci * chore(MASE): upgrade routes to remix v2 * chore(MASE): upgrade module format to v2 * chore(MASE): update to v2 dev server * chore(MASE): update headers to v2 * chore(MASE): update form method to v2 * chore(MASE): update meta to v2 * chore(MASE): update error/catch boundary to v2 * feat(MASE): upgrade remix to v2 * fix(MASE): ts errors * feat(MASE): add typecheck cmd to ci * fix(frontend, MASE): remix server start * fix(MASE): eslint * refactor(MASE): parseQueryString to URLSearchParams * Update .github/workflows/lint_test_build.yml Co-authored-by: Radu-Cristian Popa <[email protected]> * fix(frontend,MASE): update entry.server request handlers * chore(MASE): format * chore(MASE): rm unused quotes route * Revert "Merge branch 'main' into bc/1464/remix-v2-updates" This reverts commit f7149aa, reversing changes made to 41673bb. * chore: cherry pick merge commit after reverting in f7149aa chore: upgrade to typescript 5 (#2345) * feat: upgrade ts to 5.0 * fix(auth): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore(auth): rm unecessary type assertion * fix(backend): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore: rm default tsconfig option forceConsistentCasingInFileNames defaults to true in ts 5.0 * chore: update package versions * chore: rm unused optoin * chore: rm typescript dev dep from pacakges * fix(frontend,MASE): mobile view * fix(frontend): no flash on mobile * refactor: rework new cookie secure env var * fix: move env var declaration from dockerfile to compose * feat(backend): upgrade Rafiki to open payments package v6.5 (#2337) * feat(backend): upgrade to open payments 6.5 * refactor: one singleton for openApi specs * chore(deps): update dependency autoprefixer to ^10.4.17 (#2352) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: update lockfile * chore: rm extra space * chore: rm unnecessary eslint ignore --------- Co-authored-by: Radu-Cristian Popa <[email protected]> Co-authored-by: Sabine Schaller <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* feat: upgrade ts to 5.0 * fix(auth): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore(auth): rm unecessary type assertion * fix(backend): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore: rm default tsconfig option forceConsistentCasingInFileNames defaults to true in ts 5.0 * chore: update package versions * chore: rm unused optoin * chore: rm typescript dev dep from pacakges
* chore(frontend): update error boundaries to v2 * chore(frontend): update meta to v2 * chore(frontend): update headers to v2 * chore(frontend): update form method to v2 * chore(frontend): update to v2 dev server * chore(frontend): update server module format to v2 * feat(frontend): typecheck cmd * fix(frontend): type only import * feat(frontend): ugprade remix to v2 - upgrades all remix package versions - fixes breaking v2 change - removes v2 future flags - removes skipLibCheck from tsconfig * feat: add frontend typecheck to ci * chore(MASE): upgrade routes to remix v2 * chore(MASE): upgrade module format to v2 * chore(MASE): update to v2 dev server * chore(MASE): update headers to v2 * chore(MASE): update form method to v2 * chore(MASE): update meta to v2 * chore(MASE): update error/catch boundary to v2 * feat(MASE): upgrade remix to v2 * fix(MASE): ts errors * feat(MASE): add typecheck cmd to ci * fix(frontend, MASE): remix server start * fix(MASE): eslint * refactor(MASE): parseQueryString to URLSearchParams * Update .github/workflows/lint_test_build.yml Co-authored-by: Radu-Cristian Popa <[email protected]> * fix(frontend,MASE): update entry.server request handlers * chore(MASE): format * chore(MASE): rm unused quotes route * Revert "Merge branch 'main' into bc/1464/remix-v2-updates" This reverts commit f7149aa, reversing changes made to 41673bb. * chore: cherry pick merge commit after reverting in f7149aa chore: upgrade to typescript 5 (#2345) * feat: upgrade ts to 5.0 * fix(auth): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore(auth): rm unecessary type assertion * fix(backend): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore: rm default tsconfig option forceConsistentCasingInFileNames defaults to true in ts 5.0 * chore: update package versions * chore: rm unused optoin * chore: rm typescript dev dep from pacakges * fix(frontend,MASE): mobile view * fix(frontend): no flash on mobile * refactor: rework new cookie secure env var * fix: move env var declaration from dockerfile to compose * feat(backend): upgrade Rafiki to open payments package v6.5 (#2337) * feat(backend): upgrade to open payments 6.5 * refactor: one singleton for openApi specs * chore(deps): update dependency autoprefixer to ^10.4.17 (#2352) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: update lockfile * chore: rm extra space * chore: rm unnecessary eslint ignore --------- Co-authored-by: Radu-Cristian Popa <[email protected]> Co-authored-by: Sabine Schaller <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* feat: upgrade ts to 5.0 * fix(auth): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore(auth): rm unecessary type assertion * fix(backend): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore: rm default tsconfig option forceConsistentCasingInFileNames defaults to true in ts 5.0 * chore: update package versions * chore: rm unused optoin * chore: rm typescript dev dep from pacakges
* chore(frontend): update error boundaries to v2 * chore(frontend): update meta to v2 * chore(frontend): update headers to v2 * chore(frontend): update form method to v2 * chore(frontend): update to v2 dev server * chore(frontend): update server module format to v2 * feat(frontend): typecheck cmd * fix(frontend): type only import * feat(frontend): ugprade remix to v2 - upgrades all remix package versions - fixes breaking v2 change - removes v2 future flags - removes skipLibCheck from tsconfig * feat: add frontend typecheck to ci * chore(MASE): upgrade routes to remix v2 * chore(MASE): upgrade module format to v2 * chore(MASE): update to v2 dev server * chore(MASE): update headers to v2 * chore(MASE): update form method to v2 * chore(MASE): update meta to v2 * chore(MASE): update error/catch boundary to v2 * feat(MASE): upgrade remix to v2 * fix(MASE): ts errors * feat(MASE): add typecheck cmd to ci * fix(frontend, MASE): remix server start * fix(MASE): eslint * refactor(MASE): parseQueryString to URLSearchParams * Update .github/workflows/lint_test_build.yml Co-authored-by: Radu-Cristian Popa <[email protected]> * fix(frontend,MASE): update entry.server request handlers * chore(MASE): format * chore(MASE): rm unused quotes route * Revert "Merge branch 'main' into bc/1464/remix-v2-updates" This reverts commit f7149aa, reversing changes made to 41673bb. * chore: cherry pick merge commit after reverting in f7149aa chore: upgrade to typescript 5 (#2345) * feat: upgrade ts to 5.0 * fix(auth): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore(auth): rm unecessary type assertion * fix(backend): ts2365 build error fixes Forbidden Implicit Coercions in Relational Operators https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#forbidden-implicit-coercions-in-relational-operators * chore: rm default tsconfig option forceConsistentCasingInFileNames defaults to true in ts 5.0 * chore: update package versions * chore: rm unused optoin * chore: rm typescript dev dep from pacakges * fix(frontend,MASE): mobile view * fix(frontend): no flash on mobile * refactor: rework new cookie secure env var * fix: move env var declaration from dockerfile to compose * feat(backend): upgrade Rafiki to open payments package v6.5 (#2337) * feat(backend): upgrade to open payments 6.5 * refactor: one singleton for openApi specs * chore(deps): update dependency autoprefixer to ^10.4.17 (#2352) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: update lockfile * chore: rm extra space * chore: rm unnecessary eslint ignore --------- Co-authored-by: Radu-Cristian Popa <[email protected]> Co-authored-by: Sabine Schaller <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Changes proposed in this pull request
Context
Checklist
fixes #number