🎨 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";
import { Trans } from "@/components/trans";
import { updateInstanceSettings } from "@/features/instance-settings/mutations";
import {
type InstanceSettings,
instanceSettingsSchema,
} from "@/features/instance-settings/schema";
import type { InstanceSettings } from "@/features/instance-settings/schema";
import { instanceSettingsSchema } from "@/features/instance-settings/schema";
import { useTranslation } from "@/i18n/client";
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 z from "zod";
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 { env } from "@/env";
import { generateLicenseKey } from "@/features/licensing/helpers/generate-license-key";
import type {
CreateLicenseResponse,
ValidateLicenseKeyResponse,
} from "@/features/licensing/schema";
import {
type CreateLicenseResponse,
createLicenseInputSchema,
type ValidateLicenseKeyResponse,
validateLicenseKeyInputSchema,
} from "@/features/licensing/schema";
import { isSelfHosted } from "@/utils/constants";

View file

@ -1,6 +1,7 @@
import type { LicenseType } from "@prisma/client";
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 type { LicenseCheckoutMetadata } from "@/features/licensing/schema";

View file

@ -1,5 +1,6 @@
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) {
const paymentMethod = event.data.object as Stripe.PaymentMethod;

View file

@ -1,7 +1,8 @@
"use client";
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 {
BarChart2Icon,
CalendarIcon,

View file

@ -1,6 +1,7 @@
import type { VoteType } from "@rallly/database";
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 { NoIcon } from "@/components/vote-icon/no-icon";
import { PendingIcon } from "@/components/vote-icon/pending-icon";

View file

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

View file

@ -1,7 +1,8 @@
"use server";
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 { rateLimit } from "../rate-limit";

View file

@ -1,6 +1,7 @@
"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 { requireAdmin } from "@/auth/queries";
import { instanceSettingsTag } from "./constants";

View file

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

View file

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

View file

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

View file

@ -1,7 +1,8 @@
"use client";
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 = {
name: string;

View file

@ -1,5 +1,6 @@
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 { cache } from "react";
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({
name,

View file

@ -1,5 +1,6 @@
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";
export async function createUserInDb({

View file

@ -15,13 +15,16 @@
"useSingleVarDeclarator": "error",
"noUnusedTemplateLiteral": "error",
"useNumberNamespace": "error",
"noInferrableTypes": "error"
"noInferrableTypes": "error",
"useImportType": {
"options": {
"style": "separatedType"
},
"level": "error"
}
},
"correctness": {
"noUnusedImports": {
"level": "error",
"fix": "unsafe"
}
"noUnusedImports": "error"
},
"nursery": {
"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 { cn } from "./lib/utils";

View file

@ -2,7 +2,8 @@
import * as AvatarPrimitive from "@radix-ui/react-avatar";
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";
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 { cn } from "./lib/utils";

View file

@ -2,7 +2,8 @@
import * as SheetPrimitive from "@radix-ui/react-dialog";
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 * as React from "react";