Skip to content

Commit

Permalink
chore: warn on unused imports (unkeyed#2285)
Browse files Browse the repository at this point in the history
* chore: warn on unused imports

* fix: import React and exclude it from rule
  • Loading branch information
chronark authored Oct 9, 2024
1 parent 2b3dd6f commit b01d946
Show file tree
Hide file tree
Showing 59 changed files with 152 additions and 93 deletions.
2 changes: 1 addition & 1 deletion apps/billing/src/lib/db-marketing/schemas/searchQuery.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { relations, sql } from "drizzle-orm";
import { relations } from "drizzle-orm";
import {
boolean,
index,
Expand Down
3 changes: 0 additions & 3 deletions apps/billing/src/lib/db-marketing/schemas/serper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { db } from "@/lib/db-marketing/client";
import type * as serper from "@/lib/serper";
import { relations } from "drizzle-orm";
import { eq } from "drizzle-orm";
import { index, int, json, mysqlTable, text, timestamp, varchar } from "drizzle-orm/mysql-core";
import { createSelectSchema } from "drizzle-zod";
import type { z } from "zod";
Expand Down
1 change: 0 additions & 1 deletion apps/billing/src/lib/tinybird.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Tinybird as Client } from "@chronark/zod-bird";
import { newId } from "@unkey/id";
import { z } from "zod";

export class Tinybird {
Expand Down
4 changes: 1 addition & 3 deletions apps/billing/src/trigger/downgrade-requests.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { connectDatabase, eq, schema } from "@/lib/db";
import { env } from "@/lib/env";
import { eventTrigger } from "@trigger.dev/sdk";
import { logger, task } from "@trigger.dev/sdk/v3";
import { task } from "@trigger.dev/sdk/v3";

export const downgradeTask = task({
id: "billing_downgrade",
Expand Down
1 change: 0 additions & 1 deletion apps/billing/src/trigger/invoicing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { logger, schedules } from "@trigger.dev/sdk/v3";

import { connectDatabase } from "@/lib/db";

import Stripe from "stripe";
import { createInvoiceTask } from "./create-invoice";
import { downgradeTask } from "./downgrade-requests";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
} from "@/components/ui/breadcrumb";

import { BreadcrumbSkeleton } from "@/components/dashboard/breadcrumb-skeleton";
import { getTenantId } from "@/lib/auth";
import { db } from "@/lib/db";
import { unstable_cache as cache } from "next/cache";
import { Suspense } from "react";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
} from "@/components/ui/breadcrumb";

import { BreadcrumbSkeleton } from "@/components/dashboard/breadcrumb-skeleton";
import { getTenantId } from "@/lib/auth";
import { db } from "@/lib/db";
import { unstable_cache as cache } from "next/cache";
import { Suspense } from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
Expand Down
3 changes: 0 additions & 3 deletions apps/dashboard/app/(app)/@breadcrumb/identities/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { Badge } from "@/components/ui/badge";
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";

export const dynamic = "force-dynamic";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { cn } from "@/lib/utils";
import { zodResolver } from "@hookform/resolvers/zod";
import type { Key } from "@unkey/db";
import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { z } from "zod";
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/app/(app)/apis/client.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use client";
import { EmptyPlaceholder } from "@/components/dashboard/empty-placeholder";
import { PageHeader } from "@/components/dashboard/page-header";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Separator } from "@/components/ui/separator";
Expand Down
4 changes: 0 additions & 4 deletions apps/dashboard/app/(app)/authorization/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import type * as React from "react";

import { Banner } from "@/components/banner";
import { Navbar } from "@/components/dashboard/navbar";
import { PageHeader } from "@/components/dashboard/page-header";
import { OptIn } from "@/components/opt-in";
import { getTenantId } from "@/lib/auth";
import { db } from "@/lib/db";
import Link from "next/link";
import { redirect } from "next/navigation";

export const dynamic = "force-dynamic";
Expand Down
4 changes: 0 additions & 4 deletions apps/dashboard/app/(app)/identities/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import type * as React from "react";

import { Banner } from "@/components/banner";
import { Navbar } from "@/components/dashboard/navbar";
import { PageHeader } from "@/components/dashboard/page-header";
import { OptIn } from "@/components/opt-in";
import { getTenantId } from "@/lib/auth";
import { db } from "@/lib/db";
import Link from "next/link";
import { redirect } from "next/navigation";

export const dynamic = "force-dynamic";
Expand Down
12 changes: 2 additions & 10 deletions apps/dashboard/app/(app)/identities/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import { redirect } from "next/navigation";

import { EmptyPlaceholder } from "@/components/dashboard/empty-placeholder";
import {
Table,
TableBody,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table";
import { Table, TableBody, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import { getTenantId } from "@/lib/auth";
import { db } from "@/lib/db";
import { Loader2, Scan } from "lucide-react";
import { Loader2 } from "lucide-react";
import { unstable_cache as cache } from "next/cache";
import { parseAsInteger, parseAsString } from "nuqs/server";
import { Suspense } from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
"use client";
import { Loading } from "@/components/dashboard/loading";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog";
import {
Form,
FormControl,
Expand All @@ -33,7 +24,6 @@ import { trpc } from "@/lib/trpc/client";
import { zodResolver } from "@hookform/resolvers/zod";
import { useRouter } from "next/navigation";
import type React from "react";
import { useState } from "react";
import { useForm } from "react-hook-form";
import { z } from "zod";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Button } from "@/components/ui/button";
import { getTenantId } from "@/lib/auth";
import { db } from "@/lib/db";
import { getAllSemanticCacheLogs } from "@/lib/tinybird";
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/app/(app)/semantic-cache/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { PageHeader } from "@/components/dashboard/page-header";
import { getTenantId } from "@/lib/auth";
import { db } from "@/lib/db";
import { redirect } from "next/navigation";
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/app/(app)/settings/billing/plans/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { db } from "@/lib/db";
import { ArrowLeft } from "lucide-react";
import Link from "next/link";
import { notFound } from "next/navigation";
import React from "react";
import { ChangePlanButton } from "./button";

const tiers = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
"use client";

import { CopyButton } from "@/components/dashboard/copy-button";
import { Checkbox } from "@/components/ui/checkbox";
import { Label } from "@/components/ui/label";
import { toast } from "@/components/ui/toaster";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { trpc } from "@/lib/trpc/client";
import { Loader2 } from "lucide-react";
import { useRouter } from "next/navigation";
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/app/new/keys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
} from "@/components/ui/card";
import { Code } from "@/components/ui/code";
import { Separator } from "@/components/ui/separator";
import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { AlertCircle, KeyRound, Lock } from "lucide-react";
import Link from "next/link";
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/app/theme-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import { ThemeProvider as NextThemesProvider } from "next-themes";
import type { ThemeProviderProps } from "next-themes/dist/types";
import * as React from "react";

export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/components/dashboard/create-key-button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import React from "react";
import { Button } from "../ui/button";

export const CreateKeyButton = (props: { apiId: string; keyAuthId: string }) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/components/dashboard/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { type SVGProps } from "react";
import type { SVGProps } from "react";

export function Loading({
width = 24,
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/lib/trpc/routers/key/updateName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { db, eq, schema } from "@/lib/db";
import { rateLimitedProcedure, ratelimit } from "@/lib/trpc/ratelimitProcedure";
import { TRPCError } from "@trpc/server";
import { z } from "zod";
import { auth, t } from "../../trpc";
import { auth } from "../../trpc";

export const updateKeyName = rateLimitedProcedure(ratelimit.update)
.use(auth)
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/lib/trpc/routers/key/updateOwnerId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { db, eq, schema } from "@/lib/db";
import { rateLimitedProcedure, ratelimit } from "@/lib/trpc/ratelimitProcedure";
import { TRPCError } from "@trpc/server";
import { z } from "zod";
import { auth, t } from "../../trpc";

export const updateKeyOwnerId = rateLimitedProcedure(ratelimit.update)
.input(
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/lib/trpc/routers/key/updateRootKeyName.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { insertAuditLogs } from "@/lib/audit";
import { db, eq, schema } from "@/lib/db";
import { env } from "@/lib/env";
import { TRPCError } from "@trpc/server";
import { z } from "zod";
import { auth, t } from "../../trpc";
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/lib/trpc/routers/rbac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { rateLimitedProcedure, ratelimit } from "@/lib/trpc/ratelimitProcedure";
import { TRPCError } from "@trpc/server";
import { newId } from "@unkey/id";
import { unkeyPermissionValidation } from "@unkey/rbac";
import { Text } from "@visx/text";
import { z } from "zod";
import type { Context } from "../context";
import { t } from "../trpc";
Expand Down
2 changes: 1 addition & 1 deletion apps/logdrain/src/worker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Axiom } from "@axiomhq/js";
import { type LogSchema, logSchema } from "@unkey/logs";
import { logSchema } from "@unkey/logs";
import { decompressSync, strFromU8 } from "fflate";
import { z } from "zod";

Expand Down
1 change: 0 additions & 1 deletion apps/play/app/page-bk.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client";

import TerminalInput from "@/components/ui/terminalInput";
import TextAnimator from "@/components/ui/textAnimator";
import { type Message, getStepsData } from "@/lib/data";
import { handleCurlServer } from "@/lib/helper";
import { cn } from "@/lib/utils";
Expand Down
1 change: 0 additions & 1 deletion apps/play/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { z } from "zod";

import { Button } from "@/components/ui/button";
import { NamedInput } from "@/components/ui/input";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Textarea } from "@/components/ui/textarea";
import { protectedApiRequestSchema } from "@/lib/schemas";
import { cn } from "@/lib/utils";
Expand Down
2 changes: 0 additions & 2 deletions apps/www/app/accelerate/components/audit-logs-ga.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

export function AccelerateAuditLogsIcon() {
return (
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
Expand Down
2 changes: 0 additions & 2 deletions apps/www/app/accelerate/components/recovering-keys.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

export function AccelerateRecoveringKeysIcon() {
return (
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
Expand Down
1 change: 0 additions & 1 deletion apps/www/app/accelerate/components/rive.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client";

import {
Event,
EventType,
RiveEventType,
useRive,
Expand Down
2 changes: 0 additions & 2 deletions apps/www/app/accelerate/components/semantic-cache.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

export function AccelerateSemanticCacheIcon() {
return (
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
Expand Down
2 changes: 0 additions & 2 deletions apps/www/app/accelerate/components/swagground.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

export function AccelerateSwaggroundIcon() {
return (
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
Expand Down
2 changes: 0 additions & 2 deletions apps/www/app/accelerate/components/unkey-cache.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

export function AccelerateUnkeyCacheIcon() {
return (
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
Expand Down
4 changes: 2 additions & 2 deletions apps/www/app/feed.xml/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import RSS from "rss";
import { type Post, allPosts } from "content-collections";
import { authors } from "@/content/blog/authors";
import { type Post, allPosts } from "content-collections";
import RSS from "rss";
const feed = new RSS({
title: "Unkey",
description: "Open Source API Development platform",
Expand Down
4 changes: 2 additions & 2 deletions apps/www/app/hero/hero-main-section.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Link from "next/link";

import { PrimaryButton, RainbowDarkButton, SecondaryButton } from "@/components/button";
import { ArrowRight, BookOpen, ChevronRight, LogIn } from "lucide-react";
import { PrimaryButton, SecondaryButton } from "@/components/button";
import { BookOpen, ChevronRight, LogIn } from "lucide-react";

export function HeroMainSection() {
return (
Expand Down
1 change: 0 additions & 1 deletion apps/www/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { LatencyBento } from "@/components/latency-bento";
import { OpenSource } from "@/components/open-source";
import { RateLimitsBento } from "@/components/rate-limits-bento";
import { Section, SectionTitle } from "@/components/section";
import { Stats } from "@/components/stats";
import { FeatureGridChip } from "@/components/svg/feature-grid-chip";
import { TopLeftShiningLight, TopRightShiningLight } from "@/components/svg/hero";
import { OssLight } from "@/components/svg/oss-light";
Expand Down
2 changes: 1 addition & 1 deletion apps/www/app/pricing/discover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
import { cn } from "@/lib/utils";
import * as SliderPrimitive from "@radix-ui/react-slider";
import { Gauge, HelpCircle, KeySquare, ListChecks } from "lucide-react";
import { Gauge, HelpCircle, ListChecks } from "lucide-react";
import React, { useState } from "react";

import { SectionTitle } from "@/components/section";
Expand Down
1 change: 0 additions & 1 deletion apps/www/components/blog/darkTheme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { SyntaxHighlighterProps } from "react-syntax-highlighter";
export default {
"hljs-type": {
color: "#F8F8F2", //No effect in tests
Expand Down
1 change: 0 additions & 1 deletion apps/www/components/blog/suggested-blogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { cn } from "@/lib/utils";
import { type Post, allPosts } from "content-collections";
import { format } from "date-fns";
import Link from "next/link";
import React from "react";
import { Frame } from "../frame";
import { ImageWithBlur } from "../image-with-blur";

Expand Down
2 changes: 1 addition & 1 deletion apps/www/components/hashed-keys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
useTransform,
useWillChange,
} from "framer-motion";
import { useEffect, useMemo, useRef, useState } from "react";
import { useEffect, useRef, useState } from "react";

import { StarsSvg } from "@/components/svg/stars";
import { cn } from "@/lib/utils";
Expand Down
1 change: 0 additions & 1 deletion apps/www/components/mdx-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type { DetailedHTMLProps, ImgHTMLAttributes, JSX } from "react";
import { BlogCodeBlock, BlogCodeBlockSingle } from "./blog/blog-code-block";
import { BlogList, BlogListItem, BlogListNumbered, type BlogListProps } from "./blog/blog-list";
import { BlogQuote, type BlogQuoteProps } from "./blog/blog-quote";
import { ImageWithBlur } from "./image-with-blur";
import { Alert } from "./ui/alert/alert";

export const MdxComponents = {
Expand Down
3 changes: 1 addition & 2 deletions apps/www/components/navbar/navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
"use client";
import {
Drawer,
DrawerClose,
DrawerContent,
DrawerFooter,
DrawerHeader,
DrawerTrigger,
} from "@/components/ui/drawer";
import { cn } from "@/lib/utils";
import { motion, useAnimation } from "framer-motion";
import { motion } from "framer-motion";
import { ChevronDown, ChevronRight } from "lucide-react";
import Link from "next/link";
import { useEffect, useState } from "react";
Expand Down
Loading

0 comments on commit b01d946

Please sign in to comment.