diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 10ed6b68ef..e2a7853665 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -30,7 +30,10 @@ jobs: if: steps.yarn-cache.outputs.cache-hit != 'true' run: yarn --frozen-lockfile - - name: Lint + - name: Test Code Linting + run: yarn lint + + - name: Save Code Linting Reports run: yarn lint:report continue-on-error: true diff --git a/packages/app-store/BookingPageTagManager.tsx b/packages/app-store/BookingPageTagManager.tsx index e2eb311726..d22f1c5312 100644 --- a/packages/app-store/BookingPageTagManager.tsx +++ b/packages/app-store/BookingPageTagManager.tsx @@ -1,17 +1,19 @@ import Script from "next/script"; import { getEventTypeAppData } from "@calcom/app-store/utils"; + import { trackingApps } from "./eventTypeAnalytics"; -export type AppScript = {attrs?: Record} & ({src: undefined, content?: string} | {src?: string, content:undefined}) +export type AppScript = { attrs?: Record } & ( + | { src: undefined; content?: string } + | { src?: string; content: undefined } +); export default function BookingPageTagManager({ eventType, }: { eventType: Parameters[0]; }) { - - return ( <> {Object.entries(trackingApps).map(([appId, scriptConfig]) => { @@ -19,22 +21,32 @@ export default function BookingPageTagManager({ if (!trackingId) { return null; } - const parseValue = (val: T ):T => val ? val.replace(/\{TRACKING_ID\}/g, trackingId) as T : val - - return scriptConfig.scripts.map((script, index)=>{ + const parseValue = (val: T): T => + val ? (val.replace(/\{TRACKING_ID\}/g, trackingId) as T) : val; + + return scriptConfig.scripts.map((script, index) => { const parsedAttributes: NonNullable = {}; const attrs = script.attrs || {}; Object.entries(attrs).forEach(([name, value]) => { if (typeof value === "string") { - value = parseValue(value) + value = parseValue(value); } parsedAttributes[name] = value; }); - - return