From 4d27ff1dc099848a3901a5c5f2a6192863c87fe3 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 20 Nov 2023 16:15:43 +0100 Subject: [PATCH] eslint import/no-duplicates --- .eslintrc.json | 3 ++- packages/backend-core/src/configs/configs.ts | 7 +++---- packages/backend-core/src/installation.ts | 3 +-- packages/backend-core/src/security/roles.ts | 3 +-- packages/backend-core/src/users/db.ts | 3 +-- packages/bbui/src/Drawer/Drawer.svelte | 5 ++--- packages/bbui/src/Popover/Popover.svelte | 5 ++--- packages/builder/src/builderStore/index.js | 3 +-- packages/builder/src/builderStore/websocket.js | 6 ++---- .../AutomationBuilder/FlowChart/FlowChart.svelte | 5 ++--- .../AutomationPanel/CreateAutomationModal.svelte | 5 ++--- .../AutomationPanel/UpdateAutomationModal.svelte | 5 ++--- .../automation/SetupPanel/AutomationBlockSetup.svelte | 5 ++--- .../automation/Shared/CreateWebhookModal.svelte | 5 ++--- .../backend/DataTable/modals/CreateEditUser.svelte | 8 +++----- .../backend/DataTable/modals/EditRoles.svelte | 5 ++--- .../modals/UpdateDatasourceModal.svelte | 5 ++--- .../popovers/EditDatasourcePopover.svelte | 5 ++--- .../backend/Datasources/CreateEditRelationship.svelte | 10 ++++------ .../TableNavigator/modals/CreateTableModal.svelte | 8 +++----- .../components/common/bindings/BindingPanel.svelte | 10 ++++------ .../ButtonActionEditor/ButtonActionEditor.svelte | 5 ++--- .../controls/DataSourceSelect/DataSourceSelect.svelte | 5 ++--- .../controls/DraggableList/DraggableList.svelte | 5 ++--- .../settings/controls/EditComponentPopover.svelte | 5 ++--- .../FieldConfiguration/FieldConfiguration.svelte | 5 ++--- .../builder/src/components/settings/ThemeModal.svelte | 5 ++--- packages/builder/src/pages/builder/admin/index.svelte | 5 ++--- .../app/[application]/automation/_layout.svelte | 5 ++--- .../CreateExternalDatasourceModal/index.svelte | 5 ++--- .../Authentication/RestAuthenticationBuilder.svelte | 5 ++--- .../Component/ComponentSettingsPanel.svelte | 5 ++--- .../_components/Screen/GeneralPanel.svelte | 5 ++--- .../_components/ComponentList/ComponentTree.svelte | 11 +++++------ .../[screenId]/_components/ComponentList/index.svelte | 5 ++--- packages/builder/src/pages/builder/auth/forgot.svelte | 5 ++--- packages/builder/src/pages/builder/auth/login.svelte | 5 ++--- packages/builder/src/pages/builder/auth/reset.svelte | 5 ++--- .../builder/src/pages/builder/invite/index.svelte | 5 ++--- .../users/_components/AppRoleTableRenderer.svelte | 5 ++--- packages/cli/src/plugins/index.ts | 3 +-- packages/cli/src/utils.ts | 3 +-- .../client/src/components/app/DateRangePicker.svelte | 5 ++--- .../src/components/app/forms/CodeScanner.svelte | 5 ++--- packages/client/src/components/app/table/Table.svelte | 5 ++--- .../src/components/grid/cells/AttachmentCell.svelte | 5 ++--- .../src/components/grid/cells/GutterCell.svelte | 5 ++--- .../src/components/grid/layout/NewRow.svelte | 5 ++--- packages/pro | 2 +- packages/server/src/api/controllers/analytics.ts | 3 +-- packages/server/src/api/controllers/automation.ts | 3 +-- packages/server/src/api/controllers/component.ts | 3 +-- packages/server/src/api/controllers/dev.ts | 3 +-- packages/server/src/api/controllers/table/utils.ts | 10 ++++------ .../src/api/routes/tests/utilities/TestFunctions.ts | 3 +-- packages/server/src/automations/triggers.ts | 3 +-- packages/server/src/integrations/base/sql.ts | 3 +-- packages/server/src/koa.ts | 3 +-- .../src/migrations/functions/backfill/global.ts | 3 +-- packages/server/src/sdk/app/backups/imports.ts | 11 +++++------ packages/server/src/threads/query.ts | 3 +-- .../server/src/utilities/fileSystem/filesystem.ts | 6 ++---- packages/server/src/utilities/rowProcessor/index.ts | 3 +-- packages/server/src/websockets/websocket.ts | 3 +-- packages/worker/src/index.ts | 3 +-- .../src/account-api/api/AccountInternalAPIClient.ts | 3 +-- qa-core/src/public-api/api/apis/RowAPI.ts | 3 +-- qa-core/src/types/appPackage.ts | 3 +-- 68 files changed, 128 insertions(+), 200 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index c921f88410..a0111a6322 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -58,7 +58,8 @@ } ], "import/no-relative-packages": "error", - "import/export": "error" + "import/export": "error", + "import/no-duplicates": "error" }, "globals": { "GeolocationPositionError": true diff --git a/packages/backend-core/src/configs/configs.ts b/packages/backend-core/src/configs/configs.ts index 0c83ed005d..0d189e3f7d 100644 --- a/packages/backend-core/src/configs/configs.ts +++ b/packages/backend-core/src/configs/configs.ts @@ -17,7 +17,6 @@ import { DocumentType, SEPARATOR } from "../constants" import { CacheKey, TTL, withCache } from "../cache" import * as context from "../context" import env from "../environment" -import environment from "../environment" // UTILS @@ -181,10 +180,10 @@ export async function getGoogleDatasourceConfig(): Promise< } export function getDefaultGoogleConfig(): GoogleInnerConfig | undefined { - if (environment.GOOGLE_CLIENT_ID && environment.GOOGLE_CLIENT_SECRET) { + if (env.GOOGLE_CLIENT_ID && env.GOOGLE_CLIENT_SECRET) { return { - clientID: environment.GOOGLE_CLIENT_ID!, - clientSecret: environment.GOOGLE_CLIENT_SECRET!, + clientID: env.GOOGLE_CLIENT_ID!, + clientSecret: env.GOOGLE_CLIENT_SECRET!, activated: true, } } diff --git a/packages/backend-core/src/installation.ts b/packages/backend-core/src/installation.ts index 17eda2004d..6b79b91a37 100644 --- a/packages/backend-core/src/installation.ts +++ b/packages/backend-core/src/installation.ts @@ -1,7 +1,6 @@ import { newid } from "./utils" import * as events from "./events" -import { StaticDatabases } from "./db" -import { doWithDB } from "./db" +import { StaticDatabases , doWithDB } from "./db" import { Installation, IdentityType, Database } from "@budibase/types" import * as context from "./context" import semver from "semver" diff --git a/packages/backend-core/src/security/roles.ts b/packages/backend-core/src/security/roles.ts index 0d33031de5..f1dc0c7cfd 100644 --- a/packages/backend-core/src/security/roles.ts +++ b/packages/backend-core/src/security/roles.ts @@ -1,7 +1,6 @@ import { BuiltinPermissionID, PermissionLevel } from "./permissions" -import { prefixRoleID, getRoleParams, DocumentType, SEPARATOR } from "../db" +import { prefixRoleID, getRoleParams, DocumentType, SEPARATOR , doWithDB } from "../db" import { getAppDB } from "../context" -import { doWithDB } from "../db" import { Screen, Role as RoleDoc } from "@budibase/types" import cloneDeep from "lodash/fp/cloneDeep" diff --git a/packages/backend-core/src/users/db.ts b/packages/backend-core/src/users/db.ts index bd85097bbd..152ff89fdb 100644 --- a/packages/backend-core/src/users/db.ts +++ b/packages/backend-core/src/users/db.ts @@ -1,6 +1,5 @@ import env from "../environment" import * as eventHelpers from "./events" -import * as accounts from "../accounts" import * as accountSdk from "../accounts" import * as cache from "../cache" import { getGlobalDB, getIdentity, getTenantId } from "../context" @@ -467,7 +466,7 @@ export class UserDB { if (!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL) { // root account holder can't be deleted from inside budibase const email = dbUser.email - const account = await accounts.getAccount(email) + const account = await accountSdk.getAccount(email) if (account) { if (dbUser.userId === getIdentity()!._id) { throw new HTTPError('Please visit "Account" to delete this user', 400) diff --git a/packages/bbui/src/Drawer/Drawer.svelte b/packages/bbui/src/Drawer/Drawer.svelte index 421d12615f..e2060c9a09 100644 --- a/packages/bbui/src/Drawer/Drawer.svelte +++ b/packages/bbui/src/Drawer/Drawer.svelte @@ -3,9 +3,8 @@ import Button from "../Button/Button.svelte" import Body from "../Typography/Body.svelte" import Heading from "../Typography/Heading.svelte" - import { setContext } from "svelte" - import { createEventDispatcher } from "svelte" - import { generate } from "shortid" + import { setContext , createEventDispatcher } from "svelte" + import { generate } from "shortid" export let title export let fillWidth diff --git a/packages/bbui/src/Popover/Popover.svelte b/packages/bbui/src/Popover/Popover.svelte index 4c4b818440..58cd92ddaa 100644 --- a/packages/bbui/src/Popover/Popover.svelte +++ b/packages/bbui/src/Popover/Popover.svelte @@ -1,12 +1,11 @@ diff --git a/packages/builder/src/pages/builder/admin/index.svelte b/packages/builder/src/pages/builder/admin/index.svelte index ede9d85808..c758f5c7e5 100644 --- a/packages/builder/src/pages/builder/admin/index.svelte +++ b/packages/builder/src/pages/builder/admin/index.svelte @@ -1,11 +1,10 @@