diff --git a/eslint.config.mjs b/eslint.config.mjs index 4a063737b4..59c2202e94 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,29 +1,17 @@ -import _import from "eslint-plugin-import" -import localRules from "eslint-plugin-local-rules" -import { fixupPluginRules } from "@eslint/compat" import globals from "globals" import babelParser from "@babel/eslint-parser" -import parser from "svelte-eslint-parser" -import typescriptEslint from "@typescript-eslint/eslint-plugin" +import svelteParser from "svelte-eslint-parser" import tsParser from "@typescript-eslint/parser" -import jest from "eslint-plugin-jest" -import path from "node:path" -import { fileURLToPath } from "node:url" -import js from "@eslint/js" -import { FlatCompat } from "@eslint/eslintrc" + +import eslintPluginJest from "eslint-plugin-jest" +import eslintPluginSvelte from "eslint-plugin-svelte" +import eslintPluginLocalRules from "eslint-plugin-local-rules" import eslint from "@eslint/js" import tseslint from "typescript-eslint" -const __filename = fileURLToPath(import.meta.url) -const __dirname = path.dirname(__filename) -const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - allConfig: js.configs.all, -}) - export default [ + eslint.configs.recommended, { ignores: [ "**/node_modules", @@ -46,12 +34,9 @@ export default [ "packages/server/build/oldClientVersions/**/**/*", ], }, - tseslint.configs.recommended, - eslint.configs.recommended, { plugins: { - import: fixupPluginRules(_import), - "local-rules": localRules, + "local-rules": eslintPluginLocalRules, }, languageOptions: { @@ -59,7 +44,7 @@ export default [ ...globals.browser, ...globals.jest, ...globals.node, - // GeolocationPositionError: true, + GeolocationPositionError: true, }, parser: babelParser, @@ -73,7 +58,7 @@ export default [ rules: { "no-self-assign": "off", - + "prefer-const": "off", "no-unused-vars": [ "error", { @@ -81,90 +66,81 @@ export default [ argsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_", ignoreRestSiblings: true, + caughtErrors: "none", }, ], - - "import/no-relative-packages": "error", - "import/export": "error", - "import/no-duplicates": "error", - "import/newline-after-import": "error", }, }, - ...compat.extends("plugin:svelte/recommended").map(config => ({ - ...config, - files: ["**/*.svelte"], - })), - { - files: ["**/*.svelte"], - - languageOptions: { - parser: parser, - ecmaVersion: 2019, - sourceType: "script", - - parserOptions: { - parser: "@typescript-eslint/parser", - allowImportExportEverywhere: true, - }, - }, - }, - ...compat.extends("eslint:recommended").map(config => ({ - ...config, - files: ["**/*.ts"], - })), - { - files: ["**/*.ts"], - - plugins: { - "@typescript-eslint": typescriptEslint, - }, - - languageOptions: { - globals: { - NodeJS: true, - }, - - parser: tsParser, - }, - - rules: { - "no-unused-vars": "off", - "local-rules/no-barrel-imports": "error", - "local-rules/no-budibase-imports": "error", - "local-rules/no-console-error": "error", - - "@typescript-eslint/no-unused-vars": [ - "error", - { - varsIgnorePattern: "^_", - argsIgnorePattern: "^_", - destructuredArrayIgnorePattern: "^_", - ignoreRestSiblings: true, - }, - ], - - "no-redeclare": "off", - "@typescript-eslint/no-redeclare": "error", - "no-dupe-class-members": "off", - }, - }, - ...compat - .extends("eslint:recommended", "plugin:jest/recommended") - .map(config => ({ + ...eslintPluginSvelte.configs["flat/recommended"].map(config => { + return { ...config, - files: ["**/*.spec.ts"], - })), + files: ["**/*.svelte"], + + languageOptions: { + parser: svelteParser, + ecmaVersion: 2019, + sourceType: "script", + + parserOptions: { + parser: "@typescript-eslint/parser", + allowImportExportEverywhere: true, + }, + }, + } + }), + ...tseslint.configs.recommended.map(config => { + return { + ...config, + files: ["**/*.ts"], + + languageOptions: { + globals: { + NodeJS: true, + }, + + parser: tsParser, + }, + + rules: { + "prefer-spread": "off", + "no-unused-vars": "off", + "prefer-rest-params": "off", + "local-rules/no-barrel-imports": "error", + "local-rules/no-budibase-imports": "error", + "local-rules/no-console-error": "error", + + "@typescript-eslint/no-this-alias": "off", + "@typescript-eslint/no-unused-expressions": "off", + "@typescript-eslint/no-empty-object-type": "off", + "@typescript-eslint/no-require-imports": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { + varsIgnorePattern: "^_", + argsIgnorePattern: "^_", + destructuredArrayIgnorePattern: "^_", + ignoreRestSiblings: true, + caughtErrors: "none", + }, + ], + + "no-redeclare": "off", + "@typescript-eslint/no-redeclare": "error", + "no-dupe-class-members": "off", + }, + } + }), { files: ["**/*.spec.ts"], plugins: { - jest, - "@typescript-eslint": typescriptEslint, + jest: eslintPluginJest, }, languageOptions: { globals: { - ...jest.environments.globals.globals, + ...eslintPluginJest.environments.globals.globals, NodeJS: true, }, @@ -172,18 +148,6 @@ export default [ }, rules: { - "no-unused-vars": "off", - - "@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", diff --git a/package.json b/package.json index ece57f9cba..f95685c6ff 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "@babel/eslint-parser": "7.25.9", "@babel/preset-env": "^7.22.5", "@esbuild-plugins/tsconfig-paths": "^0.1.2", - "@eslint/compat": "^1.2.4", "@types/node": "20.10.0", "@types/proper-lockfile": "^4.1.4", "@typescript-eslint/parser": "8.17.0", @@ -15,7 +14,6 @@ "esbuild": "^0.18.17", "esbuild-node-externals": "^1.14.0", "eslint": "9.16.0", - "eslint-plugin-import": "2.31.0", "eslint-plugin-jest": "28.9.0", "eslint-plugin-local-rules": "3.0.2", "eslint-plugin-svelte": "2.46.1", @@ -28,7 +26,7 @@ "prettier-plugin-svelte": "^2.3.0", "proper-lockfile": "^4.1.2", "svelte": "4.2.19", - "svelte-eslint-parser": "^0.33.1", + "svelte-eslint-parser": "0.43.0", "typescript": "5.7.2", "typescript-eslint": "8.17.0", "yargs": "^17.7.2" diff --git a/packages/backend-core/src/events/publishers/query.ts b/packages/backend-core/src/events/publishers/query.ts index 48603257d2..3bc8ffa5fd 100644 --- a/packages/backend-core/src/events/publishers/query.ts +++ b/packages/backend-core/src/events/publishers/query.ts @@ -12,8 +12,6 @@ import { QueriesRunEvent, } from "@budibase/types" -/* eslint-disable */ - const created = async ( datasource: Datasource, query: Query, diff --git a/packages/backend-core/src/events/publishers/rows.ts b/packages/backend-core/src/events/publishers/rows.ts index 9608613e89..e19681e5fe 100644 --- a/packages/backend-core/src/events/publishers/rows.ts +++ b/packages/backend-core/src/events/publishers/rows.ts @@ -6,8 +6,6 @@ import { Table, } from "@budibase/types" -/* eslint-disable */ - const created = async (count: number, timestamp?: string | number) => { const properties: RowsCreatedEvent = { count, diff --git a/packages/backend-core/src/events/publishers/view.ts b/packages/backend-core/src/events/publishers/view.ts index ccbf960b04..9cc4138ca0 100644 --- a/packages/backend-core/src/events/publishers/view.ts +++ b/packages/backend-core/src/events/publishers/view.ts @@ -17,8 +17,6 @@ import { TableExportFormat, } from "@budibase/types" -/* eslint-disable */ - async function created(view: View, timestamp?: string | number) { const properties: ViewCreatedEvent = { tableId: view.tableId, 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 75a3afc2ff..1cb3842c89 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 @@ -12,7 +12,6 @@ vi.mock("stores/selectors", () => ({ describe("datasource creation store", () => { beforeEach(ctx => { vi.clearAllMocks() - // eslint-disable-next-line no-import-assign ctx.store = createDatasourceCreationStore() ctx.integration = { data: "integration" } diff --git a/packages/frontend-core/src/components/Updating.svelte b/packages/frontend-core/src/components/Updating.svelte index 97e83e2322..311a6b91c8 100644 --- a/packages/frontend-core/src/components/Updating.svelte +++ b/packages/frontend-core/src/components/Updating.svelte @@ -7,7 +7,6 @@ async function checkMigrationsFinished() { let totalWaitMs = 0 - // eslint-disable-next-line no-constant-condition while (true) { const waitForMs = 5000 + Math.random() * 5000 await new Promise(resolve => setTimeout(resolve, waitForMs)) diff --git a/packages/server/src/api/routes/tests/application.spec.ts b/packages/server/src/api/routes/tests/application.spec.ts index 1511c1aa61..9480593c2a 100644 --- a/packages/server/src/api/routes/tests/application.spec.ts +++ b/packages/server/src/api/routes/tests/application.spec.ts @@ -208,7 +208,7 @@ describe("/applications", () => { it("should reject with a known url", async () => { await config.api.application.create( - { name: "made up", url: app?.url! }, + { name: "made up", url: app!.url! }, { body: { message: "App URL is already in use." }, status: 400 } ) }) diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index dd1221d6fb..6aac1d2069 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -314,9 +314,7 @@ if (descriptions.length) { const cloned = cloneDeep(response) const foundRows = response.rows - // eslint-disable-next-line jest/no-standalone-expect expect(foundRows).toHaveLength(expectedRows.length) - // eslint-disable-next-line jest/no-standalone-expect expect([...foundRows]).toEqual( expectedRows.map((expectedRow: any) => expect.objectContaining(this.popRow(expectedRow, foundRows)) @@ -333,9 +331,7 @@ if (descriptions.length) { const cloned = cloneDeep(response) const foundRows = response.rows - // eslint-disable-next-line jest/no-standalone-expect expect(foundRows).toHaveLength(expectedRows.length) - // eslint-disable-next-line jest/no-standalone-expect expect([...foundRows]).toEqual( expect.arrayContaining( expectedRows.map((expectedRow: any) => @@ -358,10 +354,8 @@ if (descriptions.length) { keyof SearchResponse > for (let key of keys) { - // eslint-disable-next-line jest/no-standalone-expect expect(response[key]).toBeDefined() if (properties[key]) { - // eslint-disable-next-line jest/no-standalone-expect expect(response[key]).toEqual(properties[key]) } } @@ -375,7 +369,6 @@ if (descriptions.length) { const response = await this.performSearch() const cloned = cloneDeep(response) for (let property of properties) { - // eslint-disable-next-line jest/no-standalone-expect expect(response[property]).toBeUndefined() } return cloned @@ -389,7 +382,6 @@ if (descriptions.length) { const cloned = cloneDeep(response) const foundRows = response.rows - // eslint-disable-next-line jest/no-standalone-expect expect([...foundRows]).toEqual( expect.arrayContaining( expectedRows.map((expectedRow: any) => @@ -409,7 +401,6 @@ if (descriptions.length) { async toHaveLength(length: number) { const { rows: foundRows } = await this.performSearch() - // eslint-disable-next-line jest/no-standalone-expect expect(foundRows).toHaveLength(length) } } @@ -2169,7 +2160,6 @@ if (descriptions.length) { let bookmark: string | number = undefined let rows: Row[] = [] - // eslint-disable-next-line no-constant-condition while (true) { const response = await config.api.row.search( tableOrViewId, diff --git a/packages/server/src/integration-test/postgres.spec.ts b/packages/server/src/integration-test/postgres.spec.ts index 4f63579ba1..88250373f8 100644 --- a/packages/server/src/integration-test/postgres.spec.ts +++ b/packages/server/src/integration-test/postgres.spec.ts @@ -107,7 +107,7 @@ if (mainDescriptions.length) { const table = response.datasource.entities?.["binaryTable"] expect(table).toBeDefined() expect(table?.schema.id.externalType).toBe("bytea") - const row = await config.api.row.save(table?._id!, { + const row = await config.api.row.save(table!._id!, { id: "1111", column1: "hello", column2: 222, diff --git a/packages/server/src/integrations/redis.ts b/packages/server/src/integrations/redis.ts index e127cddd56..ff0e1d25c3 100644 --- a/packages/server/src/integrations/redis.ts +++ b/packages/server/src/integrations/redis.ts @@ -129,7 +129,7 @@ class RedisIntegration { return this.client.quit() } - async redisContext(query: Function) { + async redisContext(query: () => Promise) { try { return await query() } catch (err) { diff --git a/packages/server/src/integrations/rest.ts b/packages/server/src/integrations/rest.ts index ce2ec7d545..1b00a18f18 100644 --- a/packages/server/src/integrations/rest.ts +++ b/packages/server/src/integrations/rest.ts @@ -313,7 +313,9 @@ export class RestIntegration implements IntegrationBase { } // Util to add pagination values to a certain body type - const addPaginationToBody = (insertFn: Function) => { + const addPaginationToBody = ( + insertFn: (pageParam: string, page?: string | number) => void + ) => { if (pagination?.location === "body") { if (pagination?.pageParam && paginationValues?.page != null) { insertFn(pagination.pageParam, paginationValues.page) diff --git a/packages/server/src/integrations/tests/googlesheets.spec.ts b/packages/server/src/integrations/tests/googlesheets.spec.ts index 34be1c0c6c..2c0e4dce84 100644 --- a/packages/server/src/integrations/tests/googlesheets.spec.ts +++ b/packages/server/src/integrations/tests/googlesheets.spec.ts @@ -389,7 +389,6 @@ describe("Google Sheets Integration", () => { }) // TODO: this gets the error "Sheet is not large enough to fit 27 columns. Resize the sheet first." - // eslint-disable-next-line jest/no-commented-out-tests // it("should be able to add a new column", async () => { // const updatedTable = await config.api.table.save({ // ...table, diff --git a/packages/server/src/integrations/tests/rest.spec.ts b/packages/server/src/integrations/tests/rest.spec.ts index e869c58875..fac6f58c3b 100644 --- a/packages/server/src/integrations/tests/rest.spec.ts +++ b/packages/server/src/integrations/tests/rest.spec.ts @@ -456,7 +456,6 @@ describe("REST Integration", () => { // node-fetch >=3, and we're not on that because upgrading to it produces errors to // do with ESM that are above my pay grade. - // eslint-disable-next-line jest/no-commented-out-tests // it("doesn't fail when legacyHttpParser is set", async () => { // const server = createServer((req, res) => { // res.writeHead(200, { diff --git a/packages/server/src/integrations/tests/sqlAlias.spec.ts b/packages/server/src/integrations/tests/sqlAlias.spec.ts index 0f43e41755..3d67a7aa41 100644 --- a/packages/server/src/integrations/tests/sqlAlias.spec.ts +++ b/packages/server/src/integrations/tests/sqlAlias.spec.ts @@ -144,10 +144,10 @@ describe("Captures of real examples", () => { queryJson ) const filters = queryJson.filters - const notEqualsValue = Object.values(filters?.notEqual!)[0] + const notEqualsValue = Object.values(filters!.notEqual!)[0] const rangeValue: { high?: string | number; low?: string | number } = - Object.values(filters?.range!)[0] - const equalValue = Object.values(filters?.equal!)[0] + Object.values(filters!.range!)[0] + const equalValue = Object.values(filters!.equal!)[0] expect(query).toEqual({ bindings: [ diff --git a/packages/server/src/jsRunner/vm/isolated-vm.ts b/packages/server/src/jsRunner/vm/isolated-vm.ts index b8ed90aa23..3863be742d 100644 --- a/packages/server/src/jsRunner/vm/isolated-vm.ts +++ b/packages/server/src/jsRunner/vm/isolated-vm.ts @@ -72,7 +72,7 @@ export class IsolatedVM implements VM { this.addToContext({ helpersStripProtocol: new ivm.Callback((str: string) => { - var parsed = url.parse(str) as any + let parsed = url.parse(str) as any parsed.protocol = "" return parsed.format() }), diff --git a/packages/server/src/middleware/builder.ts b/packages/server/src/middleware/builder.ts index 87c7eef51f..bc775991df 100644 --- a/packages/server/src/middleware/builder.ts +++ b/packages/server/src/middleware/builder.ts @@ -50,7 +50,7 @@ async function updateAppUpdatedAt(ctx: UserCtx) { const metadata = await db.get(DocumentType.APP_METADATA) metadata.updatedAt = new Date().toISOString() - metadata.updatedBy = getGlobalIDFromUserMetadataID(ctx.user?.userId!) + metadata.updatedBy = getGlobalIDFromUserMetadataID(ctx.user!.userId!) const response = await db.put(metadata) metadata._rev = response.rev diff --git a/packages/server/src/migrations/functions/usageQuotas/index.ts b/packages/server/src/migrations/functions/usageQuotas/index.ts index ed1a765551..e94e993b21 100644 --- a/packages/server/src/migrations/functions/usageQuotas/index.ts +++ b/packages/server/src/migrations/functions/usageQuotas/index.ts @@ -1,3 +1,3 @@ -export const runQuotaMigration = async (migration: Function) => { +export const runQuotaMigration = async (migration: () => Promise) => { await migration() } diff --git a/packages/server/src/startup/tests/startup.spec.ts b/packages/server/src/startup/tests/startup.spec.ts index 7209033db8..ffc29655e1 100644 --- a/packages/server/src/startup/tests/startup.spec.ts +++ b/packages/server/src/startup/tests/startup.spec.ts @@ -47,7 +47,7 @@ describe("check BB_ADMIN environment variables", () => { }) expect(user).toBeDefined() expect(user?.password).toBeDefined() - expect(await utils.compare(PASSWORD, user?.password!)).toEqual( + expect(await utils.compare(PASSWORD, user!.password!)).toEqual( true ) } diff --git a/packages/server/src/utilities/global.ts b/packages/server/src/utilities/global.ts index c1fcf35634..975dfbded5 100644 --- a/packages/server/src/utilities/global.ts +++ b/packages/server/src/utilities/global.ts @@ -78,7 +78,7 @@ export async function getCachedSelf( // this has to be tenant aware, can't depend on the context to find it out // running some middlewares before the tenancy causes context to break const user = await cache.user.getUser({ - userId: ctx.user?._id!, + userId: ctx.user!._id!, }) return processUser(user, { appId }) } diff --git a/packages/server/src/websockets/builder.ts b/packages/server/src/websockets/builder.ts index cf92d68ef3..c4a8ca2955 100644 --- a/packages/server/src/websockets/builder.ts +++ b/packages/server/src/websockets/builder.ts @@ -92,7 +92,7 @@ export default class BuilderSocket extends BaseSocket { } } - async updateUser(socket: Socket, patch: Object) { + async updateUser(socket: Socket, patch: object) { await super.updateUser(socket, { builderMetadata: { ...socket.data.builderMetadata, diff --git a/packages/server/src/websockets/grid.ts b/packages/server/src/websockets/grid.ts index 3911313cc3..661d47cb6d 100644 --- a/packages/server/src/websockets/grid.ts +++ b/packages/server/src/websockets/grid.ts @@ -70,7 +70,7 @@ export default class GridSocket extends BaseSocket { }) } - async updateUser(socket: Socket, patch: Object) { + async updateUser(socket: Socket, patch: object) { await super.updateUser(socket, { gridMetadata: { ...socket.data.gridMetadata, diff --git a/packages/server/src/websockets/middleware.ts b/packages/server/src/websockets/middleware.ts index 0a52dcbdeb..7962149cd8 100644 --- a/packages/server/src/websockets/middleware.ts +++ b/packages/server/src/websockets/middleware.ts @@ -58,7 +58,7 @@ export const createContext = ( export const runMiddlewares = async ( ctx: any, middlewares: any[], - callback: Function + callback: () => Promise ) => { if (!middlewares[0]) { await callback() diff --git a/packages/server/src/websockets/websocket.ts b/packages/server/src/websockets/websocket.ts index 5dcf8c8f6f..2f031a72d9 100644 --- a/packages/server/src/websockets/websocket.ts +++ b/packages/server/src/websockets/websocket.ts @@ -250,7 +250,7 @@ export class BaseSocket { } // Updates a connected user's metadata, assuming a room change is not required. - async updateUser(socket: Socket, patch: Object) { + async updateUser(socket: Socket, patch: object) { socket.data = { ...socket.data, ...patch, diff --git a/packages/types/src/sdk/migrations.ts b/packages/types/src/sdk/migrations.ts index 0692b27f8e..f2b0ed48e3 100644 --- a/packages/types/src/sdk/migrations.ts +++ b/packages/types/src/sdk/migrations.ts @@ -1,6 +1,6 @@ export interface Migration extends MigrationDefinition { appOpts?: object - fn: Function + fn: () => void silent?: boolean preventRetry?: boolean } diff --git a/packages/worker/src/api/routes/global/tests/auth.spec.ts b/packages/worker/src/api/routes/global/tests/auth.spec.ts index f6bdd7f663..bff959469e 100644 --- a/packages/worker/src/api/routes/global/tests/auth.spec.ts +++ b/packages/worker/src/api/routes/global/tests/auth.spec.ts @@ -54,7 +54,7 @@ describe("/api/global/auth", () => { describe("POST /api/global/auth/:tenantId/login", () => { it("logs in with correct credentials", async () => { const tenantId = config.tenantId! - const email = config.user?.email! + const email = config.user!.email! const password = config.userPassword const response = await config.api.auth.login(tenantId, email, password) @@ -65,7 +65,7 @@ describe("/api/global/auth", () => { it("should return 403 with incorrect credentials", async () => { const tenantId = config.tenantId! - const email = config.user?.email! + const email = config.user!.email! const password = "incorrect123" const response = await config.api.auth.login( diff --git a/packages/worker/src/api/routes/global/tests/users.spec.ts b/packages/worker/src/api/routes/global/tests/users.spec.ts index b6237c7b4b..239877b71a 100644 --- a/packages/worker/src/api/routes/global/tests/users.spec.ts +++ b/packages/worker/src/api/routes/global/tests/users.spec.ts @@ -343,7 +343,7 @@ describe("/api/global/users", () => { }) it("should not allow a user to update their own admin/builder status", async () => { - const user = (await config.api.users.getUser(config.user?._id!)) + const user = (await config.api.users.getUser(config.user!._id!)) .body as User await config.api.users.saveUser({ ...user, diff --git a/packages/worker/src/middleware/handleScimBody.ts b/packages/worker/src/middleware/handleScimBody.ts index bfcd6dfcf2..07e6286b6b 100644 --- a/packages/worker/src/middleware/handleScimBody.ts +++ b/packages/worker/src/middleware/handleScimBody.ts @@ -1,7 +1,7 @@ import { Ctx } from "@budibase/types" export const handleScimBody = (ctx: Ctx, next: any) => { - var type = ctx.req.headers["content-type"] || "" + let type = ctx.req.headers["content-type"] || "" type = type.split(";")[0] if (type === "application/scim+json") { diff --git a/packages/worker/src/tests/api/email.ts b/packages/worker/src/tests/api/email.ts index dc464ba16d..b2f30e6ac1 100644 --- a/packages/worker/src/tests/api/email.ts +++ b/packages/worker/src/tests/api/email.ts @@ -15,7 +15,7 @@ export class EmailAPI extends TestAPI { attachments, purpose, tenantId: this.config.getTenantId(), - userId: this.config.user?._id!, + userId: this.config.user!._id!, }) .set(this.config.defaultHeaders()) .expect("Content-Type", /json/) diff --git a/yarn.lock b/yarn.lock index 4988e5237d..4b4ab5146f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2675,11 +2675,6 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0" integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== -"@eslint/compat@^1.2.4": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@eslint/compat/-/compat-1.2.4.tgz#b69b0d76ce73fe66d7f8633c406acea151f5c559" - integrity sha512-S8ZdQj/N69YAtuqFt7653jwcvuUj131+6qGLUyDqfDg1OIoBQ66OCuXC473YQfO2AaxITTutiRQiDwoo7ZLYyg== - "@eslint/config-array@^0.19.0": version "0.19.1" resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.19.1.tgz#734aaea2c40be22bbb1f2a9dac687c57a6a4c984" @@ -4313,11 +4308,6 @@ node-fetch "^2.6.0" utf-8-validate "^5.0.2" -"@rtsao/scc@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8" - integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g== - "@shopify/jest-koa-mocks@5.1.1": version "5.1.1" resolved "https://registry.yarnpkg.com/@shopify/jest-koa-mocks/-/jest-koa-mocks-5.1.1.tgz#d615815b0cf0ec9823d054da68c419508b3c3193" @@ -7026,18 +7016,6 @@ array-includes@^3.1.7: get-intrinsic "^1.2.1" is-string "^1.0.7" -array-includes@^3.1.8: - version "3.1.8" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.8.tgz#5e370cbe172fdd5dd6530c1d4aadda25281ba97d" - integrity sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.2" - es-object-atoms "^1.0.0" - get-intrinsic "^1.2.4" - is-string "^1.0.7" - array-union@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" @@ -7059,18 +7037,6 @@ array.prototype.findlastindex@^1.2.3: es-shim-unscopables "^1.0.0" get-intrinsic "^1.2.1" -array.prototype.findlastindex@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz#8c35a755c72908719453f87145ca011e39334d0d" - integrity sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.2" - es-errors "^1.3.0" - es-object-atoms "^1.0.0" - es-shim-unscopables "^1.0.2" - array.prototype.flat@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz#1476217df8cff17d72ee8f3ba06738db5b387d18" @@ -10167,7 +10133,7 @@ es-abstract@^1.22.1, es-abstract@^1.22.3, es-abstract@^1.23.0: unbox-primitive "^1.0.2" which-typed-array "^1.1.15" -es-abstract@^1.23.2, es-abstract@^1.23.3: +es-abstract@^1.23.3: version "1.23.5" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.23.5.tgz#f4599a4946d57ed467515ed10e4f157289cd52fb" integrity sha512-vlmniQ0WNPwXqA0BnmwV3Ng7HxiGlh6r5U6JcTMNx8OilcAGqVJBHJcPjqOMaczU9fRuRK5Px2BdVyPRnKMMVQ== @@ -10262,7 +10228,7 @@ es-set-tostringtag@^2.0.3: has-tostringtag "^1.0.2" hasown "^2.0.1" -es-shim-unscopables@^1.0.0, es-shim-unscopables@^1.0.2: +es-shim-unscopables@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz#1f6942e71ecc7835ed1c8a83006d8771a63a3763" integrity sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw== @@ -10396,13 +10362,6 @@ eslint-import-resolver-node@^0.3.9: is-core-module "^2.13.0" resolve "^1.22.4" -eslint-module-utils@^2.12.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz#fe4cfb948d61f49203d7b08871982b65b9af0b0b" - integrity sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg== - dependencies: - debug "^3.2.7" - eslint-module-utils@^2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz#e439fee65fc33f6bba630ff621efc38ec0375c49" @@ -10410,31 +10369,6 @@ eslint-module-utils@^2.8.0: dependencies: debug "^3.2.7" -eslint-plugin-import@2.31.0: - version "2.31.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz#310ce7e720ca1d9c0bb3f69adfd1c6bdd7d9e0e7" - integrity sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A== - dependencies: - "@rtsao/scc" "^1.1.0" - array-includes "^3.1.8" - array.prototype.findlastindex "^1.2.5" - array.prototype.flat "^1.3.2" - array.prototype.flatmap "^1.3.2" - debug "^3.2.7" - doctrine "^2.1.0" - eslint-import-resolver-node "^0.3.9" - eslint-module-utils "^2.12.0" - hasown "^2.0.2" - is-core-module "^2.15.1" - is-glob "^4.0.3" - minimatch "^3.1.2" - object.fromentries "^2.0.8" - object.groupby "^1.0.3" - object.values "^1.2.0" - semver "^6.3.1" - string.prototype.trimend "^1.0.8" - tsconfig-paths "^3.15.0" - eslint-plugin-import@^2.26.0: version "2.29.1" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz#d45b37b5ef5901d639c15270d74d46d161150643" @@ -10495,7 +10429,7 @@ eslint-scope@5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-scope@^7.0.0, eslint-scope@^7.2.2: +eslint-scope@^7.2.2: version "7.2.2" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== @@ -10516,7 +10450,7 @@ eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: version "3.4.3" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== @@ -10624,7 +10558,7 @@ espree@^10.0.1, espree@^10.3.0: acorn-jsx "^5.3.2" eslint-visitor-keys "^4.2.0" -espree@^9.0.0, espree@^9.6.0, espree@^9.6.1: +espree@^9.6.0, espree@^9.6.1: version "9.6.1" resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== @@ -12811,7 +12745,7 @@ is-class-hotfix@~0.0.6: resolved "https://registry.yarnpkg.com/is-class-hotfix/-/is-class-hotfix-0.0.6.tgz#a527d31fb23279281dde5f385c77b5de70a72435" integrity sha512-0n+pzCC6ICtVr/WXnN2f03TK/3BfXY7me4cjCAqT8TYXEl0+JBRoqBo94JJHXcyDSLUeWbNX8Fvy5g5RJdAstQ== -is-core-module@^2.12.0, is-core-module@^2.15.1: +is-core-module@^2.12.0: version "2.15.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.15.1.tgz#a7363a25bee942fefab0de13bf6aa372c82dcc37" integrity sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ== @@ -16338,16 +16272,6 @@ object.fromentries@^2.0.7: define-properties "^1.2.0" es-abstract "^1.22.1" -object.fromentries@^2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.8.tgz#f7195d8a9b97bd95cbc1999ea939ecd1a2b00c65" - integrity sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.2" - es-object-atoms "^1.0.0" - object.groupby@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/object.groupby/-/object.groupby-1.0.1.tgz#d41d9f3c8d6c778d9cbac86b4ee9f5af103152ee" @@ -16358,15 +16282,6 @@ object.groupby@^1.0.1: es-abstract "^1.22.1" get-intrinsic "^1.2.1" -object.groupby@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/object.groupby/-/object.groupby-1.0.3.tgz#9b125c36238129f6f7b61954a1e7176148d5002e" - integrity sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.2" - object.values@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.7.tgz#617ed13272e7e1071b43973aa1655d9291b8442a" @@ -16376,15 +16291,6 @@ object.values@^1.1.7: define-properties "^1.2.0" es-abstract "^1.22.1" -object.values@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.2.0.tgz#65405a9d92cee68ac2d303002e0b8470a4d9ab1b" - integrity sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-object-atoms "^1.0.0" - octal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/octal/-/octal-1.0.0.tgz#63e7162a68efbeb9e213588d58e989d1e5c4530b" @@ -17336,7 +17242,7 @@ postcss-safe-parser@^6.0.0: resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz#bb4c29894171a94bc5c996b9a30317ef402adaa1" integrity sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ== -postcss-scss@^4.0.8, postcss-scss@^4.0.9: +postcss-scss@^4.0.9: version "4.0.9" resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-4.0.9.tgz#a03c773cd4c9623cb04ce142a52afcec74806685" integrity sha512-AjKOeiwAitL/MXxQW2DliT28EKukvvbEWx3LBmJIRN8KfBGZbRTxNYW0kSqi1COiTZ57nZ9NW06S6ux//N1c9A== @@ -17367,7 +17273,7 @@ postcss-values-parser@^6.0.2: is-url-superb "^4.0.0" quote-unquote "^1.0.0" -postcss@^8.1.7, postcss@^8.3.11, postcss@^8.4.12, postcss@^8.4.27, postcss@^8.4.29: +postcss@^8.1.7, postcss@^8.3.11, postcss@^8.4.12, postcss@^8.4.27: version "8.4.41" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.41.tgz#d6104d3ba272d882fe18fc07d15dc2da62fa2681" integrity sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ== @@ -19960,18 +19866,7 @@ svelte-dnd-action@^0.9.8: resolved "https://registry.yarnpkg.com/svelte-dnd-action/-/svelte-dnd-action-0.9.22.tgz#003eee9dddb31d8c782f6832aec8b1507fff194d" integrity sha512-lOQJsNLM1QWv5mdxIkCVtk6k4lHCtLgfE59y8rs7iOM6erchbLC9hMEFYSveZz7biJV0mpg7yDSs4bj/RT/YkA== -svelte-eslint-parser@^0.33.1: - version "0.33.1" - resolved "https://registry.yarnpkg.com/svelte-eslint-parser/-/svelte-eslint-parser-0.33.1.tgz#c64dbed2fad099577429b3c39377f6b8d36e5d97" - integrity sha512-vo7xPGTlKBGdLH8T5L64FipvTrqv3OQRx9d2z5X05KKZDlF4rQk8KViZO4flKERY+5BiVdOh7zZ7JGJWo5P0uA== - dependencies: - eslint-scope "^7.0.0" - eslint-visitor-keys "^3.0.0" - espree "^9.0.0" - postcss "^8.4.29" - postcss-scss "^4.0.8" - -svelte-eslint-parser@^0.43.0: +svelte-eslint-parser@0.43.0, svelte-eslint-parser@^0.43.0: version "0.43.0" resolved "https://registry.yarnpkg.com/svelte-eslint-parser/-/svelte-eslint-parser-0.43.0.tgz#649e80f65183c4c1d1536d03dcb903e0632f4da4" integrity sha512-GpU52uPKKcVnh8tKN5P4UZpJ/fUDndmq7wfsvoVXsyP+aY0anol7Yqo01fyrlaWGMFfm4av5DyrjlaXdLRJvGA==