Skip to content

Commit

Permalink
[deps] SM: Update typescript-eslint monorepo to v8 (major) (#10601)
Browse files Browse the repository at this point in the history
* [deps] SM: Update typescript-eslint monorepo to v8

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Hinton <hinton@users.noreply.github.com>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 14, 2025
1 parent e568a7a commit 62e8799
Show file tree
Hide file tree
Showing 103 changed files with 355 additions and 106 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-misused-promises": ["error", { "checksVoidReturn": false }],
"@typescript-eslint/no-this-alias": ["error", { "allowedNames": ["self"] }],
"@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }],
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }],
"no-console": "error",
"import/no-unresolved": "off", // TODO: Look into turning off once each package is an actual package.
Expand Down
2 changes: 1 addition & 1 deletion apps/browser/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-undef */
/* eslint-disable no-undef, @typescript-eslint/no-require-imports */
module.exports = {
plugins: [require("tailwindcss"), require("autoprefixer"), require("postcss-nested")],
};
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,16 @@ describe("AutoSubmitLoginBackground", () => {

sendMockExtensionMessage({ command: "triggerAutoSubmitLogin" }, sender);

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
expect(autofillService.doAutoFillOnTab).not.toHaveBeenCalled;
});

it("skips acting on messages whose command does not have a registered handler", () => {
sendMockExtensionMessage({ command: "someInvalidCommand" }, sender);

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
expect(autofillService.doAutoFillOnTab).not.toHaveBeenCalled;
});

