From a34da49486159fda28c47011cd86b5d28d21b19e Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Mon, 28 Apr 2025 19:47:47 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Replace=20eslint=20and=20p?= =?UTF-8?q?rettier=20with=20biome=20(#1697)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- .prettierrc | 9 - .vscode/settings.json | 3 + apps/docs/.eslintrc.js | 4 - apps/landing/.eslintrc.js | 4 - apps/landing/package.json | 2 - .../src/app/[locale]/blog/[slug]/page.tsx | 2 +- apps/landing/src/app/[locale]/footer.tsx | 5 +- apps/landing/src/app/[locale]/layout.tsx | 2 +- apps/landing/src/app/api/og-image/route.tsx | 59 +- .../landing/src/components/blog/post-body.tsx | 3 +- apps/landing/src/components/error-page.tsx | 2 +- apps/landing/src/components/marketing.tsx | 2 +- .../landing/src/i18n/client/i18n-provider.tsx | 2 +- apps/landing/src/lib/api.ts | 5 +- apps/web/.eslintrc.js | 4 - apps/web/declarations/next-auth.d.ts | 3 +- apps/web/next-i18next.config.js | 2 +- apps/web/next.config.js | 3 - apps/web/package.json | 2 - apps/web/src/app/[locale]/(auth)/layout.tsx | 2 +- .../login/components/login-email-form.tsx | 2 +- .../(auth)/login/components/sso-provider.tsx | 2 +- .../register/verify/components/otp-form.tsx | 2 +- .../web/src/app/[locale]/(space)/app-card.tsx | 2 +- .../components/sidebar/app-sidebar.tsx | 2 +- .../(space)/events/events-tabbed-view.tsx | 2 +- .../src/app/[locale]/(space)/polls/page.tsx | 8 +- .../(space)/polls/polls-tabbed-view.tsx | 2 +- .../app/[locale]/(space)/settings/layout.tsx | 2 +- .../components/date-time-preferences.tsx | 3 +- .../src/app/[locale]/invite/[urlId]/page.tsx | 2 +- apps/web/src/app/[locale]/layout.tsx | 6 +- .../poll/[urlId]/edit-details/page.tsx | 2 +- .../poll/[urlId]/edit-options/page.tsx | 2 +- .../src/app/[locale]/poll/[urlId]/layout.tsx | 2 +- .../src/app/[locale]/quick-create/page.tsx | 2 +- apps/web/src/app/api/og-image-poll/route.tsx | 46 +- .../portal/helpers/create-portal-session.ts | 4 +- apps/web/src/app/api/stripe/webhook/route.ts | 3 +- .../app/api/user/verify-email-change/route.ts | 5 +- apps/web/src/app/components/page-icons.tsx | 2 +- apps/web/src/app/components/search-input.tsx | 2 +- apps/web/src/app/global-error.tsx | 2 +- apps/web/src/app/posthog-page-view.tsx | 2 +- apps/web/src/auth/edge/with-auth.ts | 2 +- apps/web/src/components/clock.tsx | 5 +- apps/web/src/components/cookie-consent.tsx | 1 + apps/web/src/components/create-poll.tsx | 2 +- apps/web/src/components/date-card.tsx | 2 +- .../src/components/discussion/discussion.tsx | 7 +- apps/web/src/components/error-page.tsx | 2 +- apps/web/src/components/event-card.tsx | 2 +- apps/web/src/components/feedback.tsx | 8 +- .../date-navigation-toolbar.tsx | 2 +- .../poll-options-form/dayjs-localizer.ts | 8 +- .../month-calendar/month-calendar.tsx | 12 +- .../poll-options-form/poll-options-form.tsx | 3 +- .../forms/poll-options-form/week-calendar.tsx | 4 +- .../src/components/forms/poll-settings.tsx | 3 +- apps/web/src/components/forms/types.ts | 2 +- apps/web/src/components/invite-dialog.tsx | 4 +- .../src/components/layouts/poll-layout.tsx | 2 +- .../src/components/modal/modal-provider.tsx | 1 + apps/web/src/components/modal/modal.tsx | 2 +- .../src/components/new-participant-modal.tsx | 1 + .../src/components/participant-avatar-bar.tsx | 4 +- apps/web/src/components/poll-context.tsx | 4 +- apps/web/src/components/poll/desktop-poll.tsx | 1 + .../desktop-poll/participant-row-form.tsx | 3 +- .../poll/desktop-poll/participant-row.tsx | 7 +- .../poll/desktop-poll/poll-header.tsx | 8 +- apps/web/src/components/poll/manage-poll.tsx | 62 +- .../poll/manage-poll/delete-poll-dialog.tsx | 2 +- .../poll/manage-poll/finalize-poll-dialog.tsx | 3 + apps/web/src/components/poll/mobile-poll.tsx | 4 +- .../poll/mobile-poll/date-option.tsx | 2 +- .../poll/mobile-poll/grouped-options.tsx | 2 +- .../poll/mobile-poll/poll-option.tsx | 4 + .../poll/mobile-poll/poll-options.tsx | 4 +- .../poll/mobile-poll/time-slot-option.tsx | 2 +- .../components/poll/notifications-toggle.tsx | 4 +- .../src/components/poll/poll-view-tracker.tsx | 2 +- .../src/components/poll/scheduled-event.tsx | 2 +- .../src/components/poll/truncated-linkify.tsx | 2 +- apps/web/src/components/register-link.tsx | 2 +- apps/web/src/components/skeleton.tsx | 2 +- apps/web/src/components/steps/step.tsx | 2 +- apps/web/src/components/steps/steps.tsx | 3 +- .../components/table/table-column-header.tsx | 1 + .../web/src/components/time-format-picker.tsx | 2 + apps/web/src/components/upgrade-button.tsx | 10 - apps/web/src/components/user-provider.tsx | 4 +- .../components/vote-summary-progress-bar.tsx | 6 +- .../features/moderation/libs/ai-moderation.ts | 2 +- .../command-menu/command-global-shortcut.tsx | 11 +- .../api/get-scheduled-events.ts | 2 +- .../src/features/timezone/client/context.tsx | 5 +- .../timezone/formatted-date-time-server.tsx | 2 +- apps/web/src/features/timezone/utils.ts | 1 + apps/web/src/global-error.tsx | 2 +- apps/web/src/i18n/client.tsx | 2 +- apps/web/src/i18n/i18n.ts | 2 +- apps/web/src/next-auth.config.ts | 2 +- apps/web/src/next-auth.ts | 2 +- apps/web/src/style.css | 4 +- apps/web/src/trpc/client/provider.tsx | 4 +- apps/web/src/trpc/routers/auth.ts | 2 +- apps/web/src/trpc/routers/polls.ts | 4 +- apps/web/src/trpc/trpc.ts | 2 +- apps/web/src/types.ts | 2 +- apps/web/src/utils/color-hash.ts | 2 +- apps/web/src/utils/date-time-utils.ts | 8 +- apps/web/src/utils/get-value-by-path.ts | 2 +- apps/web/tsconfig.json | 15 +- apps/web/vitest.config.mts | 2 +- biome.json | 40 + package.json | 8 +- packages/billing/.eslintrc.js | 2 - packages/billing/package.json | 4 +- packages/database/.eslintrc.js | 4 - packages/database/index.ts | 1 + packages/database/package.json | 1 - packages/database/prisma/seed/polls.ts | 4 +- .../database/prisma/seed/scheduled-events.ts | 6 +- packages/database/prisma/seed/users.ts | 2 +- packages/emails/.eslintrc.js | 2 - packages/emails/package.json | 1 - .../emails/src/components/email-layout.tsx | 2 +- packages/emails/src/send-email.tsx | 20 +- .../src/templates/abandoned-checkout.tsx | 13 +- .../emails/src/templates/finalized-host.tsx | 2 +- .../src/templates/finalized-participant.tsx | 2 +- packages/eslint-config/.eslintrc.js | 8 - packages/eslint-config/next.js | 11 - packages/eslint-config/package.json | 19 - packages/eslint-config/preset.js | 52 - packages/eslint-config/react.js | 20 - .../languages/src/get-preferred-locale.ts | 4 +- packages/posthog/.eslintrc.js | 2 - packages/posthog/package.json | 2 - packages/ui/.eslintrc.js | 2 - packages/ui/package.json | 2 - packages/ui/src/badge.tsx | 2 +- packages/ui/src/breadcrumb.tsx | 1 - packages/ui/src/helpers/component-props.ts | 2 +- packages/ui/src/hooks/use-toast.ts | 3 + packages/ui/src/sidebar.tsx | 12 +- packages/ui/src/skeleton.tsx | 6 +- packages/ui/src/toaster.tsx | 24 +- packages/utils/.eslintrc.js | 2 - packages/utils/package.json | 1 - packages/utils/src/absolute-url.test.ts | 5 +- packages/utils/src/absolute-url.ts | 1 + packages/utils/vitest.config.mts | 2 +- pnpm-lock.yaml | 2323 +---------------- scripts/inject-version.js | 2 +- turbo.json | 6 +- 158 files changed, 450 insertions(+), 2718 deletions(-) delete mode 100644 .prettierrc delete mode 100644 apps/docs/.eslintrc.js delete mode 100644 apps/landing/.eslintrc.js delete mode 100644 apps/web/.eslintrc.js create mode 100644 biome.json delete mode 100644 packages/billing/.eslintrc.js delete mode 100644 packages/database/.eslintrc.js delete mode 100644 packages/emails/.eslintrc.js delete mode 100644 packages/eslint-config/.eslintrc.js delete mode 100644 packages/eslint-config/next.js delete mode 100644 packages/eslint-config/package.json delete mode 100644 packages/eslint-config/preset.js delete mode 100644 packages/eslint-config/react.js delete mode 100644 packages/posthog/.eslintrc.js delete mode 100644 packages/ui/.eslintrc.js delete mode 100644 packages/utils/.eslintrc.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7d3f32d1..67b78f2e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: - uses: ./.github/actions/pnpm-install - name: Check linting rules - run: pnpm lint + run: pnpm turbo check unit-tests: name: Unit tests diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 43603229a..000000000 --- a/.prettierrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "plugins": ["prettier-plugin-tailwindcss"], - "semi": true, - "tabWidth": 2, - "useTabs": false, - "trailingComma": "all", - "singleQuote": false, - "arrowParens": "always" -} diff --git a/.vscode/settings.json b/.vscode/settings.json index d2276158e..5a2f464f9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,9 @@ "editor.codeActionsOnSave": { "source.fixAll": "explicit" }, + "[javascript]": { + "editor.defaultFormatter": "biomejs.biome" + }, "typescript.tsdk": "node_modules/typescript/lib", "typescript.preferences.importModuleSpecifier": "shortest", "cSpell.words": ["Rallly", "Vella"], diff --git a/apps/docs/.eslintrc.js b/apps/docs/.eslintrc.js deleted file mode 100644 index 3d9be6e61..000000000 --- a/apps/docs/.eslintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - ...require("@rallly/eslint-config")(__dirname), -}; diff --git a/apps/landing/.eslintrc.js b/apps/landing/.eslintrc.js deleted file mode 100644 index c3b985290..000000000 --- a/apps/landing/.eslintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - ...require("@rallly/eslint-config/next")(__dirname), -}; diff --git a/apps/landing/package.json b/apps/landing/package.json index 81782847e..92fd9c65e 100644 --- a/apps/landing/package.json +++ b/apps/landing/package.json @@ -7,7 +7,6 @@ "build": "next build", "analyze": "cross-env ANALYZE=true next build", "start": "next start", - "lint": "eslint .", "type-check": "tsc --pretty --noEmit", "i18n:scan": "i18next-scanner --config i18next-scanner.config.js" }, @@ -41,7 +40,6 @@ }, "devDependencies": { "@next/bundle-analyzer": "^14.2.25", - "@rallly/eslint-config": "workspace:*", "@rallly/tsconfig": "workspace:*", "@types/color-hash": "^1.0.2", "@types/lodash": "^4.14.178", diff --git a/apps/landing/src/app/[locale]/blog/[slug]/page.tsx b/apps/landing/src/app/[locale]/blog/[slug]/page.tsx index 273bd7207..e174861b2 100644 --- a/apps/landing/src/app/[locale]/blog/[slug]/page.tsx +++ b/apps/landing/src/app/[locale]/blog/[slug]/page.tsx @@ -1,8 +1,8 @@ import { absoluteUrl } from "@rallly/utils/absolute-url"; import { ArrowLeftIcon } from "lucide-react"; +import { MDXRemote } from "next-mdx-remote/rsc"; import Image from "next/image"; import Link from "next/link"; -import { MDXRemote } from "next-mdx-remote/rsc"; import PostHeader from "@/components/blog/post-header"; import { getAllPosts, getPostBySlug } from "@/lib/api"; diff --git a/apps/landing/src/app/[locale]/footer.tsx b/apps/landing/src/app/[locale]/footer.tsx index 450ee6bc0..a4e84d14b 100644 --- a/apps/landing/src/app/[locale]/footer.tsx +++ b/apps/landing/src/app/[locale]/footer.tsx @@ -13,7 +13,7 @@ import { LanguagesIcon } from "lucide-react"; import Image from "next/image"; import Link from "next/link"; import { usePathname, useRouter } from "next/navigation"; -import * as React from "react"; +import type * as React from "react"; import DiscordIcon from "@/assets/discord.svg"; import GithubIcon from "@/assets/github.svg"; @@ -301,6 +301,7 @@ export const Footer: React.FunctionComponent = () => { target="_blank" href="https://vercel.com?utm_source=rallly&utm_campaign=oss" className="inline-block text-white" + rel="noreferrer" > { target="_blank" className="inline-block" href="/partners/digitalocean" + rel="noreferrer" > { target="_blank" className="inline-block" href="https://sentry.io" + rel="noreferrer" > -
-
-
- Rallly -
- Blog -
+
+
+
+
+ Rallly +
+ Blog
-

- {title} -

- {excerpt ? ( -

{excerpt}

- ) : null}
+

+ {title} +

+ {excerpt ? ( +

{excerpt}

+ ) : null}
- ), +
, { width: 1200, height: 630, diff --git a/apps/landing/src/components/blog/post-body.tsx b/apps/landing/src/components/blog/post-body.tsx index c913e7772..4c4d43339 100644 --- a/apps/landing/src/components/blog/post-body.tsx +++ b/apps/landing/src/components/blog/post-body.tsx @@ -7,7 +7,8 @@ type Props = { const PostBody = ({ content }: Props) => { return (
); diff --git a/apps/landing/src/components/error-page.tsx b/apps/landing/src/components/error-page.tsx index 86ad294f2..f8ccb7559 100644 --- a/apps/landing/src/components/error-page.tsx +++ b/apps/landing/src/components/error-page.tsx @@ -3,7 +3,7 @@ import { Button } from "@rallly/ui/button"; import { FileSearchIcon } from "lucide-react"; import Link from "next/link"; -import * as React from "react"; +import type * as React from "react"; import { useTranslation } from "@/i18n/client/use-translation"; diff --git a/apps/landing/src/components/marketing.tsx b/apps/landing/src/components/marketing.tsx index ac843bea7..1f7ac8cac 100644 --- a/apps/landing/src/components/marketing.tsx +++ b/apps/landing/src/components/marketing.tsx @@ -3,7 +3,7 @@ import { ArrowUpRight } from "lucide-react"; import * as m from "motion/react-m"; import Image from "next/image"; import Link from "next/link"; -import React from "react"; +import type React from "react"; import { Trans } from "@/i18n/client/trans"; diff --git a/apps/landing/src/i18n/client/i18n-provider.tsx b/apps/landing/src/i18n/client/i18n-provider.tsx index b60784e30..be14e9d54 100644 --- a/apps/landing/src/i18n/client/i18n-provider.tsx +++ b/apps/landing/src/i18n/client/i18n-provider.tsx @@ -2,7 +2,7 @@ import i18next from "i18next"; import ICU from "i18next-icu"; import resourcesToBackend from "i18next-resources-to-backend"; -import React from "react"; +import type React from "react"; import { I18nextProvider, initReactI18next } from "react-i18next"; import { useAsync } from "react-use"; diff --git a/apps/landing/src/lib/api.ts b/apps/landing/src/lib/api.ts index cc43534a2..acf8fdaad 100644 --- a/apps/landing/src/lib/api.ts +++ b/apps/landing/src/lib/api.ts @@ -1,6 +1,6 @@ -import fs from "fs"; +import fs from "node:fs"; +import { join } from "node:path"; import matter from "gray-matter"; -import { join } from "path"; const postsDirectory = join(process.cwd(), "src", "posts"); @@ -21,6 +21,7 @@ export function getPostBySlug(slug: string, fields: string[] = []) { const items: Items = {}; // Ensure only the minimal needed data is exposed + // biome-ignore lint/complexity/noForEach: Fix this later fields.forEach((field) => { if (field === "slug") { items[field] = realSlug; diff --git a/apps/web/.eslintrc.js b/apps/web/.eslintrc.js deleted file mode 100644 index c3b985290..000000000 --- a/apps/web/.eslintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - ...require("@rallly/eslint-config/next")(__dirname), -}; diff --git a/apps/web/declarations/next-auth.d.ts b/apps/web/declarations/next-auth.d.ts index facea5619..366f2fe83 100644 --- a/apps/web/declarations/next-auth.d.ts +++ b/apps/web/declarations/next-auth.d.ts @@ -1,10 +1,9 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ import type { TimeFormat } from "@rallly/database"; -import type { NextRequest } from "next/server"; import type { DefaultSession, DefaultUser } from "next-auth"; import NextAuth from "next-auth"; import type { DefaultJWT } from "next-auth/jwt"; import { JWT } from "next-auth/jwt"; +import type { NextRequest } from "next/server"; declare module "next-auth" { /** diff --git a/apps/web/next-i18next.config.js b/apps/web/next-i18next.config.js index 8423aef44..46c9b0c51 100644 --- a/apps/web/next-i18next.config.js +++ b/apps/web/next-i18next.config.js @@ -1,5 +1,5 @@ const ICU = require("i18next-icu/i18nextICU.js"); -const path = require("path"); +const path = require("node:path"); const i18n = require("./i18n.config.js"); module.exports = { diff --git a/apps/web/next.config.js b/apps/web/next.config.js index f9475605b..2af869c62 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -28,9 +28,6 @@ const nextConfig = { return config; }, - eslint: { - ignoreDuringBuilds: true, - }, typescript: { ignoreBuildErrors: true, }, diff --git a/apps/web/package.json b/apps/web/package.json index 684669cd3..afdf919fa 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -8,7 +8,6 @@ "build:test": "NODE_ENV=test next build", "analyze": "cross-env ANALYZE=true next build", "start": "next start", - "lint": "eslint .", "type-check": "tsc --pretty --noEmit", "i18n:scan": "i18next-scanner --config i18next-scanner.config.js", "test:integration": "NODE_ENV=test playwright test", @@ -96,7 +95,6 @@ "devDependencies": { "@babel/core": "^7.26.10", "@playwright/test": "^1.49.1", - "@rallly/eslint-config": "workspace:*", "@rallly/tsconfig": "workspace:*", "@types/color-hash": "^1.0.2", "@types/js-cookie": "^3.0.1", diff --git a/apps/web/src/app/[locale]/(auth)/layout.tsx b/apps/web/src/app/[locale]/(auth)/layout.tsx index 940d6702d..989ae6acb 100644 --- a/apps/web/src/app/[locale]/(auth)/layout.tsx +++ b/apps/web/src/app/[locale]/(auth)/layout.tsx @@ -2,9 +2,9 @@ import { cn } from "@rallly/ui"; import { DotPattern } from "@rallly/ui/dot-pattern"; import { - isQuickCreateEnabled, QuickCreateButton, QuickCreateWidget, + isQuickCreateEnabled, } from "@/features/quick-create"; export default async function Layout({ diff --git a/apps/web/src/app/[locale]/(auth)/login/components/login-email-form.tsx b/apps/web/src/app/[locale]/(auth)/login/components/login-email-form.tsx index 5c8a26920..3a41369fe 100644 --- a/apps/web/src/app/[locale]/(auth)/login/components/login-email-form.tsx +++ b/apps/web/src/app/[locale]/(auth)/login/components/login-email-form.tsx @@ -10,8 +10,8 @@ import { FormMessage, } from "@rallly/ui/form"; import { Input } from "@rallly/ui/input"; -import { useRouter, useSearchParams } from "next/navigation"; import { signIn } from "next-auth/react"; +import { useRouter, useSearchParams } from "next/navigation"; import React from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; diff --git a/apps/web/src/app/[locale]/(auth)/login/components/sso-provider.tsx b/apps/web/src/app/[locale]/(auth)/login/components/sso-provider.tsx index 7c7c3e84c..8c7b841fb 100644 --- a/apps/web/src/app/[locale]/(auth)/login/components/sso-provider.tsx +++ b/apps/web/src/app/[locale]/(auth)/login/components/sso-provider.tsx @@ -2,8 +2,8 @@ import { Button } from "@rallly/ui/button"; import { Icon } from "@rallly/ui/icon"; import { UserIcon } from "lucide-react"; -import Image from "next/image"; import { signIn } from "next-auth/react"; +import Image from "next/image"; import { Trans } from "@/components/trans"; import { useTranslation } from "@/i18n/client"; diff --git a/apps/web/src/app/[locale]/(auth)/register/verify/components/otp-form.tsx b/apps/web/src/app/[locale]/(auth)/register/verify/components/otp-form.tsx index eec3725a9..a6f326b7b 100644 --- a/apps/web/src/app/[locale]/(auth)/register/verify/components/otp-form.tsx +++ b/apps/web/src/app/[locale]/(auth)/register/verify/components/otp-form.tsx @@ -10,8 +10,8 @@ import { FormItem, FormMessage, } from "@rallly/ui/form"; -import { useSearchParams } from "next/navigation"; import { signIn } from "next-auth/react"; +import { useSearchParams } from "next/navigation"; import { useForm } from "react-hook-form"; import { z } from "zod"; diff --git a/apps/web/src/app/[locale]/(space)/app-card.tsx b/apps/web/src/app/[locale]/(space)/app-card.tsx index ad754bc54..89c62cc7e 100644 --- a/apps/web/src/app/[locale]/(space)/app-card.tsx +++ b/apps/web/src/app/[locale]/(space)/app-card.tsx @@ -1,6 +1,6 @@ import { cn } from "@rallly/ui"; import { BarChart2Icon } from "lucide-react"; -import React from "react"; +import type React from "react"; export function AppCard({ children, diff --git a/apps/web/src/app/[locale]/(space)/components/sidebar/app-sidebar.tsx b/apps/web/src/app/[locale]/(space)/components/sidebar/app-sidebar.tsx index 3dddf7a04..89fc84139 100644 --- a/apps/web/src/app/[locale]/(space)/components/sidebar/app-sidebar.tsx +++ b/apps/web/src/app/[locale]/(space)/components/sidebar/app-sidebar.tsx @@ -18,7 +18,7 @@ import { SparklesIcon, } from "lucide-react"; import Link from "next/link"; -import * as React from "react"; +import type * as React from "react"; import { LogoLink } from "@/app/components/logo-link"; import { Trans } from "@/components/trans"; diff --git a/apps/web/src/app/[locale]/(space)/events/events-tabbed-view.tsx b/apps/web/src/app/[locale]/(space)/events/events-tabbed-view.tsx index 65a7cc4e4..24cb4014f 100644 --- a/apps/web/src/app/[locale]/(space)/events/events-tabbed-view.tsx +++ b/apps/web/src/app/[locale]/(space)/events/events-tabbed-view.tsx @@ -19,7 +19,7 @@ export function EventsTabbedView({ children }: { children: React.ReactNode }) { const newUrl = `?${params.toString()}`; router.replace(newUrl, { scroll: false }); }, - [name, router, searchParams], + [router, searchParams], ); const value = searchParams.get(name) ?? "upcoming"; diff --git a/apps/web/src/app/[locale]/(space)/polls/page.tsx b/apps/web/src/app/[locale]/(space)/polls/page.tsx index 70846990a..000e3d745 100644 --- a/apps/web/src/app/[locale]/(space)/polls/page.tsx +++ b/apps/web/src/app/[locale]/(space)/polls/page.tsx @@ -37,8 +37,8 @@ const pageSchema = z .nullish() .transform((val) => { if (!val) return 1; - const parsed = parseInt(val, 10); - return isNaN(parsed) || parsed < 1 ? 1 : parsed; + const parsed = Number.parseInt(val, 10); + return Number.isNaN(parsed) || parsed < 1 ? 1 : parsed; }); const querySchema = z @@ -56,8 +56,8 @@ const pageSizeSchema = z .nullish() .transform((val) => { if (!val) return DEFAULT_PAGE_SIZE; - const parsed = parseInt(val, 10); - return isNaN(parsed) || parsed < 1 + const parsed = Number.parseInt(val, 10); + return Number.isNaN(parsed) || parsed < 1 ? DEFAULT_PAGE_SIZE : Math.min(parsed, 100); }); diff --git a/apps/web/src/app/[locale]/(space)/polls/polls-tabbed-view.tsx b/apps/web/src/app/[locale]/(space)/polls/polls-tabbed-view.tsx index 761c74a09..1dcd52944 100644 --- a/apps/web/src/app/[locale]/(space)/polls/polls-tabbed-view.tsx +++ b/apps/web/src/app/[locale]/(space)/polls/polls-tabbed-view.tsx @@ -19,7 +19,7 @@ export function PollsTabbedView({ children }: { children: React.ReactNode }) { const newUrl = `?${params.toString()}`; router.replace(newUrl, { scroll: false }); }, - [name, router, searchParams], + [router, searchParams], ); const value = searchParams.get(name) ?? "live"; diff --git a/apps/web/src/app/[locale]/(space)/settings/layout.tsx b/apps/web/src/app/[locale]/(space)/settings/layout.tsx index db6c56f2c..3dd669049 100644 --- a/apps/web/src/app/[locale]/(space)/settings/layout.tsx +++ b/apps/web/src/app/[locale]/(space)/settings/layout.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import type React from "react"; import { SettingsPageIcon } from "@/app/components/page-icons"; import { diff --git a/apps/web/src/app/[locale]/(space)/settings/preferences/components/date-time-preferences.tsx b/apps/web/src/app/[locale]/(space)/settings/preferences/components/date-time-preferences.tsx index 8f57269cf..6ee376f69 100644 --- a/apps/web/src/app/[locale]/(space)/settings/preferences/components/date-time-preferences.tsx +++ b/apps/web/src/app/[locale]/(space)/settings/preferences/components/date-time-preferences.tsx @@ -96,7 +96,7 @@ const DateTimePreferencesForm = () => {