Scheduling infrastructure for absolutely everyone.
fix: resolve useLiteralKeys biome lint issues (#26851)
Volnei Munhoz53395695b4c6
diff --git a/packages/embeds/embed-core/src/FloatingButton/FloatingButton.ts b/packages/embeds/embed-core/src/FloatingButton/FloatingButton.tsindex 8029af5a892..18c016a81c0 100644--- a/packages/embeds/embed-core/src/FloatingButton/FloatingButton.ts+++ b/packages/embeds/embed-core/src/FloatingButton/FloatingButton.ts@@ -95,10 +95,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 placeconst buttonHtml = `<style>${window.Cal.__css}</style> ${getFloatingButtonHtml({diff --git a/packages/embeds/embed-core/src/embed.ts b/packages/embeds/embed-core/src/embed.tsindex d3131bd92ed..c39dbf2d003 100644--- a/packages/embeds/embed-core/src/embed.ts+++ b/packages/embeds/embed-core/src/embed.ts@@ -1015,11 +1015,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.tsindex 6fe8bb7849e..e8ea2d1c148 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 objectconst 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 UTCconst isUTC = timezone === "Z";diff --git a/packages/lib/dayjs/index.ts b/packages/lib/dayjs/index.tsindex c680413c108..f892349b5f5 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.tsxindex feaa2c00f84..014ea210ea8 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.tsindex 2fb04405458..1d55a12d594 100644--- a/packages/lib/server/checkCfTurnstileToken.ts+++ b/packages/lib/server/checkCfTurnstileToken.ts@@ -29,7 +29,7 @@ export async function checkCfTurnstileToken({ token, remoteIp }: { token?: strinconst 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.tsindex d33680ce06c..9af11a07cea 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 hyphensapps: [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.tsindex 8f472df7328..1de92aeaaec 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 typediff --git a/packages/trpc/server/routers/viewer/calVideo/getMeetingInformation.handler.ts b/packages/trpc/server/routers/viewer/calVideo/getMeetingInformation.handler.tsindex 9a70196ba55..153eb26be2d 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 }: GetMeetconst { 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.tsindex 0e813793e72..e877260f8e7 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,}));});