From bca2d6974022ee1b2bfa936c897c64745f7c92a2 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 14 Jan 2026 19:29:19 +0000 Subject: [PATCH] fix: resolve useLiteralKeys biome lint issues Co-Authored-By: Volnei Munhoz --- .../src/FloatingButton/FloatingButton.ts | 8 ++++---- packages/embeds/embed-core/src/embed.ts | 10 +++++----- packages/lib/CalendarService.ts | 1 + packages/lib/dayjs/index.ts | 2 +- packages/lib/getBooking.tsx | 2 +- packages/lib/server/checkCfTurnstileToken.ts | 2 +- .../bookings/editLocation.handler.test.ts | 1 + .../routers/viewer/bookings/get.handler.ts | 18 +++++++++--------- .../calVideo/getMeetingInformation.handler.ts | 2 +- .../oAuth/generateAuthCode.handler.test.ts | 16 ++++++++-------- 10 files changed, 32 insertions(+), 30 deletions(-) diff --git a/packages/embeds/embed-core/src/FloatingButton/FloatingButton.ts b/packages/embeds/embed-core/src/FloatingButton/FloatingButton.ts index b1fd6b74467b84..87d7eb99c48034 100644 --- a/packages/embeds/embed-core/src/FloatingButton/FloatingButton.ts +++ b/packages/embeds/embed-core/src/FloatingButton/FloatingButton.ts @@ -96,10 +96,10 @@ export class FloatingButton extends HTMLElement { constructor() { super(); const dataset = this.dataset as FloatingButtonDataset; - const buttonText = dataset["buttonText"]; - const buttonPosition = dataset["buttonPosition"]; - const buttonColor = dataset["buttonColor"]; - const buttonTextColor = dataset["buttonTextColor"]; + const buttonText = dataset.buttonText; + const buttonPosition = dataset.buttonPosition; + const buttonColor = dataset.buttonColor; + const buttonTextColor = dataset.buttonTextColor; //TODO: Logic is duplicated over HTML generation and attribute change, keep it at one place const buttonHtml = ` ${getFloatingButtonHtml({ diff --git a/packages/embeds/embed-core/src/embed.ts b/packages/embeds/embed-core/src/embed.ts index 1c6effb92df29e..2996024d61374b 100644 --- a/packages/embeds/embed-core/src/embed.ts +++ b/packages/embeds/embed-core/src/embed.ts @@ -1018,11 +1018,11 @@ class CalApi { el = existingEl as FloatingButton; } const dataset = el.dataset; - dataset["buttonText"] = buttonText; - dataset["hideButtonIcon"] = `${hideButtonIcon}`; - dataset["buttonPosition"] = `${buttonPosition}`; - dataset["buttonColor"] = `${buttonColor}`; - dataset["buttonTextColor"] = `${buttonTextColor}`; + dataset.buttonText = buttonText; + dataset.hideButtonIcon = `${hideButtonIcon}`; + dataset.buttonPosition = `${buttonPosition}`; + dataset.buttonColor = `${buttonColor}`; + dataset.buttonTextColor = `${buttonTextColor}`; } async modal({ diff --git a/packages/lib/CalendarService.ts b/packages/lib/CalendarService.ts index 6fe8bb7849e7da..e8ea2d1c148d50 100644 --- a/packages/lib/CalendarService.ts +++ b/packages/lib/CalendarService.ts @@ -393,6 +393,7 @@ export default abstract class BaseCalendarService implements Calendar { const dtstartProperty = vevent.getFirstProperty("dtstart"); const tzidFromDtstart = dtstartProperty ? (dtstartProperty as any).jCal[1].tzid : undefined; const dtstart: { [key: string]: string } | undefined = vevent?.getFirstPropertyValue("dtstart"); + // biome-ignore lint/complexity/useLiteralKeys: accessing dynamic property from ICAL.js object const timezone = dtstart ? dtstart["timezone"] : undefined; // We check if the dtstart timezone is in UTC which is actually represented by Z instead, but not recognized as that in ICAL.js as UTC const isUTC = timezone === "Z"; diff --git a/packages/lib/dayjs/index.ts b/packages/lib/dayjs/index.ts index c680413c108516..f892349b5f5005 100644 --- a/packages/lib/dayjs/index.ts +++ b/packages/lib/dayjs/index.ts @@ -177,7 +177,7 @@ export const weekdayToWeekIndex = (weekday: WeekDays | string | number | undefin * @returns Time Zone name */ // eslint-disable-next-line @typescript-eslint/no-explicit-any -export const getTimeZone = (date: Dayjs): string => (date as any)["$x"]["$timezone"]; +export const getTimeZone = (date: Dayjs): string => (date as any).$x.$timezone; /** * Verify if timeZone has Daylight Saving Time (DST). diff --git a/packages/lib/getBooking.tsx b/packages/lib/getBooking.tsx index feaa2c00f84e76..014ea210ea84d9 100644 --- a/packages/lib/getBooking.tsx +++ b/packages/lib/getBooking.tsx @@ -79,7 +79,7 @@ async function getBooking(prisma: PrismaClient, uid: string) { if (booking) { // @NOTE: had to do this because Server side cant return [Object objects] // probably fixable with json.stringify -> json.parse - booking["startTime"] = (booking?.startTime as Date)?.toISOString() as unknown as Date; + booking.startTime = (booking?.startTime as Date)?.toISOString() as unknown as Date; } return booking; diff --git a/packages/lib/server/checkCfTurnstileToken.ts b/packages/lib/server/checkCfTurnstileToken.ts index 2fb0440545812f..1d55a12d594bfc 100644 --- a/packages/lib/server/checkCfTurnstileToken.ts +++ b/packages/lib/server/checkCfTurnstileToken.ts @@ -29,7 +29,7 @@ export async function checkCfTurnstileToken({ token, remoteIp }: { token?: strin const data = await result.json(); - if (!data["success"]) { + if (!data.success) { throw new HttpError({ statusCode: 401, message: INVALID_CLOUDFLARE_TOKEN_ERROR }); } diff --git a/packages/trpc/server/routers/viewer/bookings/editLocation.handler.test.ts b/packages/trpc/server/routers/viewer/bookings/editLocation.handler.test.ts index d33680ce06c39f..9af11a07ceac9c 100644 --- a/packages/trpc/server/routers/viewer/bookings/editLocation.handler.test.ts +++ b/packages/trpc/server/routers/viewer/bookings/editLocation.handler.test.ts @@ -177,6 +177,7 @@ describe.skip("editLocation.handler", () => { ], }, ], + // biome-ignore lint/complexity/useLiteralKeys: app keys contain hyphens apps: [TestData.apps["zoom"], TestData.apps["google-meet"]], }; diff --git a/packages/trpc/server/routers/viewer/bookings/get.handler.ts b/packages/trpc/server/routers/viewer/bookings/get.handler.ts index 8f472df7328afa..1de92aeaaec095 100644 --- a/packages/trpc/server/routers/viewer/bookings/get.handler.ts +++ b/packages/trpc/server/routers/viewer/bookings/get.handler.ts @@ -480,16 +480,16 @@ export async function getBookings({ eb .case() .when("Booking.status", "=", "cancelled") - .then(BookingStatus["CANCELLED"]) + .then(BookingStatus.CANCELLED) .when("Booking.status", "=", "accepted") - .then(BookingStatus["ACCEPTED"]) + .then(BookingStatus.ACCEPTED) .when("Booking.status", "=", "rejected") - .then(BookingStatus["REJECTED"]) + .then(BookingStatus.REJECTED) .when("Booking.status", "=", "pending") - .then(BookingStatus["PENDING"]) + .then(BookingStatus.PENDING) .when("Booking.status", "=", "awaiting_host") - .then(BookingStatus["AWAITING_HOST"]) - .else(BookingStatus["PENDING"]) + .then(BookingStatus.AWAITING_HOST) + .else(BookingStatus.PENDING) .end(), // End of CASE expression "varchar" ) @@ -539,11 +539,11 @@ export async function getBookings({ eb .case() .when("EventType.schedulingType", "=", "roundRobin") - .then(SchedulingType["ROUND_ROBIN"]) + .then(SchedulingType.ROUND_ROBIN) .when("EventType.schedulingType", "=", "collective") - .then(SchedulingType["COLLECTIVE"]) + .then(SchedulingType.COLLECTIVE) .when("EventType.schedulingType", "=", "managed") - .then(SchedulingType["MANAGED"]) + .then(SchedulingType.MANAGED) .else(null) .end(), "varchar" // Or 'text' - use the actual SQL data type diff --git a/packages/trpc/server/routers/viewer/calVideo/getMeetingInformation.handler.ts b/packages/trpc/server/routers/viewer/calVideo/getMeetingInformation.handler.ts index 9a70196ba5528f..153eb26be2d8da 100644 --- a/packages/trpc/server/routers/viewer/calVideo/getMeetingInformation.handler.ts +++ b/packages/trpc/server/routers/viewer/calVideo/getMeetingInformation.handler.ts @@ -16,7 +16,7 @@ export const getMeetingInformationHandler = async ({ ctx: _ctx, input }: GetMeet const { roomName } = input; try { - const dailyVideoAdapterImport = VideoApiAdapterMap["dailyvideo"]; + const dailyVideoAdapterImport = VideoApiAdapterMap.dailyvideo; if (!dailyVideoAdapterImport) { throw new TRPCError({ code: "BAD_REQUEST", diff --git a/packages/trpc/server/routers/viewer/oAuth/generateAuthCode.handler.test.ts b/packages/trpc/server/routers/viewer/oAuth/generateAuthCode.handler.test.ts index 0e813793e72838..e877260f8e7dc0 100644 --- a/packages/trpc/server/routers/viewer/oAuth/generateAuthCode.handler.test.ts +++ b/packages/trpc/server/routers/viewer/oAuth/generateAuthCode.handler.test.ts @@ -86,7 +86,7 @@ describe("generateAuthCodeHandler", () => { await expect(generateAuthCodeHandler({ ctx: mockCtx, input })).rejects.toThrow( new TRPCError({ code: "BAD_REQUEST", - message: OAUTH_ERROR_REASONS["pkce_required"], + message: OAUTH_ERROR_REASONS.pkce_required, }) ); @@ -108,7 +108,7 @@ describe("generateAuthCodeHandler", () => { await expect(generateAuthCodeHandler({ ctx: mockCtx, input })).rejects.toThrow( new TRPCError({ code: "BAD_REQUEST", - message: OAUTH_ERROR_REASONS["invalid_code_challenge_method"], + message: OAUTH_ERROR_REASONS.invalid_code_challenge_method, }) ); @@ -131,7 +131,7 @@ describe("generateAuthCodeHandler", () => { await expect(generateAuthCodeHandler({ ctx: mockCtx, input: inputMD5 })).rejects.toThrow( new TRPCError({ code: "BAD_REQUEST", - message: OAUTH_ERROR_REASONS["invalid_code_challenge_method"], + message: OAUTH_ERROR_REASONS.invalid_code_challenge_method, }) ); @@ -148,7 +148,7 @@ describe("generateAuthCodeHandler", () => { await expect(generateAuthCodeHandler({ ctx: mockCtx, input: inputPlain })).rejects.toThrow( new TRPCError({ code: "BAD_REQUEST", - message: OAUTH_ERROR_REASONS["invalid_code_challenge_method"], + message: OAUTH_ERROR_REASONS.invalid_code_challenge_method, }) ); @@ -266,7 +266,7 @@ describe("generateAuthCodeHandler", () => { await expect(generateAuthCodeHandler({ ctx: mockCtx, input })).rejects.toThrow( new TRPCError({ code: "BAD_REQUEST", - message: OAUTH_ERROR_REASONS["invalid_code_challenge_method"], + message: OAUTH_ERROR_REASONS.invalid_code_challenge_method, }) ); @@ -290,7 +290,7 @@ describe("generateAuthCodeHandler", () => { await expect(generateAuthCodeHandler({ ctx: mockCtx, input })).rejects.toThrow( new TRPCError({ code: "UNAUTHORIZED", - message: OAUTH_ERROR_REASONS["client_not_found"], + message: OAUTH_ERROR_REASONS.client_not_found, }) ); @@ -349,7 +349,7 @@ describe("generateAuthCodeHandler", () => { await expect(generateAuthCodeHandler({ ctx: mockCtx, input: inputInvalid })).rejects.toThrow( new TRPCError({ code: "BAD_REQUEST", - message: OAUTH_ERROR_REASONS["invalid_code_challenge_method"], + message: OAUTH_ERROR_REASONS.invalid_code_challenge_method, }) ); @@ -366,7 +366,7 @@ describe("generateAuthCodeHandler", () => { await expect(generateAuthCodeHandler({ ctx: mockCtx, input: inputPlain })).rejects.toThrow( new TRPCError({ code: "BAD_REQUEST", - message: OAUTH_ERROR_REASONS["invalid_code_challenge_method"], + message: OAUTH_ERROR_REASONS.invalid_code_challenge_method, }) ); });