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

eslint/ts disable removals (#15418)

This commit is contained in:
Jonathan Prusik
2025-08-05 17:31:41 -04:00
committed by GitHub
parent 326d7bf3bd
commit 598348fcc1
10 changed files with 23 additions and 45 deletions

View File

@@ -20,10 +20,8 @@ export default class TabsBackground {
return; return;
} }
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. void this.updateCurrentTabData();
// eslint-disable-next-line @typescript-eslint/no-floating-promises void this.setupTabEventListeners();
this.updateCurrentTabData();
this.setupTabEventListeners();
} }
/** /**

View File

@@ -1,5 +1,3 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { EVENTS } from "@bitwarden/common/autofill/constants"; import { EVENTS } from "@bitwarden/common/autofill/constants";
import AutofillPageDetails from "../models/autofill-page-details"; import AutofillPageDetails from "../models/autofill-page-details";
@@ -122,7 +120,7 @@ class AutofillInit implements AutofillInitInterface {
* @param {AutofillExtensionMessage} message * @param {AutofillExtensionMessage} message
*/ */
private async fillForm({ fillScript, pageDetailsUrl }: AutofillExtensionMessage) { private async fillForm({ fillScript, pageDetailsUrl }: AutofillExtensionMessage) {
if ((document.defaultView || window).location.href !== pageDetailsUrl) { if ((document.defaultView || window).location.href !== pageDetailsUrl || !fillScript) {
return; return;
} }
@@ -177,7 +175,7 @@ class AutofillInit implements AutofillInitInterface {
message: AutofillExtensionMessage, message: AutofillExtensionMessage,
sender: chrome.runtime.MessageSender, sender: chrome.runtime.MessageSender,
sendResponse: (response?: any) => void, sendResponse: (response?: any) => void,
): boolean => { ): boolean | null => {
const command: string = message.command; const command: string = message.command;
const handler: CallableFunction | undefined = this.getExtensionMessageHandler(command); const handler: CallableFunction | undefined = this.getExtensionMessageHandler(command);
if (!handler) { if (!handler) {

View File

@@ -1,5 +1,3 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { setupExtensionDisconnectAction } from "../utils"; import { setupExtensionDisconnectAction } from "../utils";
if (document.readyState === "loading") { if (document.readyState === "loading") {
@@ -9,7 +7,7 @@ if (document.readyState === "loading") {
} }
function loadAutofiller() { function loadAutofiller() {
let pageHref: string = null; let pageHref: null | string = null;
let filledThisHref = false; let filledThisHref = false;
let delayFillTimeout: number; let delayFillTimeout: number;
let doFillInterval: number | NodeJS.Timeout; let doFillInterval: number | NodeJS.Timeout;
@@ -51,9 +49,7 @@ function loadAutofiller() {
sender: "autofiller", sender: "autofiller",
}; };
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. void chrome.runtime.sendMessage(msg);
// eslint-disable-next-line @typescript-eslint/no-floating-promises
chrome.runtime.sendMessage(msg);
} }
} }

View File

@@ -1,5 +1,3 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { AutofillInlineMenuContentService } from "../overlay/inline-menu/content/autofill-inline-menu-content.service"; import { AutofillInlineMenuContentService } from "../overlay/inline-menu/content/autofill-inline-menu-content.service";
import { AutofillOverlayContentService } from "../services/autofill-overlay-content.service"; import { AutofillOverlayContentService } from "../services/autofill-overlay-content.service";
import DomElementVisibilityService from "../services/dom-element-visibility.service"; import DomElementVisibilityService from "../services/dom-element-visibility.service";
@@ -11,7 +9,7 @@ import AutofillInit from "./autofill-init";
(function (windowContext) { (function (windowContext) {
if (!windowContext.bitwardenAutofillInit) { if (!windowContext.bitwardenAutofillInit) {
let inlineMenuContentService: AutofillInlineMenuContentService; let inlineMenuContentService: undefined | AutofillInlineMenuContentService;
if (globalThis.self === globalThis.top) { if (globalThis.self === globalThis.top) {
inlineMenuContentService = new AutofillInlineMenuContentService(); inlineMenuContentService = new AutofillInlineMenuContentService();
} }

View File

@@ -1,5 +1,3 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { OverlayNotificationsContentService } from "../overlay/notifications/content/overlay-notifications-content.service"; import { OverlayNotificationsContentService } from "../overlay/notifications/content/overlay-notifications-content.service";
import { AutofillOverlayContentService } from "../services/autofill-overlay-content.service"; import { AutofillOverlayContentService } from "../services/autofill-overlay-content.service";
import DomElementVisibilityService from "../services/dom-element-visibility.service"; import DomElementVisibilityService from "../services/dom-element-visibility.service";
@@ -20,7 +18,7 @@ import AutofillInit from "./autofill-init";
inlineMenuFieldQualificationService, inlineMenuFieldQualificationService,
); );
let overlayNotificationsContentService: OverlayNotificationsContentService; let overlayNotificationsContentService: undefined | OverlayNotificationsContentService;
if (globalThis.self === globalThis.top) { if (globalThis.self === globalThis.top) {
overlayNotificationsContentService = new OverlayNotificationsContentService(); overlayNotificationsContentService = new OverlayNotificationsContentService();
} }
@@ -29,7 +27,7 @@ import AutofillInit from "./autofill-init";
domQueryService, domQueryService,
domElementVisibilityService, domElementVisibilityService,
autofillOverlayContentService, autofillOverlayContentService,
null, undefined,
overlayNotificationsContentService, overlayNotificationsContentService,
); );
setupAutofillInitDisconnectAction(windowContext); setupAutofillInitDisconnectAction(windowContext);

View File

@@ -1,5 +1,3 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { AutofillInlineMenuContentService } from "../overlay/inline-menu/content/autofill-inline-menu-content.service"; import { AutofillInlineMenuContentService } from "../overlay/inline-menu/content/autofill-inline-menu-content.service";
import { OverlayNotificationsContentService } from "../overlay/notifications/content/overlay-notifications-content.service"; import { OverlayNotificationsContentService } from "../overlay/notifications/content/overlay-notifications-content.service";
import { AutofillOverlayContentService } from "../services/autofill-overlay-content.service"; import { AutofillOverlayContentService } from "../services/autofill-overlay-content.service";
@@ -12,8 +10,8 @@ import AutofillInit from "./autofill-init";
(function (windowContext) { (function (windowContext) {
if (!windowContext.bitwardenAutofillInit) { if (!windowContext.bitwardenAutofillInit) {
let inlineMenuContentService: AutofillInlineMenuContentService; let inlineMenuContentService: undefined | AutofillInlineMenuContentService;
let overlayNotificationsContentService: OverlayNotificationsContentService; let overlayNotificationsContentService: undefined | OverlayNotificationsContentService;
if (globalThis.self === globalThis.top) { if (globalThis.self === globalThis.top) {
inlineMenuContentService = new AutofillInlineMenuContentService(); inlineMenuContentService = new AutofillInlineMenuContentService();
overlayNotificationsContentService = new OverlayNotificationsContentService(); overlayNotificationsContentService = new OverlayNotificationsContentService();

View File

@@ -1,5 +1,3 @@
(function () { (function () {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. void chrome.runtime.sendMessage({ command: "triggerAutofillScriptInjection" });
// eslint-disable-next-line @typescript-eslint/no-floating-promises
chrome.runtime.sendMessage({ command: "triggerAutofillScriptInjection" });
})(); })();

View File

@@ -213,9 +213,7 @@ export default class AutofillService implements AutofillServiceInterface {
this.autofillScriptPortsSet.delete(port); this.autofillScriptPortsSet.delete(port);
}); });
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. void this.injectAutofillScriptsInAllTabs();
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.injectAutofillScriptsInAllTabs();
} }
/** /**
@@ -470,9 +468,7 @@ export default class AutofillService implements AutofillServiceInterface {
await this.cipherService.updateLastUsedDate(options.cipher.id, activeAccount.id); await this.cipherService.updateLastUsedDate(options.cipher.id, activeAccount.id);
} }
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. void BrowserApi.tabSendMessage(
// eslint-disable-next-line @typescript-eslint/no-floating-promises
BrowserApi.tabSendMessage(
tab, tab,
{ {
command: options.autoSubmitLogin ? "triggerAutoSubmitLogin" : "fillForm", command: options.autoSubmitLogin ? "triggerAutoSubmitLogin" : "fillForm",
@@ -502,9 +498,10 @@ export default class AutofillService implements AutofillServiceInterface {
); );
if (didAutofill) { if (didAutofill) {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. await this.eventCollectionService.collect(
// eslint-disable-next-line @typescript-eslint/no-floating-promises EventType.Cipher_ClientAutofilled,
this.eventCollectionService.collect(EventType.Cipher_ClientAutofilled, options.cipher.id); options.cipher.id,
);
if (totp !== null) { if (totp !== null) {
return totp; return totp;
} else { } else {

View File

@@ -1,5 +1,3 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { firstValueFrom } from "rxjs"; import { firstValueFrom } from "rxjs";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
@@ -15,7 +13,7 @@ const IdleInterval = 60 * 5; // 5 minutes
export default class IdleBackground { export default class IdleBackground {
private idle: typeof chrome.idle | typeof browser.idle | null; private idle: typeof chrome.idle | typeof browser.idle | null;
private idleTimer: number | NodeJS.Timeout = null; private idleTimer: null | number | NodeJS.Timeout = null;
private idleState = "active"; private idleState = "active";
constructor( constructor(
@@ -80,9 +78,8 @@ export default class IdleBackground {
globalThis.clearTimeout(this.idleTimer); globalThis.clearTimeout(this.idleTimer);
this.idleTimer = null; this.idleTimer = 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 void this.idle?.queryState(IdleInterval, (state: string) => {
this.idle.queryState(IdleInterval, (state: string) => {
if (state !== this.idleState) { if (state !== this.idleState) {
this.idleState = state; this.idleState = state;
handler(state); handler(state);

View File

@@ -48,7 +48,7 @@ export default class RuntimeBackground {
private platformUtilsService: BrowserPlatformUtilsService, private platformUtilsService: BrowserPlatformUtilsService,
private notificationsService: NotificationsService, private notificationsService: NotificationsService,
private autofillSettingsService: AutofillSettingsServiceAbstraction, private autofillSettingsService: AutofillSettingsServiceAbstraction,
private processReloadSerivce: ProcessReloadServiceAbstraction, private processReloadService: ProcessReloadServiceAbstraction,
private environmentService: BrowserEnvironmentService, private environmentService: BrowserEnvironmentService,
private messagingService: MessagingService, private messagingService: MessagingService,
private logService: LogService, private logService: LogService,
@@ -241,7 +241,7 @@ export default class RuntimeBackground {
await closeUnlockPopout(); await closeUnlockPopout();
} }
this.processReloadSerivce.cancelProcessReload(); this.processReloadService.cancelProcessReload();
if (item) { if (item) {
await BrowserApi.focusWindow(item.commandToRetry.sender.tab.windowId); await BrowserApi.focusWindow(item.commandToRetry.sender.tab.windowId);