From 0ec1638ca716d3188408b7616e216c1c3d55470c Mon Sep 17 00:00:00 2001
From: Alex van Andel
Date: Mon, 25 Aug 2025 02:30:45 +0100
Subject: [PATCH] chore: Clean up some code, like console.log, tsx -> ts
(#23321)
---
apps/web/components/dialog/RerouteDialog.tsx | 7 -------
apps/web/components/notification-sound-handler.tsx | 4 +---
.../apps/[slug]/{getStaticProps.tsx => getStaticProps.ts} | 0
.../[category]/{getStaticProps.tsx => getStaticProps.ts} | 0
.../{getServerSideProps.tsx => getServerSideProps.ts} | 0
apps/web/lib/{buildLegacyCtx.tsx => buildLegacyCtx.ts} | 0
apps/web/lib/{getQuery.tsx => getQuery.ts} | 0
apps/web/lib/{withEmbedSsr.tsx => withEmbedSsr.ts} | 0
apps/web/modules/auth/platform/authorize-view.tsx | 4 +---
apps/web/modules/signup-view.tsx | 4 +++-
packages/features/Segment.tsx | 2 +-
.../features/ee/api-keys/components/ApiKeyDialogForm.tsx | 1 -
.../features/ee/api-keys/components/ApiKeyListItem.tsx | 2 +-
.../organizations/pages/settings/delegationCredential.tsx | 2 +-
packages/lib/hooks/{useDebounce.tsx => useDebounce.ts} | 0
packages/lib/hooks/{useResponsive.tsx => useResponsive.ts} | 0
packages/lib/hooks/{useTheme.tsx => useTheme.ts} | 0
.../lib/hooks/{useTraceUpdate.tsx => useTraceUpdate.ts} | 3 ---
packages/ui/components/form/step/FormStep.tsx | 1 -
packages/ui/components/scrollable/ScrollableArea.tsx | 1 -
20 files changed, 8 insertions(+), 23 deletions(-)
rename apps/web/lib/apps/[slug]/{getStaticProps.tsx => getStaticProps.ts} (100%)
rename apps/web/lib/apps/categories/[category]/{getStaticProps.tsx => getStaticProps.ts} (100%)
rename apps/web/lib/apps/categories/{getServerSideProps.tsx => getServerSideProps.ts} (100%)
rename apps/web/lib/{buildLegacyCtx.tsx => buildLegacyCtx.ts} (100%)
rename apps/web/lib/{getQuery.tsx => getQuery.ts} (100%)
rename apps/web/lib/{withEmbedSsr.tsx => withEmbedSsr.ts} (100%)
rename packages/lib/hooks/{useDebounce.tsx => useDebounce.ts} (100%)
rename packages/lib/hooks/{useResponsive.tsx => useResponsive.ts} (100%)
rename packages/lib/hooks/{useTheme.tsx => useTheme.ts} (100%)
rename packages/lib/hooks/{useTraceUpdate.tsx => useTraceUpdate.ts} (85%)
diff --git a/apps/web/components/dialog/RerouteDialog.tsx b/apps/web/components/dialog/RerouteDialog.tsx
index 2ee3bf65da..ea01b97825 100644
--- a/apps/web/components/dialog/RerouteDialog.tsx
+++ b/apps/web/components/dialog/RerouteDialog.tsx
@@ -539,18 +539,11 @@ const NewRoutingManager = ({
url: chosenEventUrls.eventBookingAbsoluteUrl,
});
- console.log("SETTING NEW VALUE", {
- type: "reschedule_to_different_event_new_tab",
- reschedulerWindow,
- newBooking: null,
- });
reroutingState.setValue({
type: "reschedule_to_different_event_new_tab",
reschedulerWindow,
newBooking: null,
});
-
- console.log("VALUE NOW", JSON.stringify(reroutingState));
}
function reroutingPreview() {
diff --git a/apps/web/components/notification-sound-handler.tsx b/apps/web/components/notification-sound-handler.tsx
index 4730439687..b052dab08c 100644
--- a/apps/web/components/notification-sound-handler.tsx
+++ b/apps/web/components/notification-sound-handler.tsx
@@ -22,7 +22,6 @@ export function NotificationSoundHandler() {
const response = await fetch("/ring.mp3");
const arrayBuffer = await response.arrayBuffer();
audioBufferRef.current = await audioContextRef.current.decodeAudioData(arrayBuffer);
- console.log("Audio file loaded and decoded");
}
return true;
@@ -62,7 +61,6 @@ export function NotificationSoundHandler() {
source.loop = true;
source.start(0);
- console.log("Sound started playing");
setTimeout(() => {
if (sourceRef.current === source) {
@@ -101,7 +99,7 @@ export function NotificationSoundHandler() {
useEffect(() => {
if (!("serviceWorker" in navigator)) {
- console.log("ServiceWorker not available");
+ console.warn("ServiceWorker not available");
return;
}
diff --git a/apps/web/lib/apps/[slug]/getStaticProps.tsx b/apps/web/lib/apps/[slug]/getStaticProps.ts
similarity index 100%
rename from apps/web/lib/apps/[slug]/getStaticProps.tsx
rename to apps/web/lib/apps/[slug]/getStaticProps.ts
diff --git a/apps/web/lib/apps/categories/[category]/getStaticProps.tsx b/apps/web/lib/apps/categories/[category]/getStaticProps.ts
similarity index 100%
rename from apps/web/lib/apps/categories/[category]/getStaticProps.tsx
rename to apps/web/lib/apps/categories/[category]/getStaticProps.ts
diff --git a/apps/web/lib/apps/categories/getServerSideProps.tsx b/apps/web/lib/apps/categories/getServerSideProps.ts
similarity index 100%
rename from apps/web/lib/apps/categories/getServerSideProps.tsx
rename to apps/web/lib/apps/categories/getServerSideProps.ts
diff --git a/apps/web/lib/buildLegacyCtx.tsx b/apps/web/lib/buildLegacyCtx.ts
similarity index 100%
rename from apps/web/lib/buildLegacyCtx.tsx
rename to apps/web/lib/buildLegacyCtx.ts
diff --git a/apps/web/lib/getQuery.tsx b/apps/web/lib/getQuery.ts
similarity index 100%
rename from apps/web/lib/getQuery.tsx
rename to apps/web/lib/getQuery.ts
diff --git a/apps/web/lib/withEmbedSsr.tsx b/apps/web/lib/withEmbedSsr.ts
similarity index 100%
rename from apps/web/lib/withEmbedSsr.tsx
rename to apps/web/lib/withEmbedSsr.ts
diff --git a/apps/web/modules/auth/platform/authorize-view.tsx b/apps/web/modules/auth/platform/authorize-view.tsx
index 35128b0515..241647befc 100644
--- a/apps/web/modules/auth/platform/authorize-view.tsx
+++ b/apps/web/modules/auth/platform/authorize-view.tsx
@@ -6,9 +6,9 @@ import { APP_NAME } from "@calcom/lib/constants";
import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { PERMISSIONS_GROUPED_MAP } from "@calcom/platform-constants/permissions";
-import { Icon } from "@calcom/ui/components/icon";
import { Avatar } from "@calcom/ui/components/avatar";
import { Button } from "@calcom/ui/components/button";
+import { Icon } from "@calcom/ui/components/icon";
import { hasPermission } from "../../../../../packages/platform/utils/permissions";
@@ -32,8 +32,6 @@ export default function Authorize() {
permissions: 7,
};
- console.log("These are the search params:", queryString);
-
const permissions = Object.values(PERMISSIONS_GROUPED_MAP).map((value) => {
let permissionsMessage = "";
const hasReadPermission = hasPermission(client.permissions, value.read);
diff --git a/apps/web/modules/signup-view.tsx b/apps/web/modules/signup-view.tsx
index 03a722c270..b2662f553b 100644
--- a/apps/web/modules/signup-view.tsx
+++ b/apps/web/modules/signup-view.tsx
@@ -197,6 +197,7 @@ export default function Signup({
useEffect(() => {
if (redirectUrl) {
+ // eslint-disable-next-line @calcom/eslint/avoid-web-storage
localStorage.setItem("onBoardingRedirect", redirectUrl);
}
}, [redirectUrl]);
@@ -216,7 +217,6 @@ export default function Signup({
if (err.checkoutSessionId) {
const stripe = await getStripe();
if (stripe) {
- console.log("Redirecting to stripe checkout");
const { error } = await stripe.redirectToCheckout({
sessionId: err.checkoutSessionId,
});
@@ -470,6 +470,7 @@ export default function Signup({
showToast("error", t("username_required"));
return;
}
+ // eslint-disable-next-line @calcom/eslint/avoid-web-storage
localStorage.setItem("username", username);
const sp = new URLSearchParams();
// @NOTE: don't remove username query param as it's required right now for stripe payment page
@@ -539,6 +540,7 @@ export default function Signup({
if (prepopulateFormValues?.username) {
// If username is present we save it in query params to check for premium
searchQueryParams.set("username", prepopulateFormValues.username);
+ // eslint-disable-next-line @calcom/eslint/avoid-web-storage
localStorage.setItem("username", prepopulateFormValues.username);
}
if (token) {
diff --git a/packages/features/Segment.tsx b/packages/features/Segment.tsx
index f8260e694e..f133c0e127 100644
--- a/packages/features/Segment.tsx
+++ b/packages/features/Segment.tsx
@@ -193,7 +193,7 @@ export function Segment({
const { t } = useLocale();
if (isPending) return Loading...;
if (!attributes) {
- console.log("Error fetching attributes");
+ console.error("Error fetching attributes");
return {t("something_went_wrong")};
}
diff --git a/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsx b/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsx
index abd0cbeac7..b709b94171 100644
--- a/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsx
+++ b/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsx
@@ -128,7 +128,6 @@ export default function ApiKeyDialogForm({
form={form}
handleSubmit={async (event) => {
if (defaultValues) {
- console.log("Name changed");
await updateApiKeyMutation.mutate({ id: defaultValues.id, note: event.note });
} else {
const apiKey = await utils.client.viewer.apiKeys.create.mutate(event);
diff --git a/packages/features/ee/api-keys/components/ApiKeyListItem.tsx b/packages/features/ee/api-keys/components/ApiKeyListItem.tsx
index 3f7d27f329..b4eae5b4d3 100644
--- a/packages/features/ee/api-keys/components/ApiKeyListItem.tsx
+++ b/packages/features/ee/api-keys/components/ApiKeyListItem.tsx
@@ -39,7 +39,7 @@ const ApiKeyListItem = ({
showToast(t("api_key_deleted"), "success");
},
onError(err) {
- console.log(err);
+ console.error(err);
showToast(t("something_went_wrong"), "error");
},
});
diff --git a/packages/features/ee/organizations/pages/settings/delegationCredential.tsx b/packages/features/ee/organizations/pages/settings/delegationCredential.tsx
index 81989cf882..c448b2e810 100644
--- a/packages/features/ee/organizations/pages/settings/delegationCredential.tsx
+++ b/packages/features/ee/organizations/pages/settings/delegationCredential.tsx
@@ -174,7 +174,7 @@ function CreateDelegationDialog({
serviceAccountKey: validatedKey.data,
});
} catch (e) {
- console.log("error", e);
+ console.error(e);
form.setError("serviceAccountKey", { message: t("invalid_service_account_key") });
return;
}
diff --git a/packages/lib/hooks/useDebounce.tsx b/packages/lib/hooks/useDebounce.ts
similarity index 100%
rename from packages/lib/hooks/useDebounce.tsx
rename to packages/lib/hooks/useDebounce.ts
diff --git a/packages/lib/hooks/useResponsive.tsx b/packages/lib/hooks/useResponsive.ts
similarity index 100%
rename from packages/lib/hooks/useResponsive.tsx
rename to packages/lib/hooks/useResponsive.ts
diff --git a/packages/lib/hooks/useTheme.tsx b/packages/lib/hooks/useTheme.ts
similarity index 100%
rename from packages/lib/hooks/useTheme.tsx
rename to packages/lib/hooks/useTheme.ts
diff --git a/packages/lib/hooks/useTraceUpdate.tsx b/packages/lib/hooks/useTraceUpdate.ts
similarity index 85%
rename from packages/lib/hooks/useTraceUpdate.tsx
rename to packages/lib/hooks/useTraceUpdate.ts
index 7094136da0..a43ead677c 100644
--- a/packages/lib/hooks/useTraceUpdate.tsx
+++ b/packages/lib/hooks/useTraceUpdate.ts
@@ -13,9 +13,6 @@ export function useTraceUpdate(props: { [s: string]: unknown } | ArrayLike 0) {
- console.log("Changed props:", changedProps);
- }
prev.current = props;
});
}
diff --git a/packages/ui/components/form/step/FormStep.tsx b/packages/ui/components/form/step/FormStep.tsx
index 9866880b9e..b0fec7ba08 100644
--- a/packages/ui/components/form/step/FormStep.tsx
+++ b/packages/ui/components/form/step/FormStep.tsx
@@ -16,7 +16,6 @@ function FormStep({ currentStep, steps }: Props) {
{[...Array(steps)].map((_, j) => {
- console.log({ j, currentStep });
return (
scrollableElement.clientHeight;
- console.log({ isElementOverflowing });
setIsOverflowingY(isElementOverflowing);
}
}, []);