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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user