🎨 Use separate import types (#1826)

This commit is contained in:
Luke Vella 2025-07-15 11:31:33 +01:00 committed by GitHub
parent e94eed373d
commit f79416e695
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 53 additions and 35 deletions

View file

@ -27,10 +27,8 @@ import {
} from "@/components/settings-group"; } from "@/components/settings-group";
import { Trans } from "@/components/trans"; import { Trans } from "@/components/trans";
import { updateInstanceSettings } from "@/features/instance-settings/mutations"; import { updateInstanceSettings } from "@/features/instance-settings/mutations";
import { import type { InstanceSettings } from "@/features/instance-settings/schema";
type InstanceSettings, import { instanceSettingsSchema } from "@/features/instance-settings/schema";
instanceSettingsSchema,
} from "@/features/instance-settings/schema";
import { useTranslation } from "@/i18n/client"; import { useTranslation } from "@/i18n/client";
export function InstanceSettingsForm({ export function InstanceSettingsForm({

View file

@ -1,4 +1,5 @@
import { type Prisma, prisma } from "@rallly/database"; import type { Prisma } from "@rallly/database";
import { prisma } from "@rallly/database";
import { UsersIcon } from "lucide-react"; import { UsersIcon } from "lucide-react";
import z from "zod"; import z from "zod";
import { PageIcon } from "@/app/components/page-icons"; import { PageIcon } from "@/app/components/page-icons";

View file

@ -8,10 +8,12 @@ import { handle } from "hono/vercel";
import { rateLimiter } from "hono-rate-limiter"; import { rateLimiter } from "hono-rate-limiter";
import { env } from "@/env"; import { env } from "@/env";
import { generateLicenseKey } from "@/features/licensing/helpers/generate-license-key"; import { generateLicenseKey } from "@/features/licensing/helpers/generate-license-key";
import type {
CreateLicenseResponse,
ValidateLicenseKeyResponse,
} from "@/features/licensing/schema";
import { import {
type CreateLicenseResponse,
createLicenseInputSchema, createLicenseInputSchema,
type ValidateLicenseKeyResponse,
validateLicenseKeyInputSchema, validateLicenseKeyInputSchema,
} from "@/features/licensing/schema"; } from "@/features/licensing/schema";
import { isSelfHosted } from "@/utils/constants"; import { isSelfHosted } from "@/utils/constants";

View file

@ -1,6 +1,7 @@
import type { LicenseType } from "@prisma/client"; import type { LicenseType } from "@prisma/client";
import { stripe } from "@rallly/billing"; import { stripe } from "@rallly/billing";
import { type NextRequest, NextResponse } from "next/server"; import type { NextRequest } from "next/server";
import { NextResponse } from "next/server";
import { z } from "zod"; import { z } from "zod";
import type { LicenseCheckoutMetadata } from "@/features/licensing/schema"; import type { LicenseCheckoutMetadata } from "@/features/licensing/schema";

View file

@ -1,5 +1,6 @@
import type { Stripe } from "@rallly/billing"; import type { Stripe } from "@rallly/billing";
import { type Prisma, prisma } from "@rallly/database"; import type { Prisma } from "@rallly/database";
import { prisma } from "@rallly/database";
export async function onPaymentMethodUpdated(event: Stripe.Event) { export async function onPaymentMethodUpdated(event: Stripe.Event) {
const paymentMethod = event.data.object as Stripe.PaymentMethod; const paymentMethod = event.data.object as Stripe.PaymentMethod;

View file

@ -1,7 +1,8 @@
"use client"; "use client";
import { Slot } from "@radix-ui/react-slot"; import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority"; import type { VariantProps } from "class-variance-authority";
import { cva } from "class-variance-authority";
import { import {
BarChart2Icon, BarChart2Icon,
CalendarIcon, CalendarIcon,

View file

@ -1,6 +1,7 @@
import type { VoteType } from "@rallly/database"; import type { VoteType } from "@rallly/database";
import { cn } from "@rallly/ui"; import { cn } from "@rallly/ui";
import { cva, type VariantProps } from "class-variance-authority"; import type { VariantProps } from "class-variance-authority";
import { cva } from "class-variance-authority";
import { IfNeedBeIcon } from "@/components/vote-icon/if-need-be-icon"; import { IfNeedBeIcon } from "@/components/vote-icon/if-need-be-icon";
import { NoIcon } from "@/components/vote-icon/no-icon"; import { NoIcon } from "@/components/vote-icon/no-icon";
import { PendingIcon } from "@/components/vote-icon/pending-icon"; import { PendingIcon } from "@/components/vote-icon/pending-icon";

View file

@ -1,10 +1,7 @@
import type { PureAbility } from "@casl/ability"; import type { PureAbility } from "@casl/ability";
import { AbilityBuilder } from "@casl/ability"; import { AbilityBuilder } from "@casl/ability";
import { import type { PrismaQuery, Subjects } from "@casl/prisma";
createPrismaAbility, import { createPrismaAbility } from "@casl/prisma";
type PrismaQuery,
type Subjects,
} from "@casl/prisma";
import type { import type {
Comment, Comment,
Participant, Participant,

View file

@ -1,7 +1,8 @@
"use server"; "use server";
import { requireUser } from "@/auth/queries"; import { requireUser } from "@/auth/queries";
import { type Feedback, feedbackSchema } from "@/features/feedback/schema"; import type { Feedback } from "@/features/feedback/schema";
import { feedbackSchema } from "@/features/feedback/schema";
import { getEmailClient } from "@/utils/emails"; import { getEmailClient } from "@/utils/emails";
import { rateLimit } from "../rate-limit"; import { rateLimit } from "../rate-limit";

View file

@ -1,6 +1,7 @@
"use server"; "use server";
import { type InstanceSettings, prisma } from "@rallly/database"; import type { InstanceSettings } from "@rallly/database";
import { prisma } from "@rallly/database";
import { revalidateTag } from "next/cache"; import { revalidateTag } from "next/cache";
import { requireAdmin } from "@/auth/queries"; import { requireAdmin } from "@/auth/queries";
import { instanceSettingsTag } from "./constants"; import { instanceSettingsTag } from "./constants";

View file

@ -1,7 +1,9 @@
import type {
CreateLicenseInput,
ValidateLicenseInputKeySchema,
} from "../schema";
import { import {
type CreateLicenseInput,
createLicenseResponseSchema, createLicenseResponseSchema,
type ValidateLicenseInputKeySchema,
validateLicenseKeyResponseSchema, validateLicenseKeyResponseSchema,
} from "../schema"; } from "../schema";

View file

@ -21,7 +21,8 @@ import { useTimezone } from "@/features/timezone";
import { useTranslation } from "@/i18n/client"; import { useTranslation } from "@/i18n/client";
import { completeSetupAction } from "../actions"; import { completeSetupAction } from "../actions";
import { type SetupFormValues, setupSchema } from "../schema"; import type { SetupFormValues } from "../schema";
import { setupSchema } from "../schema";
interface SetupFormProps { interface SetupFormProps {
defaultValues?: Partial<SetupFormValues>; defaultValues?: Partial<SetupFormValues>;

View file

@ -1,13 +1,13 @@
"use client"; "use client";
import { zodResolver } from "@hookform/resolvers/zod"; import { zodResolver } from "@hookform/resolvers/zod";
import { Button } from "@rallly/ui/button"; import { Button } from "@rallly/ui/button";
import type { DialogProps } from "@rallly/ui/dialog";
import { import {
Dialog, Dialog,
DialogContent, DialogContent,
DialogDescription, DialogDescription,
DialogFooter, DialogFooter,
DialogHeader, DialogHeader,
type DialogProps,
DialogTitle, DialogTitle,
} from "@rallly/ui/dialog"; } from "@rallly/ui/dialog";
import { import {

View file

@ -1,7 +1,8 @@
"use client"; "use client";
import { cn } from "@rallly/ui"; import { cn } from "@rallly/ui";
import { Avatar, AvatarFallback, type AvatarProps } from "@rallly/ui/avatar"; import type { AvatarProps } from "@rallly/ui/avatar";
import { Avatar, AvatarFallback } from "@rallly/ui/avatar";
type SpaceIconProps = { type SpaceIconProps = {
name: string; name: string;

View file

@ -1,5 +1,6 @@
import { accessibleBy } from "@casl/prisma"; import { accessibleBy } from "@casl/prisma";
import { prisma, type SpaceMemberRole } from "@rallly/database"; import type { SpaceMemberRole } from "@rallly/database";
import { prisma } from "@rallly/database";
import { redirect } from "next/navigation"; import { redirect } from "next/navigation";
import { cache } from "react"; import { cache } from "react";
import { requireUserAbility } from "@/auth/queries"; import { requireUserAbility } from "@/auth/queries";

View file

@ -1,4 +1,5 @@
import { prisma, type TimeFormat } from "@rallly/database"; import type { TimeFormat } from "@rallly/database";
import { prisma } from "@rallly/database";
export async function createUser({ export async function createUser({
name, name,

View file

@ -1,5 +1,6 @@
import type { Page } from "@playwright/test"; import type { Page } from "@playwright/test";
import { prisma, type UserRole } from "@rallly/database"; import type { UserRole } from "@rallly/database";
import { prisma } from "@rallly/database";
import { LoginPage } from "./login-page"; import { LoginPage } from "./login-page";
export async function createUserInDb({ export async function createUserInDb({

View file

@ -15,13 +15,16 @@
"useSingleVarDeclarator": "error", "useSingleVarDeclarator": "error",
"noUnusedTemplateLiteral": "error", "noUnusedTemplateLiteral": "error",
"useNumberNamespace": "error", "useNumberNamespace": "error",
"noInferrableTypes": "error" "noInferrableTypes": "error",
"useImportType": {
"options": {
"style": "separatedType"
},
"level": "error"
}
}, },
"correctness": { "correctness": {
"noUnusedImports": { "noUnusedImports": "error"
"level": "error",
"fix": "unsafe"
}
}, },
"nursery": { "nursery": {
"useSortedClasses": { "useSortedClasses": {

View file

@ -1,4 +1,5 @@
import { cva, type VariantProps } from "class-variance-authority"; import type { VariantProps } from "class-variance-authority";
import { cva } from "class-variance-authority";
import * as React from "react"; import * as React from "react";
import { cn } from "./lib/utils"; import { cn } from "./lib/utils";

View file

@ -2,7 +2,8 @@
import * as AvatarPrimitive from "@radix-ui/react-avatar"; import * as AvatarPrimitive from "@radix-ui/react-avatar";
import { cn } from "@rallly/ui"; import { cn } from "@rallly/ui";
import { cva, type VariantProps } from "class-variance-authority"; import type { VariantProps } from "class-variance-authority";
import { cva } from "class-variance-authority";
import * as React from "react"; import * as React from "react";
const avatarVariants = cva("relative flex shrink-0 overflow-hidden", { const avatarVariants = cva("relative flex shrink-0 overflow-hidden", {

View file

@ -1,4 +1,5 @@
import { cva, type VariantProps } from "class-variance-authority"; import type { VariantProps } from "class-variance-authority";
import { cva } from "class-variance-authority";
import type * as React from "react"; import type * as React from "react";
import { cn } from "./lib/utils"; import { cn } from "./lib/utils";

View file

@ -2,7 +2,8 @@
import * as SheetPrimitive from "@radix-ui/react-dialog"; import * as SheetPrimitive from "@radix-ui/react-dialog";
import { cn } from "@rallly/ui"; import { cn } from "@rallly/ui";
import { cva, type VariantProps } from "class-variance-authority"; import type { VariantProps } from "class-variance-authority";
import { cva } from "class-variance-authority";
import { X } from "lucide-react"; import { X } from "lucide-react";
import * as React from "react"; import * as React from "react";