Skip to content

Commit

Permalink
chore: upgrade to typescript 5 (#2345)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
BlairCurrey authored Jan 24, 2024
1 parent 353f232 commit 8430b2c
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 113 deletions.
1 change: 0 additions & 1 deletion localenv/mock-account-servicing-entity/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"target": "ES2019",
"strict": true,
"allowJs": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"prettier": "^3.2.2",
"ts-jest": "^29.1.1",
"tunnelmole": "^2.2.13",
"typescript": "^4.9.5",
"typescript": "^5.3.3",
"uuid": "^9.0.1"
},
"dependenciesMeta": {
Expand Down
3 changes: 1 addition & 2 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"node-mocks-http": "^1.14.1",
"openapi-types": "^12.1.3",
"pino-pretty": "^10.3.1",
"testcontainers": "^10.5.0",
"typescript": "^4.9.5"
"testcontainers": "^10.5.0"
}
}
2 changes: 1 addition & 1 deletion packages/auth/src/graphql/scalars/UInt8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
return nValue
}
throw new GraphQLError('Provided value is not a UInt8.', {
Expand Down
4 changes: 1 addition & 3 deletions packages/auth/src/tests/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export function createContext<T extends AppContext>(
maxAge: 60 * 1000,
signed: true
},
// 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
)
)
const ctx = koa.createContext(req, res)
Expand Down
3 changes: 1 addition & 2 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
"rosie": "^2.1.1",
"testcontainers": "^10.5.0",
"tmp": "^0.2.1",
"ts-node": "^10.9.2",
"typescript": "^4.9.5"
"ts-node": "^10.9.2"
},
"dependencies": {
"@adonisjs/fold": "^8.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/graphql/scalars/UInt8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
return nValue
}
throw new GraphQLError('Provided value is not a UInt8.', {
Expand Down
3 changes: 1 addition & 2 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
"eslint-plugin-react": "^7.33.2",
"postcss": "^8.4.30",
"prettier": "^3.2.2",
"tailwindcss": "^3.4.1",
"typescript": "^4.9.5"
"tailwindcss": "^3.4.1"
},
"engines": {
"node": "18"
Expand Down
1 change: 0 additions & 1 deletion packages/frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"target": "ES2019",
"strict": true,
"allowJs": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
Expand Down
3 changes: 1 addition & 2 deletions packages/token-introspection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"devDependencies": {
"@types/node": "^18.7.12",
"nock": "^13.4.0",
"openapi-typescript": "^6.7.4",
"typescript": "^4.9.5"
"openapi-typescript": "^6.7.4"
},
"dependencies": {
"@interledger/openapi": "1.2.1",
Expand Down
Loading

0 comments on commit 8430b2c

Please sign in to comment.