From 499715cac3db74ce13df9a7ae9b4b0985d457466 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Fri, 16 May 2025 09:23:38 +0200 Subject: [PATCH] Upgrade typescript to 5.5 (#14794) Typescript 5.5 is supported by our existing Angular version and the next major. Since there are some breaking changes we're creating a separate PR to handle this upgrade and tackling the breaking changes. TS seems to have changed how they type infer boolean conditions and it infers into type is which means the overloaded function has a different signature. Explicitly marking the return type as boolean makes the TS compiler happy without the behaviour changing. --- .../organizations/settings/two-factor-setup.component.ts | 2 +- .../settings/two-factor/two-factor-setup.component.ts | 2 +- package-lock.json | 9 ++++----- package.json | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/apps/web/src/app/admin-console/organizations/settings/two-factor-setup.component.ts b/apps/web/src/app/admin-console/organizations/settings/two-factor-setup.component.ts index d14e912f83e..020a16dd932 100644 --- a/apps/web/src/app/admin-console/organizations/settings/two-factor-setup.component.ts +++ b/apps/web/src/app/admin-console/organizations/settings/two-factor-setup.component.ts @@ -119,7 +119,7 @@ export class TwoFactorSetupComponent extends BaseTwoFactorSetupComponent impleme return this.apiService.getTwoFactorOrganizationProviders(this.organizationId); } - protected filterProvider(type: TwoFactorProviderType) { + protected filterProvider(type: TwoFactorProviderType): boolean { return type !== TwoFactorProviderType.OrganizationDuo; } } diff --git a/apps/web/src/app/auth/settings/two-factor/two-factor-setup.component.ts b/apps/web/src/app/auth/settings/two-factor/two-factor-setup.component.ts index d240dc467ae..88c9eea2cb0 100644 --- a/apps/web/src/app/auth/settings/two-factor/two-factor-setup.component.ts +++ b/apps/web/src/app/auth/settings/two-factor/two-factor-setup.component.ts @@ -273,7 +273,7 @@ export class TwoFactorSetupComponent implements OnInit, OnDestroy { return this.apiService.getTwoFactorProviders(); } - protected filterProvider(type: TwoFactorProviderType) { + protected filterProvider(type: TwoFactorProviderType): boolean { return type === TwoFactorProviderType.OrganizationDuo; } diff --git a/package-lock.json b/package-lock.json index 5bb5dc6e852..96cd9c0444a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -172,7 +172,7 @@ "ts-loader": "9.5.2", "tsconfig-paths-webpack-plugin": "4.2.0", "type-fest": "2.19.0", - "typescript": "5.4.2", + "typescript": "5.5.4", "typescript-eslint": "8.31.0", "typescript-strict-plugin": "2.4.4", "url": "0.11.4", @@ -36642,11 +36642,10 @@ } }, "node_modules/typescript": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", - "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", "dev": true, - "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index b1af1abe606..879dfd26eba 100644 --- a/package.json +++ b/package.json @@ -55,10 +55,10 @@ "@storybook/addon-essentials": "8.6.12", "@storybook/addon-interactions": "8.6.12", "@storybook/addon-links": "8.6.12", - "@storybook/test-runner": "0.22.0", "@storybook/addon-themes": "8.6.12", "@storybook/angular": "8.6.12", "@storybook/manager-api": "8.6.12", + "@storybook/test-runner": "0.22.0", "@storybook/theming": "8.6.12", "@storybook/web-components-webpack5": "8.6.12", "@types/argon2-browser": "1.18.4", @@ -138,7 +138,7 @@ "ts-loader": "9.5.2", "tsconfig-paths-webpack-plugin": "4.2.0", "type-fest": "2.19.0", - "typescript": "5.4.2", + "typescript": "5.5.4", "typescript-eslint": "8.31.0", "typescript-strict-plugin": "2.4.4", "url": "0.11.4",