1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-25 20:53:22 +00:00

eslint: report unused disable directives (#13463)

Remove any unused disable directives and FIXMEs in our code
This commit is contained in:
Thomas Rittson
2025-03-10 23:33:08 +10:00
committed by GitHub
parent afd715c79c
commit ef72f513b1
69 changed files with 12 additions and 91 deletions

View File

@@ -1,4 +1,4 @@
/* eslint-disable no-undef, @typescript-eslint/no-require-imports */
/* eslint-disable @typescript-eslint/no-require-imports */
module.exports = {
plugins: [
require("postcss-import"),

View File

@@ -99,7 +99,6 @@ import { AwaitDesktopDialogComponent } from "./await-desktop-dialog.component";
VaultTimeoutInputComponent,
],
})
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
export class AccountSecurityComponent implements OnInit, OnDestroy {
protected readonly VaultTimeoutAction = VaultTimeoutAction;

View File

@@ -479,7 +479,6 @@ describe("OverlayBackground", () => {
it("will set up onMessage and onConnect listeners", () => {
overlayBackground["setupExtensionMessageListeners"]();
// eslint-disable-next-line
expect(chrome.runtime.onMessage.addListener).toHaveBeenCalled();
expect(chrome.runtime.onConnect.addListener).toHaveBeenCalled();
});

View File

@@ -1412,7 +1412,6 @@ export default class AutofillService implements AutofillServiceInterface {
let doesContainValue = false;
CreditCardAutoFillConstants.CardAttributesExtended.forEach((attributeName) => {
// eslint-disable-next-line no-prototype-builtins
if (doesContainValue || !field[attributeName]) {
return;
}

View File

@@ -34,12 +34,8 @@ export default class IdleBackground {
const idleHandler = (newState: string) => {
if (newState === "active") {
// 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.notificationsService.reconnectFromActivity();
} else {
// 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.notificationsService.disconnectFromInactivity();
}
};

View File

@@ -85,7 +85,6 @@ describe("BrowserTaskSchedulerService", () => {
callback,
);
// @ts-expect-error mocking global browser object
// eslint-disable-next-line no-global-assign
globalThis.browser = {};
chrome.alarms.get = jest.fn().mockImplementation((_name, callback) => callback(undefined));
});
@@ -95,8 +94,7 @@ describe("BrowserTaskSchedulerService", () => {
jest.clearAllTimers();
jest.useRealTimers();
// eslint-disable-next-line no-global-assign
globalThis.browser = undefined;
(globalThis.browser as any) = undefined;
});
describe("setTimeout", () => {

View File

@@ -1,4 +1,4 @@
/* eslint-disable no-undef, @typescript-eslint/no-require-imports */
/* eslint-disable @typescript-eslint/no-require-imports */
const config = require("../../libs/components/tailwind.config.base");
config.content = [