Skip to content

Commit 9d40b13

Browse files
committed
DX: Improved auto imports (#6950)
Taken from: https://x.com/dillionverma/status/1917639091228926311
1 parent bda0f3e commit 9d40b13

File tree

72 files changed

+238
-213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+238
-213
lines changed

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
"typescript.preferences.autoImportFileExcludePatterns": [
1010
"./packages/thirdweb/src/exports"
1111
],
12+
"typescript.preferences.autoImportSpecifierExcludeRegexes": [
13+
"@radix-ui",
14+
"next/router",
15+
"next/dist",
16+
"^lucide-react/dist/lucide-react.suffixed$"
17+
],
1218
"typescript.tsdk": "node_modules/typescript/lib",
1319
"[typescriptreact]": {
1420
"editor.defaultFormatter": "biomejs.biome"

apps/dashboard/lucide-react.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare module "lucide-react" {
2+
export * from "lucide-react/dist/lucide-react.suffixed";
3+
}

apps/dashboard/src/@/components/blocks/multi-select.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
} from "@/components/ui/popover";
1010
import { Separator } from "@/components/ui/separator";
1111
import { cn } from "@/lib/utils";
12-
import { CheckIcon, ChevronDown, SearchIcon, XIcon } from "lucide-react";
12+
import { CheckIcon, ChevronDownIcon, SearchIcon, XIcon } from "lucide-react";
1313
import {
1414
forwardRef,
1515
useCallback,
@@ -201,15 +201,15 @@ export const MultiSelect = forwardRef<HTMLButtonElement, MultiSelectProps>(
201201
orientation="vertical"
202202
className="flex h-full min-h-6"
203203
/>
204-
<ChevronDown className="h-4 cursor-pointer text-muted-foreground" />
204+
<ChevronDownIcon className="h-4 cursor-pointer text-muted-foreground" />
205205
</div>
206206
</div>
207207
) : (
208208
<div className="flex w-full items-center justify-between">
209209
<span className="text-muted-foreground text-sm">
210210
{placeholder}
211211
</span>
212-
<ChevronDown className="h-4 cursor-pointer text-muted-foreground" />
212+
<ChevronDownIcon className="h-4 cursor-pointer text-muted-foreground" />
213213
</div>
214214
)}
215215
</Button>

apps/dashboard/src/@/components/blocks/select-with-search.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
PopoverTrigger,
99
} from "@/components/ui/popover";
1010
import { cn } from "@/lib/utils";
11-
import { CheckIcon, ChevronDown, SearchIcon } from "lucide-react";
11+
import { CheckIcon, ChevronDownIcon, SearchIcon } from "lucide-react";
1212
import React, { useRef, useMemo, useEffect } from "react";
1313
import { useShowMore } from "../../lib/useShowMore";
1414
import { ScrollShadow } from "../ui/ScrollShadow/ScrollShadow";
@@ -131,7 +131,7 @@ export const SelectWithSearch = React.forwardRef<
131131
>
132132
{selectedOption?.label || placeholder}
133133
</span>
134-
<ChevronDown className="size-4 cursor-pointer text-muted-foreground" />
134+
<ChevronDownIcon className="size-4 cursor-pointer text-muted-foreground" />
135135
</div>
136136
</Button>
137137
</PopoverTrigger>

