1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 03:03:43 +00:00

Add eslint rule no-floating-promises (#7789)

* add eslint rule no-floating-promises

* add eslint-disable comment to offending lines
This commit is contained in:
Will Martin
2024-02-02 15:13:37 -05:00
committed by GitHub
parent 6e96964c1a
commit cb8849c355
273 changed files with 1602 additions and 0 deletions

View File

@@ -102,6 +102,8 @@ export class ClientsComponent implements OnInit {
isPaging() {
const searching = this.isSearching();
if (searching && this.didScroll) {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.resetPaging();
}
return !searching && this.clients && this.clients.length > this.pageSize;

View File

@@ -54,6 +54,8 @@ export class EventsComponent extends BaseEventsComponent implements OnInit {
this.providerId = params.providerId;
const provider = await this.providerService.get(this.providerId);
if (provider == null || !provider.useEvents) {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.router.navigate(["/providers", this.providerId]);
return;
}

View File

@@ -94,6 +94,8 @@ export class PeopleComponent
const provider = await this.providerService.get(this.providerId);
if (!provider.canManageUsers) {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.router.navigate(["../"], { relativeTo: this.route });
return;
}
@@ -108,6 +110,8 @@ export class PeopleComponent
if (qParams.viewEvents != null) {
const user = this.users.filter((u) => u.id === qParams.viewEvents);
if (user.length > 0 && user[0].status === ProviderUserStatusType.Confirmed) {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.events(user[0]);
}
}
@@ -215,6 +219,8 @@ export class PeopleComponent
try {
const request = new ProviderUserBulkRequest(filteredUsers.map((user) => user.id));
const response = this.apiService.postManyProviderUserReinvite(this.providerId, request);
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.showBulkStatus(
users,
filteredUsers,

View File

@@ -51,6 +51,8 @@ export class SetupComponent implements OnInit {
this.i18nService.t("emergencyInviteAcceptFailed"),
{ timeout: 10000 },
);
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.router.navigate(["/"]);
return;
}
@@ -62,10 +64,14 @@ export class SetupComponent implements OnInit {
try {
const provider = await this.apiService.getProvider(this.providerId);
if (provider.name != null) {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.router.navigate(["/providers", provider.id], { replaceUrl: true });
}
} catch (e) {
this.validationService.showError(e);
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.router.navigate(["/"]);
}
});
@@ -92,6 +98,8 @@ export class SetupComponent implements OnInit {
this.platformUtilsService.showToast("success", null, this.i18nService.t("providerSetup"));
await this.syncService.fullSync(true);
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.router.navigate(["/providers", provider.id]);
} catch (e) {
this.validationService.showError(e);