From 2149b7dc5768d281d88dd07402a554d8d274e825 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 11 Apr 2024 11:31:26 +0100 Subject: [PATCH 1/8] fix issue where automation meta fields were being overridden --- packages/server/src/threads/automation.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index 4e33fadce6..469d0845c9 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -374,11 +374,13 @@ class Orchestrator { for (let [innerObject, innerValue] of Object.entries( originalStepInput[key][innerKey] )) { - originalStepInput[key][innerKey][innerObject] = - automationUtils.substituteLoopStep( - innerValue as string, - `steps.${loopStepNumber}` - ) + if (typeof innerValue === "string") { + originalStepInput[key][innerKey][innerObject] = + automationUtils.substituteLoopStep( + innerValue, + `steps.${loopStepNumber}` + ) + } } } } @@ -458,7 +460,6 @@ class Orchestrator { inputs, step.schema.inputs ) - try { // appId is always passed const outputs = await stepFn({ From 9be86e8b05d3e0b2cd91a6354f0d911206c4c731 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 16 Apr 2024 17:02:58 +0200 Subject: [PATCH 2/8] Lint --- .eslintrc.json | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 525072dc6c..624c2b8f26 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -42,7 +42,15 @@ }, "rules": { "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "varsIgnorePattern": "^_", + "argsIgnorePattern": "^_", + "destructuredArrayIgnorePattern": "^_", + "ignoreRestSiblings": true + } + ], "local-rules/no-budibase-imports": "error" } }, @@ -59,7 +67,15 @@ }, "rules": { "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "varsIgnorePattern": "^_", + "argsIgnorePattern": "^_", + "destructuredArrayIgnorePattern": "^_", + "ignoreRestSiblings": true + } + ], "local-rules/no-test-com": "error", "local-rules/email-domain-example-com": "error", "no-console": "warn", @@ -89,7 +105,8 @@ { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_", - "destructuredArrayIgnorePattern": "^_" + "destructuredArrayIgnorePattern": "^_", + "ignoreRestSiblings": true } ], "import/no-relative-packages": "error", From ec93ea59c11c19285a885aee877834b973388649 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 Apr 2024 10:22:49 +0200 Subject: [PATCH 3/8] Remove // eslint-disable-next-line @typescript-eslint/no-unused-vars --- packages/backend-core/src/queue/inMemoryQueue.ts | 3 +-- packages/pro | 2 +- .../server/src/automations/steps/triggerAutomationRun.ts | 1 - packages/server/src/integrations/googlesheets.ts | 3 +-- packages/server/src/jsRunner/index.ts | 1 - packages/server/src/sdk/app/views/tests/views.spec.ts | 5 ----- packages/server/src/websockets/websocket.ts | 6 ++---- packages/worker/src/api/routes/global/tests/scim.spec.ts | 3 --- 8 files changed, 5 insertions(+), 19 deletions(-) diff --git a/packages/backend-core/src/queue/inMemoryQueue.ts b/packages/backend-core/src/queue/inMemoryQueue.ts index 87e43b324d..06fe036da6 100644 --- a/packages/backend-core/src/queue/inMemoryQueue.ts +++ b/packages/backend-core/src/queue/inMemoryQueue.ts @@ -166,8 +166,7 @@ class InMemoryQueue implements Partial { return [] } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - async removeJobs(pattern: string) { + async removeJobs(_pattern: string) { // no-op } diff --git a/packages/pro b/packages/pro index c68183402b..e6c7cde321 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit c68183402b8fb17248572006531d5293ffc8a9ac +Subproject commit e6c7cde321b6943e3f0f464957b1c1c5b22fbb50 diff --git a/packages/server/src/automations/steps/triggerAutomationRun.ts b/packages/server/src/automations/steps/triggerAutomationRun.ts index f45a60600f..83e1722877 100644 --- a/packages/server/src/automations/steps/triggerAutomationRun.ts +++ b/packages/server/src/automations/steps/triggerAutomationRun.ts @@ -62,7 +62,6 @@ export const definition: AutomationStepSchema = { } export async function run({ inputs }: AutomationStepInput) { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { automationId, ...fieldParams } = inputs.automation if (await features.isTriggerAutomationRunEnabled()) { diff --git a/packages/server/src/integrations/googlesheets.ts b/packages/server/src/integrations/googlesheets.ts index 1573c98f16..7215c337d7 100644 --- a/packages/server/src/integrations/googlesheets.ts +++ b/packages/server/src/integrations/googlesheets.ts @@ -168,8 +168,7 @@ class GoogleSheetsIntegration implements DatasourcePlus { return "" } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - getStringConcat(parts: string[]) { + getStringConcat(_parts: string[]) { return "" } diff --git a/packages/server/src/jsRunner/index.ts b/packages/server/src/jsRunner/index.ts index 7065febcb4..b2cae1cfbc 100644 --- a/packages/server/src/jsRunner/index.ts +++ b/packages/server/src/jsRunner/index.ts @@ -35,7 +35,6 @@ export function init() { // Because we can't pass functions into an Isolate, we remove them from // the passed context and rely on the withHelpers() method to add them // back in. - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { helpers, snippets, ...rest } = ctx return vm.withContext(rest, () => vm.execute(js)) } catch (error: any) { diff --git a/packages/server/src/sdk/app/views/tests/views.spec.ts b/packages/server/src/sdk/app/views/tests/views.spec.ts index a610d34ec2..508285651a 100644 --- a/packages/server/src/sdk/app/views/tests/views.spec.ts +++ b/packages/server/src/sdk/app/views/tests/views.spec.ts @@ -351,7 +351,6 @@ describe("table sdk", () => { const view: ViewV2 = { ...basicView, } - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { name, description, ...newTableSchema } = basicTable.schema const result = syncSchema(_.cloneDeep(view), newTableSchema, undefined) @@ -365,7 +364,6 @@ describe("table sdk", () => { const view: ViewV2 = { ...basicView, } - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { description, ...newTableSchema } = { ...basicTable.schema, updatedDescription: { @@ -450,7 +448,6 @@ describe("table sdk", () => { hiddenField: { visible: false }, }, } - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { name, description, ...newTableSchema } = basicTable.schema const result = syncSchema(_.cloneDeep(view), newTableSchema, undefined) @@ -474,7 +471,6 @@ describe("table sdk", () => { hiddenField: { visible: false }, }, } - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { name, description, ...newTableSchema } = { ...basicTable.schema, newField1: { @@ -506,7 +502,6 @@ describe("table sdk", () => { hiddenField: { visible: false }, }, } - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { description, ...newTableSchema } = { ...basicTable.schema, updatedDescription: { diff --git a/packages/server/src/websockets/websocket.ts b/packages/server/src/websockets/websocket.ts index 871122678d..5dcf8c8f6f 100644 --- a/packages/server/src/websockets/websocket.ts +++ b/packages/server/src/websockets/websocket.ts @@ -262,13 +262,11 @@ export class BaseSocket { } } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - async onConnect(socket: Socket) { + async onConnect(_socket: Socket) { // Override } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - async onDisconnect(socket: Socket) { + async onDisconnect(_socket: Socket) { // Override } diff --git a/packages/worker/src/api/routes/global/tests/scim.spec.ts b/packages/worker/src/api/routes/global/tests/scim.spec.ts index 85c70b7b63..258702a3b3 100644 --- a/packages/worker/src/api/routes/global/tests/scim.spec.ts +++ b/packages/worker/src/api/routes/global/tests/scim.spec.ts @@ -704,7 +704,6 @@ describe("scim", () => { expect(response).toEqual({ Resources: expect.arrayContaining( groups.map(g => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { members, ...groupData } = g return groupData }) @@ -724,7 +723,6 @@ describe("scim", () => { expect(response).toEqual({ Resources: expect.arrayContaining( groups.map(g => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { members, displayName, ...groupData } = g return groupData }) @@ -874,7 +872,6 @@ describe("scim", () => { qs: "excludedAttributes=members", }) - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { members, ...expectedResponse } = group expect(response).toEqual(expectedResponse) From 7e1afd8b737e85270d21a9b12b02690eb377cb43 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 Apr 2024 12:19:58 +0200 Subject: [PATCH 4/8] Remove // eslint-disable-next-line no-unused-vars in svelte --- packages/account-portal | 2 +- .../src/components/common/users/PasswordRepeatInput.svelte | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/account-portal b/packages/account-portal index 328c84234d..e525e1c873 160000 --- a/packages/account-portal +++ b/packages/account-portal @@ -1 +1 @@ -Subproject commit 328c84234d11d97d840f0eb2c72665b04ba9e4f8 +Subproject commit e525e1c87322689436dba62794dd984f66e433f8 diff --git a/packages/builder/src/components/common/users/PasswordRepeatInput.svelte b/packages/builder/src/components/common/users/PasswordRepeatInput.svelte index 496bee14ec..4a453ef049 100644 --- a/packages/builder/src/components/common/users/PasswordRepeatInput.svelte +++ b/packages/builder/src/components/common/users/PasswordRepeatInput.svelte @@ -9,7 +9,6 @@ "", requiredValidator ) - // eslint-disable-next-line no-unused-vars const [repeatPassword, _, repeatTouched] = createValidationStore( "", requiredValidator From a88924a41873ce43bd65ecdb470e24c7466af6e9 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 Apr 2024 12:24:41 +0200 Subject: [PATCH 5/8] Remove // eslint-disable-next-line no-unused-vars --- packages/account-portal | 2 +- packages/backend-core/src/queue/inMemoryQueue.ts | 1 - .../stores/datasourceCreation.test.js | 2 -- .../CreateExternalDatasourceModal/stores/onGoogleAuth.test.js | 4 ++-- packages/cli/src/hosting/utils.ts | 1 - packages/frontend-core/src/fetch/DataFetch.js | 3 +-- packages/server/src/features.ts | 3 --- packages/string-templates/src/processors/postprocessor.ts | 1 - packages/string-templates/src/processors/preprocessor.ts | 1 - packages/worker/src/features.ts | 1 - 10 files changed, 4 insertions(+), 15 deletions(-) diff --git a/packages/account-portal b/packages/account-portal index e525e1c873..e2357a67de 160000 --- a/packages/account-portal +++ b/packages/account-portal @@ -1 +1 @@ -Subproject commit e525e1c87322689436dba62794dd984f66e433f8 +Subproject commit e2357a67de047c430908901889bbcb83767970ef diff --git a/packages/backend-core/src/queue/inMemoryQueue.ts b/packages/backend-core/src/queue/inMemoryQueue.ts index 06fe036da6..333accc985 100644 --- a/packages/backend-core/src/queue/inMemoryQueue.ts +++ b/packages/backend-core/src/queue/inMemoryQueue.ts @@ -115,7 +115,6 @@ class InMemoryQueue implements Partial { * a JSON message as this is required by Bull. * @param repeat serves no purpose for the import queue. */ - // eslint-disable-next-line no-unused-vars async add(data: any, opts?: JobOptions) { const jobId = opts?.jobId?.toString() if (jobId && this._queuedJobIds.has(jobId)) { diff --git a/packages/builder/src/pages/builder/app/[application]/data/_components/CreateExternalDatasourceModal/stores/datasourceCreation.test.js b/packages/builder/src/pages/builder/app/[application]/data/_components/CreateExternalDatasourceModal/stores/datasourceCreation.test.js index 4c3a958134..75a3afc2ff 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/_components/CreateExternalDatasourceModal/stores/datasourceCreation.test.js +++ b/packages/builder/src/pages/builder/app/[application]/data/_components/CreateExternalDatasourceModal/stores/datasourceCreation.test.js @@ -4,8 +4,6 @@ import { createDatasourceCreationStore, } from "./datasourceCreation" import { get } from "svelte/store" -// eslint-disable-next-line no-unused-vars -import { shouldIntegrationFetchTableNames } from "stores/selectors" vi.mock("stores/selectors", () => ({ shouldIntegrationFetchTableNames: vi.fn(), diff --git a/packages/builder/src/pages/builder/app/[application]/data/_components/CreateExternalDatasourceModal/stores/onGoogleAuth.test.js b/packages/builder/src/pages/builder/app/[application]/data/_components/CreateExternalDatasourceModal/stores/onGoogleAuth.test.js index f3e921c698..edf133ea0d 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/_components/CreateExternalDatasourceModal/stores/onGoogleAuth.test.js +++ b/packages/builder/src/pages/builder/app/[application]/data/_components/CreateExternalDatasourceModal/stores/onGoogleAuth.test.js @@ -1,9 +1,9 @@ import { it, expect, describe, beforeEach, vi } from "vitest" import { createOnGoogleAuthStore } from "./onGoogleAuth" import { writable, get } from "svelte/store" -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line import { params } from "@roxi/routify" -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line import { integrations } from "stores/builder" import { IntegrationTypes } from "constants/backend" diff --git a/packages/cli/src/hosting/utils.ts b/packages/cli/src/hosting/utils.ts index a4b28539e9..cbf6d9b0c3 100644 --- a/packages/cli/src/hosting/utils.ts +++ b/packages/cli/src/hosting/utils.ts @@ -105,7 +105,6 @@ export function getAppService(path: string) { } export function updateDockerComposeService( - // eslint-disable-next-line no-unused-vars updateFn: (service: DockerCompose) => void ) { const opts = ["docker-compose.yaml", "docker-compose.yml"] diff --git a/packages/frontend-core/src/fetch/DataFetch.js b/packages/frontend-core/src/fetch/DataFetch.js index 92115efef0..3a45543c60 100644 --- a/packages/frontend-core/src/fetch/DataFetch.js +++ b/packages/frontend-core/src/fetch/DataFetch.js @@ -348,8 +348,7 @@ export default class DataFetch { * Determine the feature flag for this datasource definition * @param definition */ - // eslint-disable-next-line no-unused-vars - determineFeatureFlags(definition) { + determineFeatureFlags(_definition) { return { supportsSearch: false, supportsSort: false, diff --git a/packages/server/src/features.ts b/packages/server/src/features.ts index 3ab9410f53..f040cf82a2 100644 --- a/packages/server/src/features.ts +++ b/packages/server/src/features.ts @@ -1,11 +1,8 @@ import { features } from "@budibase/backend-core" import env from "./environment" -// eslint-disable-next-line no-unused-vars enum AppFeature { - // eslint-disable-next-line no-unused-vars API = "api", - // eslint-disable-next-line no-unused-vars AUTOMATIONS = "automations", } diff --git a/packages/string-templates/src/processors/postprocessor.ts b/packages/string-templates/src/processors/postprocessor.ts index 6f7260718b..b8d99682b1 100644 --- a/packages/string-templates/src/processors/postprocessor.ts +++ b/packages/string-templates/src/processors/postprocessor.ts @@ -4,7 +4,6 @@ export const PostProcessorNames = { CONVERT_LITERALS: "convert-literals", } -/* eslint-disable no-unused-vars */ class Postprocessor { name: string private fn: any diff --git a/packages/string-templates/src/processors/preprocessor.ts b/packages/string-templates/src/processors/preprocessor.ts index 141b2be3a9..010c259e12 100644 --- a/packages/string-templates/src/processors/preprocessor.ts +++ b/packages/string-templates/src/processors/preprocessor.ts @@ -9,7 +9,6 @@ export const PreprocessorNames = { FINALISE: "finalise", } -/* eslint-disable no-unused-vars */ class Preprocessor { name: string private fn: any diff --git a/packages/worker/src/features.ts b/packages/worker/src/features.ts index 33fce3aebe..075b3b81ca 100644 --- a/packages/worker/src/features.ts +++ b/packages/worker/src/features.ts @@ -1,7 +1,6 @@ import { features } from "@budibase/backend-core" import env from "./environment" -// eslint-disable-next-line no-unused-vars enum WorkerFeature {} const featureList: WorkerFeature[] = features.processFeatureEnvVar( From 160c3913a2cd35d6ff200c2634f0f18d6c4c43e5 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 Apr 2024 15:48:44 +0200 Subject: [PATCH 6/8] Update submodule refs --- packages/pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pro b/packages/pro index e6c7cde321..c78bab4ca1 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit e6c7cde321b6943e3f0f464957b1c1c5b22fbb50 +Subproject commit c78bab4ca13176263510cbdbc7d115d9d9d22ad9 From fcb04c6be128dffb6450a62a891fee78a1f55b2d Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 Apr 2024 15:50:29 +0200 Subject: [PATCH 7/8] Update submodule refs --- packages/account-portal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/account-portal b/packages/account-portal index e2357a67de..266807f80b 160000 --- a/packages/account-portal +++ b/packages/account-portal @@ -1 +1 @@ -Subproject commit e2357a67de047c430908901889bbcb83767970ef +Subproject commit 266807f80b63cddfdcdcff2c83ff0732a68bf3bb From c763d3758e083aeaf93e4b21b4946b3959a7b818 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 Apr 2024 15:59:21 +0200 Subject: [PATCH 8/8] Update submodule refs --- packages/account-portal | 2 +- packages/pro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/account-portal b/packages/account-portal index 266807f80b..eb7d5da233 160000 --- a/packages/account-portal +++ b/packages/account-portal @@ -1 +1 @@ -Subproject commit 266807f80b63cddfdcdcff2c83ff0732a68bf3bb +Subproject commit eb7d5da233885c5cffd9c255d3e954d0cd39185e diff --git a/packages/pro b/packages/pro index c78bab4ca1..06b1064f7e 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit c78bab4ca13176263510cbdbc7d115d9d9d22ad9 +Subproject commit 06b1064f7e2f7cac5d4bef2ee999796a2a1f0f2c