1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 05:13:29 +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

@@ -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

View File

@@ -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$),
);

View File

@@ -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);

View File

@@ -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)),
)

View File

@@ -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<CollectionView> => ({
children: [],
node: c,
parent: null as any,
}),
),
} as any;
const folderServiceMock = {