Skip to content

Scheduling infrastructure for absolutely everyone.

fix: lint errors (#17351)

Benny Joo7d51741de0f3
diff --git a/apps/web/app/layoutHOC.tsx b/apps/web/app/layoutHOC.tsx
index 7fc8abeda39..167219f84ca 100644
--- a/apps/web/app/layoutHOC.tsx
+++ b/apps/web/app/layoutHOC.tsx
@@ -25,6 +25,7 @@ export function WithLayout<T extends Record<string, any>>({
isBookingPage,
requiresLicense,
}: WithLayoutParams<T>) {
+ // eslint-disable-next-line react/display-name
return async <P extends "P" | "L">(p: P extends "P" ? PageProps : LayoutProps) => {
const h = headers();
const nonce = h.get("x-nonce") ?? undefined;
diff --git a/apps/web/components/apps/AppList.tsx b/apps/web/components/apps/AppList.tsx
index 0c514d46099..ee065026e42 100644
--- a/apps/web/components/apps/AppList.tsx
+++ b/apps/web/components/apps/AppList.tsx
@@ -165,8 +165,8 @@ export const AppList = ({ data, handleDisconnect, variant, listClassName }: AppL
{cardsForAppsWithTeams.map((apps) => apps.map((cards) => cards))}
{data.items
.filter((item) => item.invalidCredentialIds)
- .map((item) => {
- if (!item.teams.length) return <ChildAppCard item={item} />;
+ .map((item, i) => {
+ if (!item.teams.length) return <ChildAppCard key={i} item={item} />;
})}
</List>
{locationType && (
diff --git a/apps/web/components/dialog/RerouteDialog.tsx b/apps/web/components/dialog/RerouteDialog.tsx
index 5fb8f6da9eb..6f358c5e709 100644
--- a/apps/web/components/dialog/RerouteDialog.tsx
+++ b/apps/web/components/dialog/RerouteDialog.tsx
@@ -26,7 +26,7 @@ import { trpc } from "@calcom/trpc/react";
import type { Ensure } from "@calcom/types/utils";
import { Dialog, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui";
import { Button, Tooltip } from "@calcom/ui";
-import { showToast } from "@calcom/ui/toast";
+import { showToast } from "@calcom/ui";
const enum ReroutingStatusEnum {
REROUTING_NOT_INITIATED = "not_initiated",
diff --git a/apps/web/components/dialog/__tests__/RerouteDialog.test.tsx b/apps/web/components/dialog/__tests__/RerouteDialog.test.tsx
index 066e35e5ce4..081c30b73c8 100644
--- a/apps/web/components/dialog/__tests__/RerouteDialog.test.tsx
+++ b/apps/web/components/dialog/__tests__/RerouteDialog.test.tsx
@@ -1,5 +1,4 @@
-import { act, fireEvent, render, screen, waitFor } from "@testing-library/react";
-import { useRouter } from "next/navigation";
+import { act, fireEvent, render, screen } from "@testing-library/react";
import { vi } from "vitest";
import { RouteActionType } from "@calcom/app-store/routing-forms/zod";
@@ -209,7 +208,7 @@ vi.mock("@calcom/trpc/react", () => ({
},
}));
-let mockMutateFn = vi.fn(({ __testOnSuccess }) => {
+const mockMutateFn = vi.fn(({ __testOnSuccess }) => {
__testOnSuccess({
uid: "RESCHEDULED_BOOKING_UID_SAME_TIMESLOT",
});
@@ -351,7 +350,7 @@ describe("RerouteDialog", () => {
test("verify_new_route button is enabled even when form fields are not filled", async () => {
render(<RerouteDialog isOpenDialog={true} setIsOpenDialog={mockSetIsOpenDialog} booking={mockBooking} />);
- expect(screen.getByText("verify_new_route")).toBeEnabled();
+ await expect(screen.getByText("verify_new_route")).toBeEnabled();
});
test("disabledFields are passed to FormInputFields with value ['email'] - email field is disabled", async () => {
@@ -388,7 +387,7 @@ describe("RerouteDialog", () => {
eventTypeText: "team/test-team/new-test-event",
eventTypeHref: "https://cal.com/team/test-team/new-test-event",
});
- expect(screen.getByText("verify_new_route")).toBeEnabled();
+ await expect(screen.getByText("verify_new_route")).toBeEnabled();
expect(screen.getByTestId("reroute-preview-hosts")).toHaveTextContent("reroute_preview_possible_host");
expect(screen.getByTestId("reroute-preview-hosts")).toHaveTextContent("[email protected]");
diff --git a/apps/web/public/service-worker.js b/apps/web/public/service-worker.js
index 2403d15ff7d..47cc9a72e60 100644
--- a/apps/web/public/service-worker.js
+++ b/apps/web/public/service-worker.js
@@ -2,16 +2,15 @@ self.addEventListener("push", async (event) => {
let notificationData = event.data.json();
const allClients = await clients.matchAll({
- type: 'window',
- includeUncontrolled: true
+ type: "window",
+ includeUncontrolled: true,
});
- if(!allClients.length) {
+ if (!allClients.length) {
console.log("No open tabs, skipping the push notification.");
return;
}
-
const title = notificationData.title || "You have a new notification from Cal.com";
const image = "https://cal.com/api/logo?type=icon";
const newNotificationOptions = {
@@ -27,7 +26,6 @@ self.addEventListener("push", async (event) => {
tag: `notification-${Date.now()}-${Math.random()}`,
};
-
const existingNotifications = await self.registration.getNotifications();
// Display each existing notification again to make sure old ones can still be clicked
@@ -45,7 +43,6 @@ self.addEventListener("push", async (event) => {
self.registration.showNotification(notification.title, options);
});
-
// Show the new notification
self.registration.showNotification(title, newNotificationOptions);
});
@@ -59,7 +56,7 @@ self.addEventListener("notificationclick", (event) => {
}
switch (event.action) {
- case 'connect-action':
+ case "connect-action":
event.notification.close();
const url = event.notification.data.url;
event.waitUntil(self.clients.openWindow(url));