apps/dashboard/src/@/components/blocks/wallet-address.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
import { useThirdwebClient } from "@/constants/thirdweb.client";
99
import { resolveSchemeWithErrorHandler } from "@/lib/resolveSchemeWithErrorHandler";
1010
import { useClipboard } from "hooks/useClipboard";
11-
import { Check, Copy, XIcon } from "lucide-react";
11+
import { CheckIcon, CopyIcon, XIcon } from "lucide-react";
1212
import { useMemo } from "react";
1313
import { type ThirdwebClient, isAddress } from "thirdweb";
1414
import { ZERO_ADDRESS } from "thirdweb";
@@ -104,9 +104,9 @@ export function WalletAddress(props: {
104104
className="flex items-center gap-2"
105105
>
106106
{hasCopied ? (
107-
<Check className="h-4 w-4" />
107+
<CheckIcon className="h-4 w-4" />
108108
) : (
109-
<Copy className="h-4 w-4" />
109+
<CopyIcon className="h-4 w-4" />
110110
)}
111111
{hasCopied ? "Copied!" : "Copy"}
112112
</Button>

apps/dashboard/src/@/components/ui/DatePickerWithRange.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ import {
99
} from "@/components/ui/popover";
1010
import { cn } from "@/lib/utils";
1111
import { format, isBefore } from "date-fns";
12-
import {
13-
Calendar as CalendarIcon,
14-
CalendarX2Icon,
15-
ChevronDownIcon,
16-
} from "lucide-react";
12+
import { CalendarIcon, CalendarX2Icon, ChevronDownIcon } from "lucide-react";
1713
import React from "react";
1814
import { DynamicHeight } from "./DynamicHeight";
1915
import { TabButtons } from "./tabs";

apps/dashboard/src/@/components/ui/accordion.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import * as AccordionPrimitive from "@radix-ui/react-accordion";
4-
import { ChevronDown } from "lucide-react";
4+
import { ChevronDownIcon } from "lucide-react";
55
import * as React from "react";
66

77
import { cn } from "@/lib/utils";
@@ -34,7 +34,7 @@ const AccordionTrigger = React.forwardRef<
3434
{...props}
3535
>
3636
{children}
37-
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
37+
<ChevronDownIcon className="h-4 w-4 shrink-0 transition-transform duration-200" />
3838
</AccordionPrimitive.Trigger>
3939
</AccordionPrimitive.Header>
4040
));

apps/dashboard/src/@/components/ui/breadcrumb.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Slot } from "@radix-ui/react-slot";
2-
import { ChevronRight, MoreHorizontal } from "lucide-react";
2+
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
33
import * as React from "react";
44

55
import { cn } from "@/lib/utils";
@@ -84,7 +84,7 @@ const BreadcrumbSeparator = ({
8484
className={cn("[&>svg]:size-3.5", className)}
8585
{...props}
8686
>
87-
{children ?? <ChevronRight />}
87+
{children ?? <ChevronRightIcon />}
8888
</li>
8989
);
9090
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
@@ -102,7 +102,7 @@ const BreadcrumbEllipsis = ({
102102
)}
103103
{...props}
104104
>
105-
<MoreHorizontal className="h-4 w-4" />
105+
<MoreHorizontalIcon className="h-4 w-4" />
106106
<span className="sr-only">More</span>
107107
</span>
108108
);

apps/dashboard/src/@/components/ui/calendar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import { ChevronLeft, ChevronRight } from "lucide-react";
3+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
44
import type * as React from "react";
55
import { DayPicker } from "react-day-picker";
66

@@ -54,8 +54,8 @@ function Calendar({
5454
...classNames,
5555
}}
5656
components={{
57-
IconLeft: () => <ChevronLeft className="h-4 w-4" />,
58-
IconRight: () => <ChevronRight className="h-4 w-4" />,
57+
IconLeft: () => <ChevronLeftIcon className="size-4" />,
58+
IconRight: () => <ChevronRightIcon className="size-4" />,
5959
}}
6060
{...props}
6161
/>

apps/dashboard/src/@/components/ui/checkbox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
4-
import { Check } from "lucide-react";
4+
import { CheckIcon } from "lucide-react";
55
import * as React from "react";
66

77
import { cn } from "@/lib/utils";
@@ -21,7 +21,7 @@ const Checkbox = React.forwardRef<
2121
<CheckboxPrimitive.Indicator
2222
className={cn("flex items-center justify-center text-current")}
2323
>
24-
<Check className="h-4 w-4" />
24+
<CheckIcon className="size-4" />
2525
</CheckboxPrimitive.Indicator>
2626
</CheckboxPrimitive.Root>
2727
));

0 commit comments

Comments
 (0)