From 835397ad4feb85c112f0e0702cbaba3468d8ccca Mon Sep 17 00:00:00 2001 From: rajdip-b Date: Tue, 5 Nov 2024 15:23:34 +0530 Subject: [PATCH] chore: Fixed lint issues --- .../environment/update.environment.ts | 4 +++- apps/cli/src/commands/run.command.ts | 4 ++-- .../src/commands/variable/create.variable.ts | 8 +++++-- apps/web/src/components/hero/index.tsx | 2 +- packages/api-client/src/types/user.types.d.ts | 1 - packages/api-client/tests/secret.spec.ts | 2 +- packages/api-client/tests/user.spec.ts | 23 ++++++++----------- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/apps/cli/src/commands/environment/update.environment.ts b/apps/cli/src/commands/environment/update.environment.ts index fde63f4c..185e5279 100644 --- a/apps/cli/src/commands/environment/update.environment.ts +++ b/apps/cli/src/commands/environment/update.environment.ts @@ -66,7 +66,9 @@ export class UpdateEnvironment extends BaseCommand { `Environment Slug: ${environment.slug}, Name: ${environment.name}, Description: ${environment.description}` ) } else { - Logger.error(`Error updating Environment: ${error}`) + Logger.error( + `Error updating Environment: ${error.message} (${error.statusCode})` + ) } } } diff --git a/apps/cli/src/commands/run.command.ts b/apps/cli/src/commands/run.command.ts index d8e8bd06..25d3d5bd 100644 --- a/apps/cli/src/commands/run.command.ts +++ b/apps/cli/src/commands/run.command.ts @@ -199,7 +199,7 @@ export default class RunCommand extends BaseCommand { ) if (!secretsResponse.success) { - throw new Error(secretsResponse.error.message as string) + throw new Error(secretsResponse.error.message) } const variablesResponse = @@ -214,7 +214,7 @@ export default class RunCommand extends BaseCommand { ) if (!variablesResponse.success) { - throw new Error(variablesResponse.error.message as string) + throw new Error(variablesResponse.error.message) } // Merge secrets and variables diff --git a/apps/cli/src/commands/variable/create.variable.ts b/apps/cli/src/commands/variable/create.variable.ts index 35ef146c..d308f1e0 100644 --- a/apps/cli/src/commands/variable/create.variable.ts +++ b/apps/cli/src/commands/variable/create.variable.ts @@ -12,9 +12,11 @@ export default class CreateVariable extends BaseCommand { getName(): string { return 'create' } + getDescription(): string { return 'Create a variable' } + getArguments(): CommandArgument[] { return [ { @@ -99,9 +101,11 @@ export default class CreateVariable extends BaseCommand { } const parsedEntries = entries.map((entry) => { - const [environmentSlug, value] = entry.split('=').map(s => s.trim()) + const [environmentSlug, value] = entry.split('=').map((s) => s.trim()) if (!environmentSlug || !value) { - throw new Error(`Invalid entry format: ${entry}. Expected format: "environmentSlug=value"`) + throw new Error( + `Invalid entry format: ${entry}. Expected format: "environmentSlug=value"` + ) } return { environmentSlug, value } }) diff --git a/apps/web/src/components/hero/index.tsx b/apps/web/src/components/hero/index.tsx index 7fca0013..ca45f4e1 100644 --- a/apps/web/src/components/hero/index.tsx +++ b/apps/web/src/components/hero/index.tsx @@ -3,8 +3,8 @@ import Image from 'next/image' import { useState } from 'react' import { Toaster, toast } from 'sonner' -import { ColorBGSVG, HeroImage } from '@public/hero' import { z } from 'zod' +import { ColorBGSVG, HeroImage } from '@public/hero' import EncryptButton from '../ui/encrypt-btn' import { InputBorderSpotlight } from '../ui/input-spotlight' diff --git a/packages/api-client/src/types/user.types.d.ts b/packages/api-client/src/types/user.types.d.ts index b5a553bc..2252665f 100644 --- a/packages/api-client/src/types/user.types.d.ts +++ b/packages/api-client/src/types/user.types.d.ts @@ -1,4 +1,3 @@ -import { PageRequest, PageResponse } from '@api-client/index' import { Workspace } from '@api-client/types/workspace.types' export interface GetSelfResponse { diff --git a/packages/api-client/tests/secret.spec.ts b/packages/api-client/tests/secret.spec.ts index bdf71ea7..dea11a10 100644 --- a/packages/api-client/tests/secret.spec.ts +++ b/packages/api-client/tests/secret.spec.ts @@ -245,7 +245,7 @@ describe('Secret Controller Tests', () => { it('should be able to fetch revisions of a secret', async () => { const revisions = await secretController.getRevisionsOfSecret( - { secretSlug, environmentSlug}, + { secretSlug, environmentSlug }, { 'x-e2e-user-email': email } ) expect(revisions.data.items.length).toBe(1) diff --git a/packages/api-client/tests/user.spec.ts b/packages/api-client/tests/user.spec.ts index d2f9bc55..d82fb53e 100644 --- a/packages/api-client/tests/user.spec.ts +++ b/packages/api-client/tests/user.spec.ts @@ -10,7 +10,6 @@ describe('User Controller Tests', () => { const email = 'johndoe@example.com' let projectSlug: string | null let workspaceSlug: string | null - let environmentSlug: string | null beforeAll(async () => { //Create the user's workspace @@ -44,19 +43,15 @@ describe('User Controller Tests', () => { projectSlug = projectResponse.slug - const createEnvironmentResponse = (await ( - await client.post( - `/api/environment/${projectSlug}`, - { - name: 'Dev' - }, - { - 'x-e2e-user-email': email - } - ) - ).json()) as any - - environmentSlug = createEnvironmentResponse.slug + await client.post( + `/api/environment/${projectSlug}`, + { + name: 'Dev' + }, + { + 'x-e2e-user-email': email + } + ) }) afterAll(async () => {