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

@@ -86,25 +86,35 @@ export class SendGroupingsComponent extends BaseSendComponent {
}
if (!this.syncService.syncInProgress) {
// 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.load();
} else {
this.loadedTimeout = window.setTimeout(() => {
if (!this.loaded) {
// 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.load();
}
}, 5000);
}
if (!this.syncService.syncInProgress || restoredScopeState) {
// 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
BrowserPopupUtils.setContentScrollY(window, this.state?.scrollY);
}
// Load all sends if sync completed in background
this.broadcasterService.subscribe(ComponentId, (message: any) => {
// 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.ngZone.run(async () => {
switch (message.command) {
case "syncCompleted":
window.setTimeout(() => {
// 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.load();
}, 500);
break;
@@ -123,16 +133,22 @@ export class SendGroupingsComponent extends BaseSendComponent {
window.clearTimeout(this.loadedTimeout);
}
// Save state
// 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.saveState();
// Unsubscribe
this.broadcasterService.unsubscribe(ComponentId);
}
async selectType(type: SendType) {
// 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(["/send-type"], { queryParams: { type: type } });
}
async selectSend(s: SendView) {
// 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(["/edit-send"], { queryParams: { sendId: s.id } });
}
@@ -140,6 +156,8 @@ export class SendGroupingsComponent extends BaseSendComponent {
if (this.disableSend) {
return;
}
// 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(["/add-send"]);
}
@@ -147,6 +165,8 @@ export class SendGroupingsComponent extends BaseSendComponent {
if (this.disableSend) {
return;
}
// 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
super.removePassword(s);
}