Expand Down
2 changes: 2 additions & 0 deletions apps/browser/src/autofill/content/auto-submit-login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ describe("AutoSubmitLogin content script", () => {
beforeEach(() => {
jest.useFakeTimers();
setupEnvironmentDefaults();
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./auto-submit-login");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export function EditButton({
title=${buttonText}
class=${editButtonStyles({ disabled, theme })}
@click=${(event: Event) => {
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
!disabled && buttonAction(event);
}}
>
Expand Down
4 changes: 4 additions & 0 deletions apps/browser/src/autofill/content/components/cipher/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const CipherTypes = {
Login: 1,
SecureNote: 2,
Expand All @@ -7,6 +9,8 @@ const CipherTypes = {

type CipherType = (typeof CipherTypes)[keyof typeof CipherTypes];

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const CipherRepromptTypes = {
None: 0,
Password: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ describe("ContentMessageHandler", () => {
);

beforeEach(() => {
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./content-message-handler");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ describe("TriggerAutofillScriptInjection", () => {

describe("init", () => {
it("sends a message to the extension background", () => {
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("../content/trigger-autofill-script-injection");

expect(chrome.runtime.sendMessage).toHaveBeenCalledWith({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { AutofillOverlayElement } from "../../../../enums/autofill-overlay.enum"

import AutofillOverlayButton from "./autofill-overlay-button.deprecated";

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./legacy-button.scss");

(function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { AutofillOverlayElement } from "../../../../enums/autofill-overlay.enum"

import AutofillOverlayList from "./autofill-overlay-list.deprecated";

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./legacy-list.scss");

(function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ describe("Fido2 Content Script", () => {
chrome.runtime.connect = jest.fn(() => portSpy);

it("destroys the messenger when the port is disconnected", () => {
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./fido2-content-script");

triggerPortOnDisconnectEvent(portSpy);
Expand All @@ -75,6 +77,8 @@ describe("Fido2 Content Script", () => {
const mockResult = { credentialId: "mock" } as CreateCredentialResult;
jest.spyOn(chrome.runtime, "sendMessage").mockResolvedValue(mockResult);

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./fido2-content-script");

const response = await messenger.handler!(message, new AbortController());
Expand All @@ -99,6 +103,8 @@ describe("Fido2 Content Script", () => {
data: mock<InsecureCreateCredentialParams>(),
});

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./fido2-content-script");

await messenger.handler!(message, new AbortController());
Expand All @@ -121,6 +127,8 @@ describe("Fido2 Content Script", () => {
const abortController = new AbortController();
const abortSpy = jest.spyOn(abortController.signal, "removeEventListener");

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./fido2-content-script");

await messenger.handler!(message, abortController);
Expand All @@ -141,6 +149,8 @@ describe("Fido2 Content Script", () => {
abortController.abort();
});

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./fido2-content-script");

await messenger.handler!(message, abortController);
Expand All @@ -161,6 +171,8 @@ describe("Fido2 Content Script", () => {
const abortController = new AbortController();
jest.spyOn(chrome.runtime, "sendMessage").mockResolvedValue({ error: errorMessage });

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./fido2-content-script");
const result = messenger.handler!(message, abortController);

Expand All @@ -175,6 +187,8 @@ describe("Fido2 Content Script", () => {
contentType: "application/json",
}));

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./fido2-content-script");

expect(messengerForDOMCommunicationSpy).not.toHaveBeenCalled();
Expand All @@ -193,6 +207,8 @@ describe("Fido2 Content Script", () => {
},
}));

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./fido2-content-script");

expect(messengerForDOMCommunicationSpy).not.toHaveBeenCalled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ describe("FIDO2 page-script for manifest v2", () => {
it("skips appending the `page-script.js` file if the document contentType is not `text/html`", () => {
Object.defineProperty(window.document, "contentType", { value: "text/plain", writable: true });

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./fido2-page-script-append.mv2");

expect(window.document.createElement).not.toHaveBeenCalled();
Expand All @@ -33,6 +35,8 @@ describe("FIDO2 page-script for manifest v2", () => {
return node;
});

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./fido2-page-script-append.mv2");

expect(window.document.createElement).toHaveBeenCalledWith("script");
Expand All @@ -48,6 +52,8 @@ describe("FIDO2 page-script for manifest v2", () => {
return node;
});

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./fido2-page-script-append.mv2");

expect(window.document.createElement).toHaveBeenCalledWith("script");
Expand Down
2 changes: 2 additions & 0 deletions apps/browser/src/autofill/fido2/content/fido2-page-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ import { Messenger } from "./messaging/messenger";

clearWaitForFocus();
void messenger.destroy();
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (e) {
/** empty */
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ describe("Fido2 page script with native WebAuthn support", () => {
setupMockedWebAuthnSupport();

beforeAll(() => {
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./fido2-page-script");
});

Expand Down Expand Up @@ -166,6 +168,8 @@ describe("Fido2 page script with native WebAuthn support", () => {
contentType: "json/application",
}));

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./fido2-content-script");

expect(Messenger.forDOMCommunication).not.toHaveBeenCalled();
Expand All @@ -184,6 +188,8 @@ describe("Fido2 page script with native WebAuthn support", () => {
},
}));

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./fido2-content-script");

expect(Messenger.forDOMCommunication).not.toHaveBeenCalled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ describe("Fido2 page script without native WebAuthn support", () => {
const mockCreateCredentialsResult = createCreateCredentialResultMock();
const mockCredentialRequestOptions = createCredentialRequestOptionsMock();
const mockCredentialAssertResult = createAssertCredentialResultMock();
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./fido2-page-script");

afterEach(() => {
Expand Down
2 changes: 2 additions & 0 deletions apps/browser/src/autofill/notification/bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import {
NotificationBarIframeInitData,
} from "./abstractions/notification-bar";

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./bar.scss");

const logService = new ConsoleLogService(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { AutofillOverlayElement } from "../../../../enums/autofill-overlay.enum"

import { AutofillInlineMenuButton } from "./autofill-inline-menu-button";

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./button.scss");

(function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { AutofillOverlayElement } from "../../../../enums/autofill-overlay.enum"

import { AutofillInlineMenuList } from "./autofill-inline-menu-list";

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./list.scss");

(function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./menu-container.scss");

import { AutofillInlineMenuContainer } from "./autofill-inline-menu-container";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,8 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
url.origin + pathWithoutTrailingSlashAndSearch,
url.origin + pathWithoutTrailingSlashSearchAndHash,
]);
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (_error) {
return null;
}
Expand Down
2 changes: 2 additions & 0 deletions apps/browser/src/autofill/services/dom-query.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ export class DomQueryService implements DomQueryServiceInterface {
if ((chrome as any).dom?.openOrClosedShadowRoot) {
try {
return (chrome as any).dom.openOrClosedShadowRoot(node);
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (error) {
return null;
}
Expand Down
2 changes: 2 additions & 0 deletions apps/browser/src/background/nativeMessaging.background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ export class NativeMessagingBackground {
};
}
this.port.postMessage(msg);
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (e) {
this.logService.info(
"[Native Messaging IPC] Disconnected from Bitwarden Desktop app because of the native port disconnecting.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ export class BackgroundBrowserBiometricsService extends BiometricsService {
}
}
return BiometricsStatus.Available;
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (e) {
return BiometricsStatus.DesktopDisconnected;
}
Expand Down Expand Up @@ -142,6 +144,8 @@ export class BackgroundBrowserBiometricsService extends BiometricsService {
userId: id,
})
).response;
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (e) {
return BiometricsStatus.DesktopDisconnected;
}
Expand Down
2 changes: 0 additions & 2 deletions apps/browser/src/platform/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ import { GroupPolicyEnvironment } from "../admin-console/types/group-policy-envi
import { BrowserApi } from "./browser/browser-api";

// required to avoid linting errors when there are no flags
// eslint-disable-next-line @typescript-eslint/ban-types
export type Flags = {
accountSwitching?: boolean;
} & SharedFlags;

// required to avoid linting errors when there are no flags
// eslint-disable-next-line @typescript-eslint/ban-types
export type DevFlags = {
managedEnvironment?: GroupPolicyEnvironment;
} & SharedDevFlags;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ describe("OffscreenDocument", () => {
const browserClipboardServiceReadSpy = jest.spyOn(BrowserClipboardService, "read");
const consoleErrorSpy = jest.spyOn(console, "error");

// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("../offscreen-document/offscreen-document");

describe("init", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ describe("LocalBackedSessionStorage", () => {
localStorage.internalStore["session_test"] = encrypted.encryptedString;
encryptService.decryptToUtf8.mockResolvedValue(JSON.stringify("decrypted"));
const result = await sut.get("test");
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
expect(encryptService.decryptToUtf8).toHaveBeenCalledWith(
encrypted,
sessionKey,
Expand All @@ -69,6 +71,8 @@ describe("LocalBackedSessionStorage", () => {
localStorage.internalStore["session_test"] = encrypted.encryptedString;
encryptService.decryptToUtf8.mockResolvedValue(JSON.stringify("decrypted"));
const result = await sut.get("test");
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
expect(encryptService.decryptToUtf8).toHaveBeenCalledWith(
encrypted,
sessionKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ export class LocalBackedSessionStorageService
private compareValues<T>(value1: T, value2: T): boolean {
try {
return compareValues(value1, value2);
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (e) {
this.logService.error(
`error comparing values\n${JSON.stringify(value1)}\n${JSON.stringify(value2)}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const supported = (() => {
return new WebAssembly.Instance(module) instanceof WebAssembly.Instance;
}
}
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (e) {
// ignore
}
Expand Down
2 changes: 2 additions & 0 deletions apps/browser/src/popup/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
import { PopupSizeService } from "../platform/popup/layout/popup-size.service";
import { BrowserPlatformUtilsService } from "../platform/services/platform-utils/browser-platform-utils.service";

// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./scss/popup.scss");
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./scss/tailwind.css");

import { AppModule } from "./app.module";
Expand Down
2 changes: 2 additions & 0 deletions apps/browser/src/tools/content/lp-fileless-importer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ describe("LpFilelessImporter", () => {
chrome.runtime.connect = jest.fn(() => portSpy);

beforeEach(() => {
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./lp-fileless-importer");
lpFilelessImporter = (globalThis as any).lpFilelessImporter;
});
Expand Down
Loading

0 comments on commit 62e8799

Please sign in to comment.