Skip to content

Commit 5339569

Browse files
fix: resolve useLiteralKeys biome lint issues (calcom#26851)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 92d2b59 commit 5339569

10 files changed

Lines changed: 32 additions & 30 deletions

File tree

packages/embeds/embed-core/src/FloatingButton/FloatingButton.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ export class FloatingButton extends HTMLElement {
9595
constructor() {
9696
super();
9797
const dataset = this.dataset as FloatingButtonDataset;
98-
const buttonText = dataset["buttonText"];
99-
const buttonPosition = dataset["buttonPosition"];
100-
const buttonColor = dataset["buttonColor"];
101-
const buttonTextColor = dataset["buttonTextColor"];
98+
const buttonText = dataset.buttonText;
99+
const buttonPosition = dataset.buttonPosition;
100+
const buttonColor = dataset.buttonColor;
101+
const buttonTextColor = dataset.buttonTextColor;
102102

103103
//TODO: Logic is duplicated over HTML generation and attribute change, keep it at one place
104104
const buttonHtml = `<style>${window.Cal.__css}</style> ${getFloatingButtonHtml({

packages/embeds/embed-core/src/embed.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,11 +1015,11 @@ class CalApi {
10151015
el = existingEl as FloatingButton;
10161016
}
10171017
const dataset = el.dataset;
1018-
dataset["buttonText"] = buttonText;
1019-
dataset["hideButtonIcon"] = `${hideButtonIcon}`;
1020-
dataset["buttonPosition"] = `${buttonPosition}`;
1021-
dataset["buttonColor"] = `${buttonColor}`;
1022-
dataset["buttonTextColor"] = `${buttonTextColor}`;
1018+
dataset.buttonText = buttonText;
1019+
dataset.hideButtonIcon = `${hideButtonIcon}`;
1020+
dataset.buttonPosition = `${buttonPosition}`;
1021+
dataset.buttonColor = `${buttonColor}`;
1022+
dataset.buttonTextColor = `${buttonTextColor}`;
10231023
}
10241024

10251025
async modal({

packages/lib/CalendarService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ export default abstract class BaseCalendarService implements Calendar {
393393
const dtstartProperty = vevent.getFirstProperty("dtstart");
394394
const tzidFromDtstart = dtstartProperty ? (dtstartProperty as any).jCal[1].tzid : undefined;
395395
const dtstart: { [key: string]: string } | undefined = vevent?.getFirstPropertyValue("dtstart");
396+
// biome-ignore lint/complexity/useLiteralKeys: accessing dynamic property from ICAL.js object
396397
const timezone = dtstart ? dtstart["timezone"] : undefined;
397398
// 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
398399
const isUTC = timezone === "Z";

packages/lib/dayjs/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export const weekdayToWeekIndex = (weekday: WeekDays | string | number | undefin
177177
* @returns Time Zone name
178178
*/
179179
// eslint-disable-next-line @typescript-eslint/no-explicit-any
180-
export const getTimeZone = (date: Dayjs): string => (date as any)["$x"]["$timezone"];
180+
export const getTimeZone = (date: Dayjs): string => (date as any).$x.$timezone;
181181

182182
/**
183183
* Verify if timeZone has Daylight Saving Time (DST).

packages/lib/getBooking.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ async function getBooking(prisma: PrismaClient, uid: string) {
7979
if (booking) {
8080
// @NOTE: had to do this because Server side cant return [Object objects]
8181
// probably fixable with json.stringify -> json.parse
82-
booking["startTime"] = (booking?.startTime as Date)?.toISOString() as unknown as Date;
82+
booking.startTime = (booking?.startTime as Date)?.toISOString() as unknown as Date;
8383
}
8484

8585
return booking;

packages/lib/server/checkCfTurnstileToken.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export async function checkCfTurnstileToken({ token, remoteIp }: { token?: strin
2929

3030
const data = await result.json();
3131

32-
if (!data["success"]) {
32+
if (!data.success) {
3333
throw new HttpError({ statusCode: 401, message: INVALID_CLOUDFLARE_TOKEN_ERROR });
3434
}
3535

packages/trpc/server/routers/viewer/bookings/editLocation.handler.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ describe.skip("editLocation.handler", () => {
177177
],
178178
},
179179
],
180+
// biome-ignore lint/complexity/useLiteralKeys: app keys contain hyphens
180181
apps: [TestData.apps["zoom"], TestData.apps["google-meet"]],
181182
};
182183

packages/trpc/server/routers/viewer/bookings/get.handler.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -480,16 +480,16 @@ export async function getBookings({
480480
eb
481481
.case()
482482
.when("Booking.status", "=", "cancelled")
483-
.then(BookingStatus["CANCELLED"])
483+
.then(BookingStatus.CANCELLED)
484484
.when("Booking.status", "=", "accepted")
485-
.then(BookingStatus["ACCEPTED"])
485+
.then(BookingStatus.ACCEPTED)
486486
.when("Booking.status", "=", "rejected")
487-
.then(BookingStatus["REJECTED"])
487+
.then(BookingStatus.REJECTED)
488488
.when("Booking.status", "=", "pending")
489-
.then(BookingStatus["PENDING"])
489+
.then(BookingStatus.PENDING)
490490
.when("Booking.status", "=", "awaiting_host")
491-
.then(BookingStatus["AWAITING_HOST"])
492-
.else(BookingStatus["PENDING"])
491+
.then(BookingStatus.AWAITING_HOST)
492+
.else(BookingStatus.PENDING)
493493
.end(), // End of CASE expression
494494
"varchar"
495495
)
@@ -539,11 +539,11 @@ export async function getBookings({
539539
eb
540540
.case()
541541
.when("EventType.schedulingType", "=", "roundRobin")
542-
.then(SchedulingType["ROUND_ROBIN"])
542+
.then(SchedulingType.ROUND_ROBIN)
543543
.when("EventType.schedulingType", "=", "collective")
544-
.then(SchedulingType["COLLECTIVE"])
544+
.then(SchedulingType.COLLECTIVE)
545545
.when("EventType.schedulingType", "=", "managed")
546-
.then(SchedulingType["MANAGED"])
546+
.then(SchedulingType.MANAGED)
547547
.else(null)
548548
.end(),
549549
"varchar" // Or 'text' - use the actual SQL data type

packages/trpc/server/routers/viewer/calVideo/getMeetingInformation.handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const getMeetingInformationHandler = async ({ ctx: _ctx, input }: GetMeet
1616
const { roomName } = input;
1717

1818
try {
19-
const dailyVideoAdapterImport = VideoApiAdapterMap["dailyvideo"];
19+
const dailyVideoAdapterImport = VideoApiAdapterMap.dailyvideo;
2020
if (!dailyVideoAdapterImport) {
2121
throw new TRPCError({
2222
code: "BAD_REQUEST",

packages/trpc/server/routers/viewer/oAuth/generateAuthCode.handler.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe("generateAuthCodeHandler", () => {
8686
await expect(generateAuthCodeHandler({ ctx: mockCtx, input })).rejects.toThrow(
8787
new TRPCError({
8888
code: "BAD_REQUEST",
89-
message: OAUTH_ERROR_REASONS["pkce_required"],
89+
message: OAUTH_ERROR_REASONS.pkce_required,
9090
})
9191
);
9292

@@ -108,7 +108,7 @@ describe("generateAuthCodeHandler", () => {
108108
await expect(generateAuthCodeHandler({ ctx: mockCtx, input })).rejects.toThrow(
109109
new TRPCError({
110110
code: "BAD_REQUEST",
111-
message: OAUTH_ERROR_REASONS["invalid_code_challenge_method"],
111+
message: OAUTH_ERROR_REASONS.invalid_code_challenge_method,
112112
})
113113
);
114114

@@ -131,7 +131,7 @@ describe("generateAuthCodeHandler", () => {
131131
await expect(generateAuthCodeHandler({ ctx: mockCtx, input: inputMD5 })).rejects.toThrow(
132132
new TRPCError({
133133
code: "BAD_REQUEST",
134-
message: OAUTH_ERROR_REASONS["invalid_code_challenge_method"],
134+
message: OAUTH_ERROR_REASONS.invalid_code_challenge_method,
135135
})
136136
);
137137

@@ -148,7 +148,7 @@ describe("generateAuthCodeHandler", () => {
148148
await expect(generateAuthCodeHandler({ ctx: mockCtx, input: inputPlain })).rejects.toThrow(
149149
new TRPCError({
150150
code: "BAD_REQUEST",
151-
message: OAUTH_ERROR_REASONS["invalid_code_challenge_method"],
151+
message: OAUTH_ERROR_REASONS.invalid_code_challenge_method,
152152
})
153153
);
154154

@@ -266,7 +266,7 @@ describe("generateAuthCodeHandler", () => {
266266
await expect(generateAuthCodeHandler({ ctx: mockCtx, input })).rejects.toThrow(
267267
new TRPCError({
268268
code: "BAD_REQUEST",
269-
message: OAUTH_ERROR_REASONS["invalid_code_challenge_method"],
269+
message: OAUTH_ERROR_REASONS.invalid_code_challenge_method,
270270
})
271271
);
272272

@@ -290,7 +290,7 @@ describe("generateAuthCodeHandler", () => {
290290
await expect(generateAuthCodeHandler({ ctx: mockCtx, input })).rejects.toThrow(
291291
new TRPCError({
292292
code: "UNAUTHORIZED",
293-
message: OAUTH_ERROR_REASONS["client_not_found"],
293+
message: OAUTH_ERROR_REASONS.client_not_found,
294294
})
295295
);
296296

@@ -349,7 +349,7 @@ describe("generateAuthCodeHandler", () => {
349349
await expect(generateAuthCodeHandler({ ctx: mockCtx, input: inputInvalid })).rejects.toThrow(
350350
new TRPCError({
351351
code: "BAD_REQUEST",
352-
message: OAUTH_ERROR_REASONS["invalid_code_challenge_method"],
352+
message: OAUTH_ERROR_REASONS.invalid_code_challenge_method,
353353
})
354354
);
355355

@@ -366,7 +366,7 @@ describe("generateAuthCodeHandler", () => {
366366
await expect(generateAuthCodeHandler({ ctx: mockCtx, input: inputPlain })).rejects.toThrow(
367367
new TRPCError({
368368
code: "BAD_REQUEST",
369-
message: OAUTH_ERROR_REASONS["invalid_code_challenge_method"],
369+
message: OAUTH_ERROR_REASONS.invalid_code_challenge_method,
370370
})
371371
);
372372
});

0 commit comments

Comments
 (0)