1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-21 11:35:34 +01:00

[PM-10813] add eslint rule to restrict imports from apps in libs (#10481)

* restrict app imports in libs

* add eslint ignore comments
This commit is contained in:
Will Martin 2024-08-14 14:24:29 -04:00 committed by GitHub
parent 910ae7d799
commit 7571c766e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 17 additions and 0 deletions

View File

@ -100,6 +100,11 @@
"error",
{
"zones": [
{
"target": ["libs/**/*"],
"from": ["apps/**/*"],
"message": "Libs should not import app-specific code."
},
{
// avoid specific frameworks or large dependencies in common
"target": "./libs/common/**/*",

View File

@ -19,6 +19,8 @@ import { ThemeType } from "@bitwarden/common/platform/enums";
import { ThemeStateService } from "@bitwarden/common/platform/theming/theme-state.service";
import { ButtonModule } from "@bitwarden/components";
// FIXME: remove `/apps` import from `/libs`
// eslint-disable-next-line import/no-restricted-paths
import { PreloadedEnglishI18nModule } from "../../../../../apps/web/src/app/core/tests";
import { LockIcon } from "../icons";
import { RegistrationCheckEmailIcon } from "../icons/registration-check-email.icon";

View File

@ -11,6 +11,8 @@ import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.se
import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength";
import { DialogService, ToastService } from "@bitwarden/components";
// FIXME: remove `/apps` import from `/libs`
// eslint-disable-next-line import/no-restricted-paths
import { PreloadedEnglishI18nModule } from "../../../../../apps/web/src/app/core/tests";
import { InputPasswordComponent } from "./input-password.component";

View File

@ -27,6 +27,8 @@ import {
TypographyModule,
} from "@bitwarden/components";
// FIXME: remove `/apps` import from `/libs`
// eslint-disable-next-line import/no-restricted-paths
import { PreloadedEnglishI18nModule } from "../../../../../../apps/web/src/app/core/tests";
import { RegistrationStartComponent } from "./registration-start.component";

View File

@ -1,6 +1,8 @@
import { mock } from "jest-mock-extended";
import { firstValueFrom, Observable } from "rxjs";
// FIXME: remove `/apps` import from `/libs`
// eslint-disable-next-line import/no-restricted-paths
import { flushPromises } from "@bitwarden/browser/src/autofill/spec/testing-utils";
import { Fido2CredentialView } from "../../../vault/models/view/fido2-credential.view";

View File

@ -13,6 +13,8 @@ import { Send } from "@bitwarden/common/tools/send/models/domain/send";
import { SendView } from "@bitwarden/common/tools/send/models/view/send.view";
import { AsyncActionsModule, ButtonModule, ToastService } from "@bitwarden/components";
import { SendFormConfig } from "@bitwarden/send-ui";
// FIXME: remove `/apps` import from `/libs`
// eslint-disable-next-line import/no-restricted-paths
import { PreloadedEnglishI18nModule } from "@bitwarden/web-vault/src/app/core/tests";
import { SendFormService } from "./abstractions/send-form.service";

View File

@ -26,6 +26,8 @@ import {
CipherFormGenerationService,
PasswordRepromptService,
} from "@bitwarden/vault";
// FIXME: remove `/apps` import from `/libs`
// eslint-disable-next-line import/no-restricted-paths
import { PreloadedEnglishI18nModule } from "@bitwarden/web-vault/src/app/core/tests";
import { CipherFormService } from "./abstractions/cipher-form.service";