mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 13:23:34 +00:00
Introduce eslint errors for risky/circular imports (#14804)
* first draft at an idea dependency graph * ignore existing errors * remove conflicting rule regarding internal platform logic in libs * review: allow components to import from platform
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
// @ts-strict-ignore
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
import { CommandDefinition, MessageSender } from "@bitwarden/common/platform/messaging";
|
||||
// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop.
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { getCommand } from "@bitwarden/common/platform/messaging/internal";
|
||||
|
||||
type ErrorHandler = (logger: LogService, command: string) => void;
|
||||
|
||||
@@ -13,6 +13,8 @@ import {
|
||||
} from "@bitwarden/common/platform/messaging";
|
||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||
import { StateProvider } from "@bitwarden/common/platform/state";
|
||||
// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop.
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { CoreSyncService } from "@bitwarden/common/platform/sync/internal";
|
||||
import { SyncOptions } from "@bitwarden/common/platform/sync/sync.service";
|
||||
import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction";
|
||||
|
||||
@@ -3,6 +3,8 @@ import { Subject, firstValueFrom } from "rxjs";
|
||||
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
import { MessageListener, MessageSender } from "@bitwarden/common/platform/messaging";
|
||||
// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop.
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { tagAsExternal } from "@bitwarden/common/platform/messaging/helpers";
|
||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { map, share } from "rxjs";
|
||||
|
||||
import { Message } from "@bitwarden/common/platform/messaging";
|
||||
// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop.
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { tagAsExternal } from "@bitwarden/common/platform/messaging/internal";
|
||||
|
||||
import { fromChromeEvent } from "../browser/from-chrome-event";
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { MessageSender, CommandDefinition } from "@bitwarden/common/platform/messaging";
|
||||
// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop.
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { getCommand } from "@bitwarden/common/platform/messaging/internal";
|
||||
|
||||
export class ElectronRendererMessageSender implements MessageSender {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { fromEventPattern, share } from "rxjs";
|
||||
|
||||
import { Message } from "@bitwarden/common/platform/messaging";
|
||||
// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop.
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { tagAsExternal } from "@bitwarden/common/platform/messaging/internal";
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user