1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PM-22305] Upgrade typescript to 5.8 (#15044)

Upgrade to the latest supported typescript version in Angular.

Resolved TS errors by:
  - adding `: any` which is what the compiler previously implied and now warns about.
  - adding `toJSON` to satisfy requirement.
This commit is contained in:
Oscar Hinton
2025-10-06 18:39:40 +02:00
committed by GitHub
parent 2ce194c190
commit 8cf379d997
21 changed files with 60 additions and 52 deletions

View File

@@ -110,7 +110,7 @@ export class SubscriptionPricingService {
);
private free$: Observable<BusinessSubscriptionPricingTier> = this.plansResponse$.pipe(
map((plans) => {
map((plans): BusinessSubscriptionPricingTier => {
const freePlan = plans.data.find((plan) => plan.type === PlanType.Free)!;
return {
@@ -215,20 +215,22 @@ export class SubscriptionPricingService {
);
private custom$: Observable<BusinessSubscriptionPricingTier> = this.plansResponse$.pipe(
map(() => ({
id: BusinessSubscriptionPricingTierIds.Custom,
name: this.i18nService.t("planNameCustom"),
description: this.i18nService.t("planDescCustom"),
availableCadences: [],
passwordManager: {
type: "custom",
features: [
this.featureTranslations.strengthenCybersecurity(),
this.featureTranslations.boostProductivity(),
this.featureTranslations.seamlessIntegration(),
],
},
})),
map(
(): BusinessSubscriptionPricingTier => ({
id: BusinessSubscriptionPricingTierIds.Custom,
name: this.i18nService.t("planNameCustom"),
description: this.i18nService.t("planDescCustom"),
availableCadences: [],
passwordManager: {
type: "custom",
features: [
this.featureTranslations.strengthenCybersecurity(),
this.featureTranslations.boostProductivity(),
this.featureTranslations.seamlessIntegration(),
],
},
}),
),
);
private showUnexpectedErrorToast() {

View File

@@ -75,9 +75,7 @@ export class RouterService {
const titleId: string = child?.snapshot?.data?.titleId;
const rawTitle: string = child?.snapshot?.data?.title;
// TODO: Eslint upgrade. Please resolve this since the ?? does nothing
// eslint-disable-next-line no-constant-binary-expression
const updateUrl = !child?.snapshot?.data?.doNotSaveUrl ?? true;
const updateUrl = !child?.snapshot?.data?.doNotSaveUrl;
if (titleId != null || rawTitle != null) {
const newTitle = rawTitle != null ? rawTitle : i18nService.t(titleId);

View File

@@ -87,7 +87,7 @@ export class ProductSwitcherService {
startWith(null), // Start with a null event to trigger the initial combineLatest
filter((e) => e instanceof NavigationEnd || e instanceof NavigationStart || e === null),
),
]).pipe(map(() => null));
]).pipe(map((): any => null));
constructor(
private organizationService: OrganizationService,

View File

@@ -17,6 +17,7 @@ import {
CipherViewLikeUtils,
} from "@bitwarden/common/vault/utils/cipher-view-like-utils";
import { SortDirection, TableDataSource } from "@bitwarden/components";
import { OrganizationId } from "@bitwarden/sdk-internal";
import { GroupView } from "../../../admin-console/organizations/core";
@@ -579,7 +580,7 @@ export class VaultItemsComponent<C extends CipherViewLike> {
.every(({ cipher }) => cipher?.edit && cipher?.viewPassword);
}
private getUniqueOrganizationIds(): Set<string> {
private getUniqueOrganizationIds(): Set<string | [] | OrganizationId> {
return new Set(this.selection.selected.flatMap((i) => i.cipher?.organizationId ?? []));
}