♻️ Update eslint config (#1424)

This commit is contained in:
Luke Vella 2024-11-02 11:50:09 +00:00 committed by GitHub
parent 01396b6129
commit d55131c2ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
162 changed files with 337 additions and 266 deletions

View file

@ -1,4 +1,4 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
...require("@rallly/eslint-config")(__dirname),
...require("@rallly/eslint-config/next")(__dirname),
};

View file

@ -1,9 +1,9 @@
import "react-i18next";
import blog from "../public/locales/en/blog.json";
import common from "../public/locales/en/common.json";
import home from "../public/locales/en/home.json";
import pricing from "../public/locales/en/pricing.json";
import type blog from "../public/locales/en/blog.json";
import type common from "../public/locales/en/common.json";
import type home from "../public/locales/en/home.json";
import type pricing from "../public/locales/en/pricing.json";
interface I18nNamespaces {
common: typeof common;

View file

@ -21,6 +21,7 @@ const nextConfig = {
"@rallly/icons",
"@rallly/ui",
"@rallly/tailwind-config",
"@rallly/utils",
"next-mdx-remote",
],
webpack(config) {

View file

@ -18,6 +18,7 @@
"@rallly/languages": "*",
"@rallly/tailwind-config": "*",
"@rallly/ui": "*",
"@rallly/utils": "*",
"@svgr/webpack": "^6.5.1",
"@vercel/analytics": "^0.1.8",
"accept-language-parser": "^1.5.0",

View file

@ -1,3 +1,4 @@
import { absoluteUrl } from "@rallly/utils/absolute-url";
import { ArrowLeftIcon } from "lucide-react";
import Image from "next/image";
import Link from "next/link";
@ -5,7 +6,6 @@ import { MDXRemote } from "next-mdx-remote/rsc";
import PostHeader from "@/components/blog/post-header";
import { getAllPosts, getPostBySlug } from "@/lib/api";
import { absoluteUrl } from "@/utils/absolute-url";
export default async function Page({ params }: { params: { slug: string } }) {
const post = getPostBySlug(params.slug, [

View file

@ -11,7 +11,7 @@ import {
} from "@rallly/ui/dropdown-menu";
import { Analytics } from "@vercel/analytics/react";
import { ChevronRightIcon, MenuIcon } from "lucide-react";
import { Viewport } from "next";
import type { Viewport } from "next";
import Image from "next/image";
import Link from "next/link";
import { Trans } from "react-i18next/TransWithoutContext";

View file

@ -1,4 +1,4 @@
import { TFunction } from "i18next";
import type { TFunction } from "i18next";
import { TrendingUpIcon } from "lucide-react";
import Link from "next/link";
import { Trans } from "react-i18next/TransWithoutContext";

View file

@ -1,8 +1,8 @@
import { supportedLngs } from "@rallly/languages";
import { absoluteUrl } from "@rallly/utils/absolute-url";
import type { MetadataRoute } from "next";
import { getAllPosts } from "@/lib/api";
import { absoluteUrl } from "@/utils/absolute-url";
const alternateLanguages = supportedLngs.filter((lng) => lng !== "en");

View file

@ -1,5 +1,5 @@
import { prisma } from "@rallly/database";
import { TFunction } from "i18next";
import type { TFunction } from "i18next";
import {
CalendarCheck2Icon,
LanguagesIcon,

View file

@ -1,5 +1,6 @@
"use client";
import i18next, { Namespace } from "i18next";
import type { Namespace } from "i18next";
import i18next from "i18next";
import ICU from "i18next-icu";
import resourcesToBackend from "i18next-resources-to-backend";
import React from "react";

View file

@ -1,4 +1,5 @@
import { createInstance, Namespace } from "i18next";
import type { Namespace } from "i18next";
import { createInstance } from "i18next";
import ICU from "i18next-icu";
import resourcesToBackend from "i18next-resources-to-backend";
import { initReactI18next } from "react-i18next/initReactI18next";

View file

@ -1,5 +1,5 @@
import allLanguages from "@rallly/languages";
import { InitOptions } from "i18next";
import type { InitOptions } from "i18next";
export const fallbackLng = "en";
export const languages = Object.keys(allLanguages);

View file

@ -1,6 +1,7 @@
import { supportedLngs } from "@rallly/languages";
import languageParser from "accept-language-parser";
import { NextRequest, NextResponse } from "next/server";
import type { NextRequest} from "next/server";
import { NextResponse } from "next/server";
export async function getLocaleFromHeader(req: NextRequest) {
const headers = req.headers;

View file

@ -1,6 +1,6 @@
/* eslint-disable @next/next/no-img-element */
import { ImageResponse } from "next/og";
import { NextRequest } from "next/server";
import type { NextRequest } from "next/server";
export const config = {
runtime: "edge",

View file

@ -1,5 +1,5 @@
import { NextPage } from "next";
import React from "react";
import type { NextPage } from "next";
import type React from "react";
export type ReactTag = keyof JSX.IntrinsicElements;

View file

@ -1,30 +0,0 @@
const port = process.env.PORT || 3000;
const getVercelUrl = () => {
return process.env.NEXT_PUBLIC_VERCEL_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
: null;
};
function joinPath(baseUrl: string, subpath = "") {
if (subpath) {
const url = new URL(subpath, baseUrl);
return url.href;
}
return baseUrl;
}
export function absoluteUrl(subpath = "", query?: Record<string, string>) {
const queryString = query
? `?${Object.entries(query)
.map(([key, value]) => `${key}=${encodeURIComponent(value)}`)
.join("&")}`
: "";
const baseUrl =
process.env.NEXT_PUBLIC_BASE_URL ??
getVercelUrl() ??
`http://localhost:${port}`;
return joinPath(baseUrl, subpath) + queryString;
}

View file

@ -1,4 +1,4 @@
import { GetStaticProps } from "next";
import type { GetStaticProps } from "next";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
export const getStaticTranslations =

View file

@ -3,23 +3,12 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
],
"~/*": [
"public/*"
]
"@/*": ["src/*"],
"~/*": ["public/*"],
},
"checkJs": false,
"strictNullChecks": true
"strictNullChecks": true,
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"],
}

View file

@ -1,4 +1,4 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
...require("@rallly/eslint-config")(__dirname),
...require("@rallly/eslint-config/next")(__dirname),
};

View file

@ -1,8 +1,8 @@
import "i18next";
import emails from "@rallly/emails/locales/emails.json";
import type emails from "@rallly/emails/locales/emails.json";
import app from "../public/locales/en/app.json";
import type app from "../public/locales/en/app.json";
interface I18nNamespaces {
app: typeof app;

View file

@ -1,8 +1,10 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import type { TimeFormat } from "@rallly/database";
import { extend } from "lodash";
import NextAuth, { DefaultSession, DefaultUser } from "next-auth";
import { DefaultJWT, JWT } from "next-auth/jwt";
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";
declare module "next-auth" {
/**

View file

@ -1,5 +1,6 @@
import { loadEnvConfig } from "@next/env";
import { devices, PlaywrightTestConfig } from "@playwright/test";
import type { PlaywrightTestConfig } from "@playwright/test";
import { devices } from "@playwright/test";
const ci = process.env.CI === "true";

View file

@ -4,7 +4,7 @@ import { Card, CardContent } from "@rallly/ui/card";
import { getCoreRowModel, useReactTable } from "@tanstack/react-table";
import dayjs from "dayjs";
import { ScheduledEvent } from "@/app/[locale]/(admin)/events/types";
import type { ScheduledEvent } from "@/app/[locale]/(admin)/events/types";
import { Trans } from "@/components/trans";
import { generateGradient } from "@/utils/color-hash";
import { useDayjs } from "@/utils/dayjs";

View file

@ -1,5 +1,5 @@
import { UserScheduledEvents } from "@/app/[locale]/(admin)/events/user-scheduled-events";
import { Params } from "@/app/[locale]/types";
import type { Params } from "@/app/[locale]/types";
import {
PageContainer,
PageContent,

View file

@ -4,7 +4,7 @@ import { cn } from "@rallly/ui";
import { Link } from "lucide-react";
import { usePathname } from "next/navigation";
import { IconComponent } from "@/types";
import type { IconComponent } from "@/types";
export function MenuItem({
href,

View file

@ -1,7 +1,7 @@
import { Trans } from "react-i18next/TransWithoutContext";
import { Sidebar } from "@/app/[locale]/(admin)/sidebar";
import { Params } from "@/app/[locale]/types";
import type { Params } from "@/app/[locale]/types";
import {
PageContainer,
PageContent,

View file

@ -2,7 +2,7 @@ import { HomeIcon } from "lucide-react";
import { Trans } from "react-i18next/TransWithoutContext";
import Dashboard from "@/app/[locale]/(admin)/dashboard";
import { Params } from "@/app/[locale]/types";
import type { Params } from "@/app/[locale]/types";
import {
PageContainer,
PageContent,

View file

@ -1,7 +1,7 @@
import { BarChart2Icon } from "lucide-react";
import { UserPolls } from "@/app/[locale]/(admin)/polls/user-polls";
import { Params } from "@/app/[locale]/types";
import type { Params } from "@/app/[locale]/types";
import {
PageContainer,
PageContent,

View file

@ -1,5 +1,5 @@
"use client";
import { PollStatus } from "@rallly/database";
import type { PollStatus } from "@rallly/database";
import { cn } from "@rallly/ui";
import { Badge } from "@rallly/ui/badge";
import { Button } from "@rallly/ui/button";

View file

@ -16,7 +16,8 @@ import { Trans } from "@/components/trans";
import { useSubscription } from "@/contexts/plan";
import { trpc } from "@/trpc/client";
import { BillingPlans, PricingData } from "./billing-plans";
import type { PricingData } from "./billing-plans";
import { BillingPlans } from "./billing-plans";
declare global {
interface Window {

View file

@ -2,7 +2,7 @@ import { pricingData } from "@rallly/billing/pricing";
import { notFound } from "next/navigation";
import { BillingPage } from "@/app/[locale]/(admin)/settings/billing/billing-page";
import { Params } from "@/app/[locale]/types";
import type { Params } from "@/app/[locale]/types";
import { env } from "@/env";
import { getTranslation } from "@/i18n/server";

View file

@ -1,4 +1,4 @@
import { Params } from "@/app/[locale]/types";
import type { Params } from "@/app/[locale]/types";
import { getTranslation } from "@/i18n/server";
import { PreferencesPage } from "./preferences-page";

View file

@ -1,5 +1,7 @@
"use client";
import { Button } from "@rallly/ui/button";
import type {
DialogProps} from "@rallly/ui/dialog";
import {
Dialog,
DialogClose,
@ -7,7 +9,6 @@ import {
DialogDescription,
DialogFooter,
DialogHeader,
DialogProps,
DialogTitle,
} from "@rallly/ui/dialog";
import { Form, FormField, FormItem, FormMessage } from "@rallly/ui/form";

View file

@ -1,4 +1,4 @@
import { Params } from "@/app/[locale]/types";
import type { Params } from "@/app/[locale]/types";
import { getTranslation } from "@/i18n/server";
import { ProfilePage } from "./profile-page";

View file

@ -25,7 +25,7 @@ import { ProBadge } from "@/components/pro-badge";
import { Trans } from "@/components/trans";
import { IfGuest, useUser } from "@/components/user-provider";
import { IfFreeUser } from "@/contexts/plan";
import { IconComponent } from "@/types";
import type { IconComponent } from "@/types";
import { usePostHog } from "@/utils/posthog";
function NavItem({

View file

@ -2,7 +2,7 @@ import Link from "next/link";
import { Trans } from "react-i18next/TransWithoutContext";
import { LoginForm } from "@/app/[locale]/(auth)/login/login-form";
import { Params } from "@/app/[locale]/types";
import type { Params } from "@/app/[locale]/types";
import { AuthCard } from "@/components/auth/auth-layout";
import { getTranslation } from "@/i18n/server";

View file

@ -1,5 +1,5 @@
import { RegisterForm } from "@/app/[locale]/(auth)/register/register-page";
import { Params } from "@/app/[locale]/types";
import type { Params } from "@/app/[locale]/types";
import { getTranslation } from "@/i18n/server";
export default async function Page() {

View file

@ -1,10 +1,10 @@
import { prisma } from "@rallly/database";
import { absoluteUrl } from "@rallly/utils/absolute-url";
import { notFound } from "next/navigation";
import { Redirect } from "@/app/components/redirect";
import { absoluteUrl } from "@/utils/absolute-url";
import { PParams } from "./types";
import type { PParams } from "./types";
export default async function Page({ params }: { params: PParams }) {
const { adminUrlId } = params;

View file

@ -1,4 +1,4 @@
import { Params } from "@/app/[locale]/types";
import type { Params } from "@/app/[locale]/types";
export interface PParams extends Params {
adminUrlId: string;

View file

@ -1,10 +1,9 @@
import { prisma } from "@rallly/database";
import { Metadata } from "next";
import { absoluteUrl } from "@rallly/utils/absolute-url";
import { notFound } from "next/navigation";
import { InvitePage } from "@/app/[locale]/invite/[urlId]/invite-page";
import { getTranslation } from "@/i18n/server";
import { absoluteUrl } from "@/utils/absolute-url";
export default async function Page() {
return <InvitePage />;
@ -70,5 +69,5 @@ export async function generateMetadata({
},
],
},
} satisfies Metadata;
};
}

View file

@ -2,7 +2,7 @@ import "tailwindcss/tailwind.css";
import "../../style.css";
import { Toaster } from "@rallly/ui/toaster";
import { Viewport } from "next";
import type { Viewport } from "next";
import { Inter } from "next/font/google";
import React from "react";

View file

@ -2,7 +2,7 @@ import { Trans } from "react-i18next/TransWithoutContext";
import { GroupPollIcon } from "@/app/[locale]/(admin)/app-card";
import { BackButton } from "@/app/[locale]/(admin)/menu/menu-button";
import { Params } from "@/app/[locale]/types";
import type { Params } from "@/app/[locale]/types";
import { CreatePoll } from "@/components/create-poll";
import { UserDropdown } from "@/components/user-dropdown";
import { getTranslation } from "@/i18n/server";

View file

@ -1,10 +1,10 @@
import { prisma } from "@rallly/database";
import { absoluteUrl } from "@rallly/utils/absolute-url";
import { notFound } from "next/navigation";
import { Redirect } from "@/app/components/redirect";
import { absoluteUrl } from "@/utils/absolute-url";
import { PParams } from "./types";
import type { PParams } from "./types";
export default async function Page({ params }: { params: PParams }) {
const { participantUrlId } = params;

View file

@ -1,4 +1,4 @@
import { Params } from "@/app/[locale]/types";
import type { Params } from "@/app/[locale]/types";
export interface PParams extends Params {
participantUrlId: string;

View file

@ -1,5 +1,7 @@
"use client";
import { Button } from "@rallly/ui/button";
import type {
DialogProps} from "@rallly/ui/dialog";
import {
Dialog,
DialogClose,
@ -7,7 +9,6 @@ import {
DialogDescription,
DialogFooter,
DialogHeader,
DialogProps,
DialogTitle,
} from "@rallly/ui/dialog";
import { useRouter } from "next/navigation";

View file

@ -13,14 +13,15 @@ import Link from "next/link";
import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import type {
PollDetailsData} from "@/components/forms/poll-details-form";
import {
PollDetailsData,
PollDetailsForm,
} from "@/components/forms/poll-details-form";
import { useUpdatePollMutation } from "@/components/poll/mutations";
import { usePoll } from "@/components/poll-context";
import { Trans } from "@/components/trans";
import { NextPageWithLayout } from "@/types";
import type { NextPageWithLayout } from "@/types";
const Page: NextPageWithLayout = () => {
const { poll } = usePoll();

View file

@ -8,7 +8,7 @@ import { useRouter } from "next/navigation";
import { useTranslation } from "next-i18next";
import { useForm } from "react-hook-form";
import { PollOptionsData } from "@/components/forms";
import type { PollOptionsData } from "@/components/forms";
import PollOptionsForm from "@/components/forms/poll-options-form";
import { useModalContext } from "@/components/modal/modal-provider";
import { useUpdatePollMutation } from "@/components/poll/mutations";

View file

@ -6,9 +6,10 @@ import Link from "next/link";
import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import type {
PollSettingsFormData} from "@/components/forms/poll-settings";
import {
PollSettingsForm,
PollSettingsFormData,
PollSettingsForm
} from "@/components/forms/poll-settings";
import { useUpdatePollMutation } from "@/components/poll/mutations";
import { Trans } from "@/components/trans";

View file

@ -1,4 +1,5 @@
import { NextRequest, NextResponse } from "next/server";
import type { NextRequest} from "next/server";
import { NextResponse } from "next/server";
import { resetUser } from "@/app/guest";

View file

@ -1,5 +1,6 @@
import { GetObjectCommand } from "@aws-sdk/client-s3";
import { NextRequest, NextResponse } from "next/server";
import type { NextRequest} from "next/server";
import { NextResponse } from "next/server";
import { env } from "@/env";
import { getS3Client } from "@/utils/s3";

View file

@ -1,5 +1,6 @@
"use client";
import { Button, ButtonProps } from "@rallly/ui/button";
import type { ButtonProps } from "@rallly/ui/button";
import { Button } from "@rallly/ui/button";
import { usePostHog } from "@/utils/posthog";

View file

@ -1,9 +1,10 @@
import languages from "@rallly/languages";
import { absoluteUrl } from "@rallly/utils/absolute-url";
import languageParser from "accept-language-parser";
import { NextRequest, NextResponse } from "next/server";
import { encode, JWT } from "next-auth/jwt";
import type { NextRequest, NextResponse } from "next/server";
import type { JWT } from "next-auth/jwt";
import { encode } from "next-auth/jwt";
import { absoluteUrl } from "@/utils/absolute-url";
import { randomid } from "@/utils/nanoid";
const supportedLocales = Object.keys(languages);

View file

@ -9,7 +9,7 @@ import { useState } from "react";
import { UserProvider } from "@/components/user-provider";
import { I18nProvider } from "@/i18n/client";
import { trpcConfig } from "@/trpc/client/config";
import { AppRouter } from "@/trpc/routers";
import type { AppRouter } from "@/trpc/routers";
import { ConnectedDayjsProvider } from "@/utils/dayjs";
export const trpc = createTRPCReact<AppRouter>({

View file

@ -1,10 +1,11 @@
import { prisma } from "@rallly/database";
import {
import { absoluteUrl } from "@rallly/utils/absolute-url";
import type {
GetServerSidePropsContext,
NextApiRequest,
NextApiResponse,
} from "next";
import { NextAuthOptions, User } from "next-auth";
import type { NextAuthOptions, User } from "next-auth";
import NextAuth, {
getServerSession as getServerSessionWithOptions,
} from "next-auth/next";
@ -12,14 +13,13 @@ import AzureADProvider from "next-auth/providers/azure-ad";
import CredentialsProvider from "next-auth/providers/credentials";
import EmailProvider from "next-auth/providers/email";
import GoogleProvider from "next-auth/providers/google";
import { Provider } from "next-auth/providers/index";
import type { Provider } from "next-auth/providers/index";
import { posthog } from "@/app/posthog";
import { CustomPrismaAdapter } from "@/auth/custom-prisma-adapter";
import { mergeGuestsIntoUser } from "@/auth/merge-user";
import { env } from "@/env";
import type { RegistrationTokenPayload } from "@/trpc/types";
import { absoluteUrl } from "@/utils/absolute-url";
import { getEmailClient } from "@/utils/emails";
import { getValueByPath } from "@/utils/get-value-by-path";
import { generateOtp, randomid } from "@/utils/nanoid";

View file

@ -10,8 +10,8 @@
* See: https://github.com/lukevella/rallly/issues/949
*/
import { PrismaAdapter } from "@auth/prisma-adapter";
import { ExtendedPrismaClient, PrismaClient } from "@rallly/database";
import { Adapter, AdapterAccount } from "next-auth/adapters";
import type { ExtendedPrismaClient, PrismaClient } from "@rallly/database";
import type { Adapter, AdapterAccount } from "next-auth/adapters";
export function CustomPrismaAdapter(client: ExtendedPrismaClient): Adapter {
return {

View file

@ -9,8 +9,9 @@ import {
DropdownMenuTrigger,
} from "@rallly/ui/dropdown-menu";
import { Icon } from "@rallly/ui/icon";
import type {
CalendarEvent} from "calendar-link";
import {
CalendarEvent,
google,
ics,
office365,

View file

@ -21,7 +21,8 @@ import { trpc } from "@/trpc/client";
import { setCookie } from "@/utils/cookies";
import { usePostHog } from "@/utils/posthog";
import { NewEventData, PollDetailsForm, PollOptionsForm } from "./forms";
import type { NewEventData} from "./forms";
import { PollDetailsForm, PollOptionsForm } from "./forms";
const required = <T,>(v: T | undefined): T => {
if (!v) {

View file

@ -1,5 +1,6 @@
import clsx from "clsx";
import dayjs, { Dayjs } from "dayjs";
import type { Dayjs } from "dayjs";
import dayjs from "dayjs";
export const DateIconInner = (props: {
dow?: React.ReactNode;

View file

@ -7,7 +7,7 @@ import { useFormContext } from "react-hook-form";
import { Trans } from "@/components/trans";
import { useFormValidation } from "@/utils/form-validation";
import { NewEventData } from "./types";
import type { NewEventData } from "./types";
export interface PollDetailsData {
title: string;

View file

@ -24,7 +24,7 @@ import { useTranslation } from "next-i18next";
import * as React from "react";
import { useFormContext } from "react-hook-form";
import { NewEventData } from "@/components/forms";
import type { NewEventData } from "@/components/forms";
import { Trans } from "@/components/trans";
import {
@ -35,8 +35,8 @@ import {
} from "../../../../utils/date-time-utils";
import DateCard from "../../../date-card";
import { useHeadlessDatePicker } from "../../../headless-date-picker";
import { DateTimeOption } from "..";
import { DateTimePickerProps } from "../types";
import type { DateTimeOption } from "..";
import type { DateTimePickerProps } from "../types";
import { formatDateWithoutTime, formatDateWithoutTz } from "../utils";
import TimePicker from "./time-picker";

View file

@ -23,9 +23,9 @@ import { useFormContext } from "react-hook-form";
import { TimeZoneCommand } from "@/components/time-zone-picker/time-zone-select";
import { getBrowserTimeZone } from "../../../utils/date-time-utils";
import { NewEventData } from "../types";
import type { NewEventData } from "../types";
import MonthCalendar from "./month-calendar";
import { DateTimeOption } from "./types";
import type { DateTimeOption } from "./types";
import WeekCalendar from "./week-calendar";
export type PollOptionsData = {

View file

@ -4,13 +4,14 @@ import "./rbc-overrides.css";
import dayjs from "dayjs";
import { XIcon } from "lucide-react";
import React from "react";
import { Calendar, CalendarProps } from "react-big-calendar";
import type { CalendarProps } from "react-big-calendar";
import { Calendar } from "react-big-calendar";
import { createBreakpoint } from "react-use";
import { getDuration } from "../../../utils/date-time-utils";
import DateNavigationToolbar from "./date-navigation-toolbar";
import dayjsLocalizer from "./dayjs-localizer";
import { DateTimeOption, DateTimePickerProps } from "./types";
import type { DateTimeOption, DateTimePickerProps } from "./types";
import { formatDateWithoutTz } from "./utils";
const localizer = dayjsLocalizer(dayjs);

View file

@ -1,7 +1,7 @@
import { PollSettingsFormData } from "@/components/forms/poll-settings";
import type { PollSettingsFormData } from "@/components/forms/poll-settings";
import { PollDetailsData } from "./poll-details-form";
import { PollOptionsData } from "./poll-options-form/poll-options-form";
import type { PollDetailsData } from "./poll-details-form";
import type { PollOptionsData } from "./poll-options-form/poll-options-form";
export type NewEventData = PollDetailsData &
PollOptionsData &

View file

@ -1,4 +1,5 @@
import Link, { LinkProps } from "next/link";
import type { LinkProps } from "next/link";
import Link from "next/link";
import { usePathname } from "next/navigation";
import React from "react";

View file

@ -2,7 +2,8 @@ import * as React from "react";
import { useList } from "react-use";
import { useRequiredContext } from "../use-required-context";
import Modal, { ModalProps } from "./modal";
import type { ModalProps } from "./modal";
import Modal from "./modal";
export interface ModalProviderProps {
children?: React.ReactNode;

View file

@ -1,4 +1,5 @@
import { Button, ButtonProps } from "@rallly/ui/button";
import type { ButtonProps } from "@rallly/ui/button";
import { Button } from "@rallly/ui/button";
import {
Dialog,
DialogClose,

View file

@ -1,6 +1,7 @@
import React from "react";
import Modal, { ModalProps } from "./modal";
import type { ModalProps } from "./modal";
import Modal from "./modal";
type OpenModalFn = () => void;
type CloseModalFn = () => void;

View file

@ -1,5 +1,5 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { VoteType } from "@rallly/database";
import type { VoteType } from "@rallly/database";
import { Badge } from "@rallly/ui/badge";
import { Button } from "@rallly/ui/button";
import { FormMessage } from "@rallly/ui/form";

View file

@ -1,5 +1,5 @@
import { Container } from "@/components/container";
import { IconComponent } from "@/types";
import type { IconComponent } from "@/types";
export const PageDialog = (
props: React.PropsWithChildren<{ icon?: IconComponent }>,

View file

@ -30,7 +30,8 @@ import { Input } from "@rallly/ui/input";
import { PencilIcon, TagIcon, TrashIcon } from "lucide-react";
import { useTranslation } from "next-i18next";
import React from "react";
import { SubmitHandler, useForm } from "react-hook-form";
import type { SubmitHandler} from "react-hook-form";
import { useForm } from "react-hook-form";
import { useMount } from "react-use";
import { z } from "zod";

View file

@ -1,10 +1,10 @@
import { Participant, VoteType } from "@rallly/database";
import type { Participant, VoteType } from "@rallly/database";
import * as React from "react";
import { useVisibility } from "@/components/visibility";
import { usePermissions } from "@/contexts/permissions";
import { trpc } from "@/trpc/client";
import { Vote } from "@/trpc/client/types";
import type { Vote } from "@/trpc/client/types";
import { useRequiredContext } from "./use-required-context";

View file

@ -2,10 +2,11 @@
import { pricingData } from "@rallly/billing/pricing";
import { Badge } from "@rallly/ui/badge";
import type {
DialogProps} from "@rallly/ui/dialog";
import {
Dialog,
DialogContent,
DialogProps,
useDialog,
} from "@rallly/ui/dialog";
import { RadioGroup, RadioGroupItem } from "@rallly/ui/radio-group";

View file

@ -1,15 +1,16 @@
import { Participant, VoteType } from "@rallly/database";
import type { Participant, VoteType } from "@rallly/database";
import dayjs from "dayjs";
import { keyBy } from "lodash";
import { TrashIcon } from "lucide-react";
import { useTranslation } from "next-i18next";
import React from "react";
import { GetPollApiResponse, Vote } from "@/trpc/client/types";
import {
getDuration,
import type { GetPollApiResponse, Vote } from "@/trpc/client/types";
import type {
ParsedDateOption,
ParsedTimeSlotOption,
ParsedTimeSlotOption} from "@/utils/date-time-utils";
import {
getDuration
} from "@/utils/date-time-utils";
import { useDayjs } from "@/utils/dayjs";

View file

@ -1,4 +1,4 @@
import { PollStatus } from "@rallly/database";
import type { PollStatus } from "@rallly/database";
import { cn } from "@rallly/ui";
import { Trans } from "@/components/trans";

View file

@ -13,7 +13,7 @@ import { usePoll } from "@/components/poll-context";
import { Trans } from "@/components/trans";
import { useUser } from "@/components/user-provider";
import { usePermissions } from "@/contexts/permissions";
import { Vote } from "@/trpc/client/types";
import type { Vote } from "@/trpc/client/types";
import VoteIcon from "../vote-icon";
import ParticipantRowForm from "./participant-row-form";

View file

@ -1,5 +1,7 @@
import { cn } from "@rallly/ui";
import { Button } from "@rallly/ui/button";
import type {
DialogProps} from "@rallly/ui/dialog";
import {
Dialog,
DialogClose,
@ -7,7 +9,6 @@ import {
DialogDescription,
DialogFooter,
DialogHeader,
DialogProps,
DialogTitle,
} from "@rallly/ui/dialog";
import {

View file

@ -1,6 +1,7 @@
import * as React from "react";
import PollOption, { PollOptionProps } from "./poll-option";
import type { PollOptionProps } from "./poll-option";
import PollOption from "./poll-option";
export interface DateOptionProps extends PollOptionProps {
dow: string;

View file

@ -2,7 +2,7 @@ import clsx from "clsx";
import { groupBy } from "lodash";
import * as React from "react";
import { ParsedDateTimeOpton } from "@/utils/date-time-utils";
import type { ParsedDateTimeOpton } from "@/utils/date-time-utils";
import PollOptions from "./poll-options";

View file

@ -1,5 +1,5 @@
"use client";
import { Participant, VoteType } from "@rallly/database";
import type { Participant, VoteType } from "@rallly/database";
import { cn } from "@rallly/ui";
import { Button } from "@rallly/ui/button";
import { Icon } from "@rallly/ui/icon";

View file

@ -1,10 +1,10 @@
import { VoteType } from "@rallly/database";
import type { VoteType } from "@rallly/database";
import * as React from "react";
import { Controller } from "react-hook-form";
import { useVotingForm } from "@/components/poll/voting-form";
import { usePoll } from "@/components/poll-context";
import { ParsedDateTimeOpton } from "@/utils/date-time-utils";
import type { ParsedDateTimeOpton } from "@/utils/date-time-utils";
import DateOption from "./date-option";
import TimeSlotOption from "./time-slot-option";

View file

@ -1,7 +1,8 @@
import { ClockIcon } from "lucide-react";
import * as React from "react";
import PollOption, { PollOptionProps } from "./poll-option";
import type { PollOptionProps } from "./poll-option";
import PollOption from "./poll-option";
export interface TimeSlotOptionProps extends PollOptionProps {
startTime: string;

View file

@ -2,7 +2,7 @@ import { usePoll } from "@/components/poll-context";
import { trpc } from "@/trpc/client";
import { usePostHog } from "@/utils/posthog";
import { ParticipantForm } from "./types";
import type { ParticipantForm } from "./types";
export const normalizeVotes = (
optionIds: string[],

View file

@ -1,4 +1,4 @@
import { VoteType } from "@rallly/database";
import type { VoteType } from "@rallly/database";
export interface ParticipantForm {
votes: Array<

View file

@ -1,4 +1,4 @@
import { VoteType } from "@rallly/database";
import type { VoteType } from "@rallly/database";
import { IfNeedBeIcon, NoIcon, PendingIcon, YesIcon } from "@rallly/icons";
import clsx from "clsx";
import * as React from "react";

View file

@ -1,4 +1,4 @@
import { VoteType } from "@rallly/database";
import type { VoteType } from "@rallly/database";
import { cn } from "@rallly/ui";
import * as React from "react";

View file

@ -1,4 +1,5 @@
import Link, { LinkProps } from "next/link";
import type { LinkProps } from "next/link";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import React from "react";

View file

@ -1,6 +1,6 @@
import { cn } from "@rallly/ui";
import { Icon } from "@rallly/ui/icon";
import { Column } from "@tanstack/react-table";
import type { Column } from "@tanstack/react-table";
import { ArrowDownIcon, ArrowUpIcon, ChevronsUpDownIcon } from "lucide-react";
interface DataTableColumnHeaderProps<TData, TValue>

View file

@ -1,4 +1,4 @@
import { TimeFormat } from "@rallly/database";
import type { TimeFormat } from "@rallly/database";
import { RadioGroup, RadioGroupItem } from "@rallly/ui/radio-group";
import { Trans } from "@/components/trans";

View file

@ -1,6 +1,6 @@
"use client";
import { SelectProps } from "@radix-ui/react-select";
import type { SelectProps } from "@radix-ui/react-select";
import { Badge } from "@rallly/ui/badge";
import { Button } from "@rallly/ui/button";
import {

View file

@ -2,7 +2,7 @@ import { Trans as BaseTrans } from "react-i18next";
import { useTranslation } from "@/i18n/client";
import { I18nNamespaces } from "../../declarations/i18next";
import type { I18nNamespaces } from "../../declarations/i18next";
export const Trans = (props: {
i18nKey: keyof I18nNamespaces["app"];

View file

@ -1,5 +1,5 @@
"use client";
import { Session } from "next-auth";
import type { Session } from "next-auth";
import { useSession } from "next-auth/react";
import React from "react";

View file

@ -1,4 +1,4 @@
import { TimeFormat } from "@rallly/database";
import type { TimeFormat } from "@rallly/database";
import React from "react";
import { useSetState } from "react-use";

View file

@ -1,4 +1,5 @@
import { createInstance, Namespace } from "i18next";
import type { Namespace } from "i18next";
import { createInstance } from "i18next";
import ICU from "i18next-icu";
import resourcesToBackend from "i18next-resources-to-backend";
import { initReactI18next } from "react-i18next/initReactI18next";

View file

@ -1,5 +1,5 @@
import allLanguages from "@rallly/languages";
import { InitOptions } from "i18next";
import type { InitOptions } from "i18next";
export const fallbackLng = "en";
export const languages = Object.keys(allLanguages);

View file

@ -1,5 +1,5 @@
import { prisma } from "@rallly/database";
import { GetServerSideProps } from "next";
import type { GetServerSideProps } from "next";
import { getServerSession } from "@/auth";
import type { DisableNotificationsPayload } from "@/trpc/types";

View file

@ -4,8 +4,8 @@ import "../style.css";
import { TooltipProvider } from "@rallly/ui/tooltip";
import { domMax, LazyMotion } from "framer-motion";
import { NextPage } from "next";
import { AppProps } from "next/app";
import type { NextPage } from "next";
import type { AppProps } from "next/app";
import { Inter } from "next/font/google";
import Head from "next/head";
import { SessionProvider, signIn, useSession } from "next-auth/react";
@ -17,7 +17,7 @@ import { I18nProvider } from "@/i18n/client";
import { trpc } from "@/trpc/client";
import { ConnectedDayjsProvider } from "@/utils/dayjs";
import { NextPageWithLayout } from "../types";
import type { NextPageWithLayout } from "../types";
const inter = Inter({
subsets: ["latin"],

View file

@ -1,6 +1,6 @@
/* eslint-disable @next/next/no-img-element */
import { ImageResponse } from "next/og";
import { NextRequest } from "next/server";
import type { NextRequest } from "next/server";
import { z } from "zod";
const schema = z.object({

View file

@ -4,7 +4,7 @@ import crypto from "crypto";
import type { NextApiRequest, NextApiResponse } from "next";
import * as Serialize from "php-serialize";
import { PaddlePassthrough, PaddleRequest } from "@/paddle.interface";
import type { PaddlePassthrough, PaddleRequest } from "@/paddle.interface";
const allowedIpAdresses = [
// Sandbox

View file

@ -1,10 +1,10 @@
import { getProPricing, stripe } from "@rallly/billing";
import { prisma } from "@rallly/database";
import { NextApiRequest, NextApiResponse } from "next";
import { absoluteUrl } from "@rallly/utils/absolute-url";
import type { NextApiRequest, NextApiResponse } from "next";
import { z } from "zod";
import { getServerSession } from "@/auth";
import { absoluteUrl } from "@/utils/absolute-url";
export const config = {
edge: true,

View file

@ -1,10 +1,10 @@
import { stripe } from "@rallly/billing";
import { prisma } from "@rallly/database";
import { NextApiRequest, NextApiResponse } from "next";
import { absoluteUrl } from "@rallly/utils/absolute-url";
import type { NextApiRequest, NextApiResponse } from "next";
import { z } from "zod";
import { getServerSession } from "@/auth";
import { absoluteUrl } from "@/utils/absolute-url";
const inputSchema = z.object({
session_id: z.string().optional(),

Some files were not shown because too many files have changed in this diff Show more