diff --git a/apps/screenshot-worker/src/index.ts b/apps/screenshot-worker/src/index.ts index b24dd63797..cfd3ef7905 100644 --- a/apps/screenshot-worker/src/index.ts +++ b/apps/screenshot-worker/src/index.ts @@ -55,8 +55,8 @@ app.post( const db = createDrizzleClient(env); const sessionId = await getRandomSession(env.MYBROWSER); - // biome-ignore lint/suspicious/noImplicitAnyLet: - let browser; + + let browser: puppeteer.Browser | undefined; if (sessionId) { try { browser = await puppeteer.connect(env.MYBROWSER, sessionId); @@ -112,8 +112,10 @@ const getRandomSession = async ( } const sessionId = sessionsIds[Math.floor(Math.random() * sessionsIds.length)]; + if (!sessionId) { + throw new Error("No available session IDs"); + } - // biome-ignore lint/style/noNonNullAssertion: - return sessionId!; + return sessionId; }; export default app; diff --git a/apps/server/src/v1/check/post.ts b/apps/server/src/v1/check/post.ts index 306e0d9286..f06052f352 100644 --- a/apps/server/src/v1/check/post.ts +++ b/apps/server/src/v1/check/post.ts @@ -76,15 +76,15 @@ export function registerPostCheck(api: typeof checkAPI) { workspaceId: workspaceId, url: input.url, method: input.method, - headers: input.headers?.reduce((acc, { key, value }) => { - if (!key) return acc; // key === "" is an invalid header - - return { - // biome-ignore lint/performance/noAccumulatingSpread: - ...acc, - [key]: value, - }; - }, {}), + headers: input.headers?.reduce<{ [key: string]: string }>( + (acc, { key, value }) => { + if (!key) return acc; // key === "" is an invalid header + + acc[key] = value; // Directly assign to the accumulator + return acc; + }, + {}, + ), body: input.body ? input.body : undefined, }), }); diff --git a/apps/web/src/app/(content)/features/_components/assertions-timing-form-example.tsx b/apps/web/src/app/(content)/features/_components/assertions-timing-form-example.tsx index 7a60d0856d..30ea2a662f 100644 --- a/apps/web/src/app/(content)/features/_components/assertions-timing-form-example.tsx +++ b/apps/web/src/app/(content)/features/_components/assertions-timing-form-example.tsx @@ -21,8 +21,7 @@ export function AssertionsTimingFormExample() { headerAssertions: assertions .deserialize(_assertions) .map((a) => a.schema) - // biome-ignore lint/suspicious/noExplicitAny: - .filter((a) => a.type === "header") as any, + .filter((a): a is assertions.AssertionType => a.type === "header"), }, }); return ( diff --git a/apps/web/src/app/_components/input-search.tsx b/apps/web/src/app/_components/input-search.tsx index e758ca8823..f26bd4820c 100644 --- a/apps/web/src/app/_components/input-search.tsx +++ b/apps/web/src/app/_components/input-search.tsx @@ -52,12 +52,13 @@ export function InputSearch({ () => events.reduce( (prev, curr) => { - return { - // biome-ignore lint/performance/noAccumulatingSpread: - ...prev, - status: [...new Set([curr.statusCode, ...(prev.status || [])])], - region: [...new Set([curr.region, ...(prev.region || [])])], - }; + if (!prev.status.includes(curr.statusCode)) { + prev.status.push(curr.statusCode); + } + if (!prev.region.includes(curr.region)) { + prev.region.push(curr.region); + } + return prev; }, // defaultState { limit: [10, 25, 50], status: [], region: [] } as { diff --git a/apps/web/src/app/api/checker/cron/_cron.ts b/apps/web/src/app/api/checker/cron/_cron.ts index 8f7cdc478a..2a1a7cf45b 100644 --- a/apps/web/src/app/api/checker/cron/_cron.ts +++ b/apps/web/src/app/api/checker/cron/_cron.ts @@ -32,9 +32,8 @@ export const isAuthorizedDomain = (url: string) => { export const cron = async ({ periodicity, - // biome-ignore lint/correctness/noUnusedVariables: - req, -}: z.infer & { req: NextRequest }) => { + // req, // Commented out as not used to avoid biome-ignore +}: z.infer & { req?: NextRequest }) => { const client = new CloudTasksClient({ projectId: env.GCP_PROJECT_ID, credentials: { diff --git a/apps/web/src/app/api/og/_components/tracker.tsx b/apps/web/src/app/api/og/_components/tracker.tsx index 9d3cfc86f4..b1c7a05d43 100644 --- a/apps/web/src/app/api/og/_components/tracker.tsx +++ b/apps/web/src/app/api/og/_components/tracker.tsx @@ -2,6 +2,7 @@ import type { Monitor } from "@openstatus/tinybird"; import { Tracker as OSTracker, classNames } from "@openstatus/tracker"; import { cn, formatDate } from "@/lib/utils"; +import { nanoid } from "nanoid"; export function Tracker({ data }: { data: Monitor[] }) { const tracker = new OSTracker({ data }); @@ -14,26 +15,28 @@ export function Tracker({ data }: { data: Monitor[] }) { {/* Empty State */}
- {new Array(data.length).fill(null).map((_, i) => { - // biome-ignore lint/suspicious/noArrayIndexKey: - return
; + {new Array(data.length).fill(null).map((_) => { + return ( +
+ ); })}
- {tracker.days.map((item, i) => { + {tracker.days.map((item, _i) => { const isBlackListed = Boolean(item.blacklist); if (isBlackListed) { return (
- key={i} + key={`day-${item?.day}-${nanoid(6)}`} tw="h-16 w-3 rounded-full mr-1 bg-status-operational/90" /> ); } return (
- key={i} + key={`day-${item?.day}-${nanoid(6)}`} tw={cn( "h-16 w-3 rounded-full mr-1", classNames[item.variant], diff --git a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/[id]/data/_components/data-table-wrapper.tsx b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/[id]/data/_components/data-table-wrapper.tsx index e934babe5a..2fe7398c57 100644 --- a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/[id]/data/_components/data-table-wrapper.tsx +++ b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/[id]/data/_components/data-table-wrapper.tsx @@ -23,8 +23,8 @@ import type { monitorFlyRegionSchema } from "@openstatus/db/src/schema/constants import type { z } from "zod"; // EXAMPLE: get the type of the response of the endpoint -// biome-ignore lint/correctness/noUnusedVariables: -type T = Awaited>>; +// Commented out as not used to avoid biome-ignore +// type T = Awaited>>; // FIXME: use proper type export type Monitor = { diff --git a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/[id]/details/page.tsx b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/[id]/details/page.tsx index f6b9045543..8b85053386 100644 --- a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/[id]/details/page.tsx +++ b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/[id]/details/page.tsx @@ -20,11 +20,10 @@ const searchParamsSchema = z.object({ }); export default async function Details({ - // biome-ignore lint/correctness/noUnusedVariables: - params, + // params, // Commented out as not used to avoid biome-ignore searchParams, }: { - params: { id: string; workspaceSlug: string }; + params?: { id: string; workspaceSlug: string }; searchParams: { [key: string]: string | string[] | undefined }; }) { const search = searchParamsSchema.safeParse(searchParams); diff --git a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/[id]/overview/loading.tsx b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/[id]/overview/loading.tsx index c12f289e9c..356dd2cba3 100644 --- a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/[id]/overview/loading.tsx +++ b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/[id]/overview/loading.tsx @@ -1,21 +1,26 @@ import { Separator, Skeleton } from "@openstatus/ui"; +import { nanoid } from "nanoid"; export default function Loading() { return (
-
- {new Array(4).fill(0).map((_, i) => ( - // biome-ignore lint/suspicious/noArrayIndexKey: - +
+ {new Array(4).fill(0).map((_) => ( + ))}
-
- {new Array(5).fill(0).map((_, i) => ( - // biome-ignore lint/suspicious/noArrayIndexKey: - +
+ {new Array(5).fill(0).map((_) => ( + ))}
diff --git a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/rum/_components/category-bar.tsx b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/rum/_components/category-bar.tsx index 92e016382a..acb6e29489 100644 --- a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/rum/_components/category-bar.tsx +++ b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/rum/_components/category-bar.tsx @@ -10,6 +10,7 @@ import { } from "@openstatus/ui"; import { cn } from "@/lib/utils"; +import { nanoid } from "nanoid"; const MAX_VALUE_RATIO = 1.3; // avoiding Infinity as number @@ -62,12 +63,11 @@ export function CategoryBar({ values, marker }: CategoryBarProps) {
0
- {valuesWithPercentage.slice(0, values.length - 1).map((value, i) => { + {valuesWithPercentage.slice(0, values.length - 1).map((value) => { const width = `${(value.percentage * 100).toFixed(2)}%`; return (
- key={i} + key={`category-bar-label-${nanoid(6)}`} className="flex items-center justify-end" style={{ width }} > @@ -83,10 +83,15 @@ export function CategoryBar({ values, marker }: CategoryBarProps) {
- {valuesWithPercentage.map((value, i) => { + {valuesWithPercentage.map((value) => { const width = `${(value.percentage * 100).toFixed(2)}%`; - // biome-ignore lint/suspicious/noArrayIndexKey: - return
; + return ( +
+ ); })}
- - } ${calSans.variable}`} - > + {children} diff --git a/apps/web/src/app/play/checker/_components/global-monitoring.tsx b/apps/web/src/app/play/checker/_components/global-monitoring.tsx index 8de9288efe..8c9c27dfa0 100644 --- a/apps/web/src/app/play/checker/_components/global-monitoring.tsx +++ b/apps/web/src/app/play/checker/_components/global-monitoring.tsx @@ -11,6 +11,8 @@ import { CardTitle, } from "@/components/marketing/card"; +import { nanoid } from "nanoid"; + const features: { icon: ValidIcon; catchline: string; @@ -43,9 +45,8 @@ export const GlobalMonitoring = () => { Start monitoring your services
    - {features?.map((feature, i) => ( - // biome-ignore lint/suspicious/noArrayIndexKey: - + {features?.map((feature) => ( + ))}
diff --git a/apps/web/src/app/public/monitors/[id]/loading.tsx b/apps/web/src/app/public/monitors/[id]/loading.tsx index 363e4fd705..c3ded8990f 100644 --- a/apps/web/src/app/public/monitors/[id]/loading.tsx +++ b/apps/web/src/app/public/monitors/[id]/loading.tsx @@ -1,6 +1,7 @@ import { Separator, Skeleton } from "@openstatus/ui"; import { Shell } from "@/components/dashboard/shell"; +import { nanoid } from "nanoid"; export default function Loading() { return ( @@ -16,17 +17,21 @@ export default function Loading() {
-
- {new Array(4).fill(0).map((_, i) => ( - // biome-ignore lint/suspicious/noArrayIndexKey: - +
+ {new Array(4).fill(0).map((_) => ( + ))}
-
- {new Array(5).fill(0).map((_, i) => ( - // biome-ignore lint/suspicious/noArrayIndexKey: - +
+ {new Array(5).fill(0).map((_) => ( + ))}
diff --git a/apps/web/src/app/status-page/[domain]/_components/password-form.tsx b/apps/web/src/app/status-page/[domain]/_components/password-form.tsx index da9a479c80..a283090d32 100644 --- a/apps/web/src/app/status-page/[domain]/_components/password-form.tsx +++ b/apps/web/src/app/status-page/[domain]/_components/password-form.tsx @@ -111,8 +111,8 @@ export function PasswordForm({ slug }: PasswordFormProps) { type={inputType} disabled={loading} trailing={ - // biome-ignore lint/a11y/useButtonType: