diff --git a/apps/browser/src/auth/popup/account-switching/services/account-switcher.service.ts b/apps/browser/src/auth/popup/account-switching/services/account-switcher.service.ts index 7bb12fc260..99d2c83283 100644 --- a/apps/browser/src/auth/popup/account-switching/services/account-switcher.service.ts +++ b/apps/browser/src/auth/popup/account-switching/services/account-switcher.service.ts @@ -160,7 +160,7 @@ export class AccountSwitcherService { throwError(() => new Error(AccountSwitcherService.incompleteAccountSwitchError)), }), ), - ).catch((err) => { + ).catch((err): any => { if ( err instanceof Error && err.message === AccountSwitcherService.incompleteAccountSwitchError diff --git a/apps/browser/src/autofill/services/autofill.service.ts b/apps/browser/src/autofill/services/autofill.service.ts index 0e238d14d2..ca735f8f4f 100644 --- a/apps/browser/src/autofill/services/autofill.service.ts +++ b/apps/browser/src/autofill/services/autofill.service.ts @@ -161,7 +161,7 @@ export default class AutofillService implements AutofillServiceInterface { // Create a timeout observable that emits an empty array if pageDetailsFromTab$ hasn't emitted within 1 second. const pageDetailsTimeout$ = timer(1000).pipe( - map(() => []), + map((): any => []), takeUntil(sharedPageDetailsFromTab$), ); diff --git a/apps/browser/src/platform/popup/services/browser-router.service.ts b/apps/browser/src/platform/popup/services/browser-router.service.ts index 2d449b8a0f..e1de1fdd29 100644 --- a/apps/browser/src/platform/popup/services/browser-router.service.ts +++ b/apps/browser/src/platform/popup/services/browser-router.service.ts @@ -21,9 +21,7 @@ export class BrowserRouterService { child = child.firstChild; } - // TODO: Eslint upgrade. Please resolve this since the ?? does nothing - // eslint-disable-next-line no-constant-binary-expression - const updateUrl = !child?.data?.doNotSaveUrl ?? true; + const updateUrl = !child?.data?.doNotSaveUrl; if (updateUrl) { this.setPreviousUrl(event.url); diff --git a/apps/browser/src/platform/popup/view-cache/popup-router-cache.service.ts b/apps/browser/src/platform/popup/view-cache/popup-router-cache.service.ts index b545618c0c..2e9746642f 100644 --- a/apps/browser/src/platform/popup/view-cache/popup-router-cache.service.ts +++ b/apps/browser/src/platform/popup/view-cache/popup-router-cache.service.ts @@ -62,9 +62,7 @@ export class PopupRouterCacheService { child = child.firstChild; } - // TODO: Eslint upgrade. Please resolve this since the ?? does nothing - // eslint-disable-next-line no-constant-binary-expression - return !child?.data?.doNotSaveUrl ?? true; + return !child?.data?.doNotSaveUrl; }), switchMap((event) => this.push(event.url)), ) diff --git a/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.spec.ts b/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.spec.ts index eecd1f2fd6..692e21d008 100644 --- a/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.spec.ts +++ b/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.spec.ts @@ -761,11 +761,13 @@ function createSeededVaultPopupListFiltersService( const collectionServiceMock = { decryptedCollections$: () => seededCollections$, getAllNested: () => - seededCollections$.value.map((c) => ({ - children: [], - node: c, - parent: null, - })), + seededCollections$.value.map( + (c): TreeNode => ({ + children: [], + node: c, + parent: null as any, + }), + ), } as any; const folderServiceMock = { diff --git a/apps/desktop/src/vault/app/vault/vault-v2.component.ts b/apps/desktop/src/vault/app/vault/vault-v2.component.ts index 3fdb14aa15..aa631c44c6 100644 --- a/apps/desktop/src/vault/app/vault/vault-v2.component.ts +++ b/apps/desktop/src/vault/app/vault/vault-v2.component.ts @@ -290,7 +290,7 @@ export class VaultV2Component ) { const value = await firstValueFrom( this.totpService.getCode$(this.cipher.login.totp), - ).catch(() => null); + ).catch((): any => null); if (value) { this.copyValue(this.cipher, value.code, "verificationCodeTotp", "TOTP"); } @@ -329,7 +329,7 @@ export class VaultV2Component this.activeUserId = await firstValueFrom( this.accountService.activeAccount$.pipe(getUserId), - ).catch(() => null); + ).catch((): any => null); if (this.activeUserId) { this.cipherService @@ -448,7 +448,7 @@ export class VaultV2Component const dialogRef = AttachmentsV2Component.open(this.dialogService, { cipherId: this.cipherId as CipherId, }); - const result = await firstValueFrom(dialogRef.closed).catch(() => null); + const result = await firstValueFrom(dialogRef.closed).catch((): any => null); if ( result?.action === AttachmentDialogResult.Removed || result?.action === AttachmentDialogResult.Uploaded @@ -574,7 +574,7 @@ export class VaultV2Component click: async () => { const value = await firstValueFrom( this.totpService.getCode$(cipher.login.totp), - ).catch(() => null); + ).catch((): any => null); if (value) { this.copyValue(cipher, value.code, "verificationCodeTotp", "TOTP"); } @@ -617,7 +617,7 @@ export class VaultV2Component async buildFormConfig(action: CipherFormMode) { this.config = await this.formConfigService .buildConfig(action, this.cipherId as CipherId, this.addType) - .catch(() => null); + .catch((): any => null); } async editCipher(cipher: CipherView) { diff --git a/apps/web/src/app/billing/services/subscription-pricing.service.ts b/apps/web/src/app/billing/services/subscription-pricing.service.ts index fad797bed5..82ec9f180b 100644 --- a/apps/web/src/app/billing/services/subscription-pricing.service.ts +++ b/apps/web/src/app/billing/services/subscription-pricing.service.ts @@ -110,7 +110,7 @@ export class SubscriptionPricingService { ); private free$: Observable = 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 = 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() { diff --git a/apps/web/src/app/core/router.service.ts b/apps/web/src/app/core/router.service.ts index 603c171e95..7a2e53a374 100644 --- a/apps/web/src/app/core/router.service.ts +++ b/apps/web/src/app/core/router.service.ts @@ -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); diff --git a/apps/web/src/app/layouts/product-switcher/shared/product-switcher.service.ts b/apps/web/src/app/layouts/product-switcher/shared/product-switcher.service.ts index ba86e9fed2..95acf4447e 100644 --- a/apps/web/src/app/layouts/product-switcher/shared/product-switcher.service.ts +++ b/apps/web/src/app/layouts/product-switcher/shared/product-switcher.service.ts @@ -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, diff --git a/apps/web/src/app/vault/components/vault-items/vault-items.component.ts b/apps/web/src/app/vault/components/vault-items/vault-items.component.ts index a5bcb91571..82ddda6611 100644 --- a/apps/web/src/app/vault/components/vault-items/vault-items.component.ts +++ b/apps/web/src/app/vault/components/vault-items/vault-items.component.ts @@ -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 { .every(({ cipher }) => cipher?.edit && cipher?.viewPassword); } - private getUniqueOrganizationIds(): Set { + private getUniqueOrganizationIds(): Set { return new Set(this.selection.selected.flatMap((i) => i.cipher?.organizationId ?? [])); } diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/projects/project/project-people.component.ts b/bitwarden_license/bit-web/src/app/secrets-manager/projects/project/project-people.component.ts index 13f8092055..ec7397a22a 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/projects/project/project-people.component.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/projects/project/project-people.component.ts @@ -41,7 +41,7 @@ export class ProjectPeopleComponent implements OnInit, OnDestroy { return convertToAccessPolicyItemViews(policies); }), ), - catchError(async () => { + catchError(async (): Promise => { this.logService.info("Error fetching project people access policies."); await this.router.navigate(["/sm", this.organizationId, "projects"]); return undefined; diff --git a/libs/auth/src/common/login-strategies/webauthn-login.strategy.spec.ts b/libs/auth/src/common/login-strategies/webauthn-login.strategy.spec.ts index f5ba2d0be2..25ae8a31ef 100644 --- a/libs/auth/src/common/login-strategies/webauthn-login.strategy.spec.ts +++ b/libs/auth/src/common/login-strategies/webauthn-login.strategy.spec.ts @@ -75,7 +75,7 @@ describe("WebAuthnLoginStrategy", () => { // We must do this to make the mocked classes available for all the // assertCredential(...) tests. - global.PublicKeyCredential = MockPublicKeyCredential; + global.PublicKeyCredential = MockPublicKeyCredential as any; global.AuthenticatorAssertionResponse = MockAuthenticatorAssertionResponse; }); @@ -397,4 +397,8 @@ export class MockPublicKeyCredential implements PublicKeyCredential { static isUserVerifyingPlatformAuthenticatorAvailable(): Promise { return Promise.resolve(false); } + + toJSON() { + throw new Error("Method not implemented."); + } } diff --git a/libs/common/src/auth/services/webauthn-login/webauthn-login.service.spec.ts b/libs/common/src/auth/services/webauthn-login/webauthn-login.service.spec.ts index 56aa1139cd..b848cb2f90 100644 --- a/libs/common/src/auth/services/webauthn-login/webauthn-login.service.spec.ts +++ b/libs/common/src/auth/services/webauthn-login/webauthn-login.service.spec.ts @@ -38,7 +38,7 @@ describe("WebAuthnLoginService", () => { // We must do this to make the mocked classes available for all the // assertCredential(...) tests. - global.PublicKeyCredential = MockPublicKeyCredential; + global.PublicKeyCredential = MockPublicKeyCredential as any; global.AuthenticatorAssertionResponse = MockAuthenticatorAssertionResponse; // Save the original navigator @@ -316,6 +316,10 @@ class MockPublicKeyCredential implements PublicKeyCredential { static isUserVerifyingPlatformAuthenticatorAvailable(): Promise { return Promise.resolve(false); } + + toJSON() { + throw new Error("Method not implemented."); + } } function buildCredentialAssertionOptions(): WebAuthnLoginCredentialAssertionOptionsView { diff --git a/libs/common/src/vault/utils/observable-utilities.ts b/libs/common/src/vault/utils/observable-utilities.ts index cdec51fc95..025da8a36f 100644 --- a/libs/common/src/vault/utils/observable-utilities.ts +++ b/libs/common/src/vault/utils/observable-utilities.ts @@ -30,7 +30,7 @@ export function perUserCache$( create(userId), clearBuffer$.pipe( filter((clearId) => clearId === userId || clearId === null), - map(() => null), + map((): any => null), ), ).pipe(shareReplay({ bufferSize: 1, refCount: false })); cache.set(userId, observable); diff --git a/libs/vault/src/cipher-form/components/additional-options/additional-options-section.component.spec.ts b/libs/vault/src/cipher-form/components/additional-options/additional-options-section.component.spec.ts index 16588f9280..6d0266dd0f 100644 --- a/libs/vault/src/cipher-form/components/additional-options/additional-options-section.component.spec.ts +++ b/libs/vault/src/cipher-form/components/additional-options/additional-options-section.component.spec.ts @@ -28,7 +28,7 @@ describe("AdditionalOptionsSectionComponent", () => { let passwordRepromptService: MockProxy; let passwordRepromptEnabled$: BehaviorSubject; - const getInitialCipherView = jest.fn(() => null); + const getInitialCipherView = jest.fn((): any => null); const formStatusChange$ = new BehaviorSubject<"enabled" | "disabled">("enabled"); beforeEach(async () => { diff --git a/libs/vault/src/cipher-form/components/autofill-options/autofill-options.component.spec.ts b/libs/vault/src/cipher-form/components/autofill-options/autofill-options.component.spec.ts index 3654dc4fe1..afbf1d8664 100644 --- a/libs/vault/src/cipher-form/components/autofill-options/autofill-options.component.spec.ts +++ b/libs/vault/src/cipher-form/components/autofill-options/autofill-options.component.spec.ts @@ -34,7 +34,7 @@ describe("AutofillOptionsComponent", () => { let domainSettingsService: MockProxy; let autofillSettingsService: MockProxy; let platformUtilsService: MockProxy; - const getInitialCipherView = jest.fn(() => null); + const getInitialCipherView = jest.fn((): any => null); const formStatusChange$ = new BehaviorSubject<"enabled" | "disabled">("enabled"); beforeEach(async () => { diff --git a/libs/vault/src/cipher-form/components/card-details-section/card-details-section.component.spec.ts b/libs/vault/src/cipher-form/components/card-details-section/card-details-section.component.spec.ts index 32baad189c..9233f1fa40 100644 --- a/libs/vault/src/cipher-form/components/card-details-section/card-details-section.component.spec.ts +++ b/libs/vault/src/cipher-form/components/card-details-section/card-details-section.component.spec.ts @@ -20,7 +20,7 @@ describe("CardDetailsSectionComponent", () => { let registerChildFormSpy: jest.SpyInstance; let patchCipherSpy: jest.SpyInstance; - const getInitialCipherView = jest.fn(() => null); + const getInitialCipherView = jest.fn((): any => null); beforeEach(async () => { cipherFormProvider = mock({ getInitialCipherView }); diff --git a/libs/vault/src/cipher-form/components/cipher-form.component.spec.ts b/libs/vault/src/cipher-form/components/cipher-form.component.spec.ts index 970e6b1fb9..ac384ee3fd 100644 --- a/libs/vault/src/cipher-form/components/cipher-form.component.spec.ts +++ b/libs/vault/src/cipher-form/components/cipher-form.component.spec.ts @@ -37,7 +37,7 @@ describe("CipherFormComponent", () => { provide: CipherFormCacheService, useValue: { init: jest.fn(), getCachedCipherView: jest.fn() }, }, - { provide: ViewCacheService, useValue: { signal: jest.fn(() => () => null) } }, + { provide: ViewCacheService, useValue: { signal: jest.fn(() => (): any => null) } }, { provide: ConfigService, useValue: mock() }, ], }).compileComponents(); diff --git a/libs/vault/src/cipher-form/components/login-details-section/login-details-section.component.spec.ts b/libs/vault/src/cipher-form/components/login-details-section/login-details-section.component.spec.ts index b07a50fd38..d6fe8a6492 100644 --- a/libs/vault/src/cipher-form/components/login-details-section/login-details-section.component.spec.ts +++ b/libs/vault/src/cipher-form/components/login-details-section/login-details-section.component.spec.ts @@ -42,7 +42,7 @@ describe("LoginDetailsSectionComponent", () => { let configService: MockProxy; const collect = jest.fn().mockResolvedValue(null); - const getInitialCipherView = jest.fn(() => null); + const getInitialCipherView = jest.fn((): any => null); beforeEach(async () => { getInitialCipherView.mockClear(); diff --git a/package-lock.json b/package-lock.json index afcedcfaf7..d5c0472d38 100644 --- a/package-lock.json +++ b/package-lock.json @@ -173,7 +173,7 @@ "ts-loader": "9.5.2", "tsconfig-paths-webpack-plugin": "4.2.0", "type-fest": "2.19.0", - "typescript": "5.5.4", + "typescript": "5.8.3", "typescript-eslint": "8.31.0", "typescript-strict-plugin": "2.4.4", "url": "0.11.4", @@ -38542,9 +38542,10 @@ } }, "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", diff --git a/package.json b/package.json index 5015f8278b..97c6cc0eea 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "ts-loader": "9.5.2", "tsconfig-paths-webpack-plugin": "4.2.0", "type-fest": "2.19.0", - "typescript": "5.5.4", + "typescript": "5.8.3", "typescript-eslint": "8.31.0", "typescript-strict-plugin": "2.4.4", "url": "0.11.4",