Skip to content

Commit

Permalink
enfore more lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsdls committed Sep 23, 2024
1 parent 1133ccc commit 3dd7144
Show file tree
Hide file tree
Showing 602 changed files with 2,254 additions and 2,328 deletions.
2 changes: 1 addition & 1 deletion apps/dashboard/biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.1/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.2/schema.json",
"extends": ["../../biome.json"],
"overrides": [
{
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": "next start",
"format": "biome format ./src --write",
"lint": "biome check ./src && knip && eslint ./src",
"fix": "biome check ./src --fix && eslint ./src --fix",
"fix": "biome check ./src --fix --unsafe && eslint ./src --fix",
"typecheck": "tsc --noEmit",
"gen:theme-typings": "chakra-cli tokens src/theme/index.ts",
"postinstall": "pnpm run gen:theme-typings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export const Mobile: Story = {

function Story() {
return (
<div className="min-h-screen bg-background text-foreground py-4">
<div className="lg:p-10 container max-w-[1000px] flex flex-col gap-8">
<div className="min-h-screen bg-background py-4 text-foreground">
<div className="container flex max-w-[1000px] flex-col gap-8 lg:p-10">
<BadgeContainer label="Base">
<DangerSettingCard
title="This is a title"
Expand Down
14 changes: 7 additions & 7 deletions apps/dashboard/src/@/components/blocks/DangerSettingCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ export function DangerSettingCard(props: {
};
}) {
return (
<div className="border border-red-500/70 rounded-lg overflow-hidden">
<div className="px-4 lg:px-6 py-6 bg-muted/50">
<h3 className="text-xl font-semibold tracking-tight">{props.title}</h3>
<div className="overflow-hidden rounded-lg border border-red-500/70">
<div className="bg-muted/50 px-4 py-6 lg:px-6">
<h3 className="font-semibold text-xl tracking-tight">{props.title}</h3>

<p className="text-foreground text-sm mt-1.5 mb-4">
<p className="mt-1.5 mb-4 text-foreground text-sm">
{props.description}
</p>
</div>

<div className="bg-red-100 dark:bg-red-500/20 px-4 lg:px-6 py-4 flex justify-end border-red-500/70 border-t">
<div className="flex justify-end border-red-500/70 border-t bg-red-100 px-4 py-4 lg:px-6 dark:bg-red-500/20">
<Dialog>
<DialogTrigger asChild>
<Button
variant="destructive"
className="bg-red-600 hover:bg-red-600/80 text-white font-semibold gap-2"
className="gap-2 bg-red-600 font-semibold text-white hover:bg-red-600/80"
disabled={props.isPending}
>
{props.isPending && <Spinner className="size-3" />}
Expand All @@ -64,7 +64,7 @@ export function DangerSettingCard(props: {

<Button
variant="destructive"
className="bg-red-600 hover:bg-red-600/80 text-white font-semibold gap-2"
className="gap-2 bg-red-600 font-semibold text-white hover:bg-red-600/80"
onClick={props.buttonOnClick}
disabled={props.isPending}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function ExportToCSVButton(props: {
<Button
variant="outline"
disabled={props.disabled}
className={cn("border flex gap-2 items-center text-xs", props.className)}
className={cn("flex items-center gap-2 border text-xs", props.className)}
onClick={async () => {
exportMutation.mutate();
}}
Expand Down
8 changes: 4 additions & 4 deletions apps/dashboard/src/@/components/blocks/FormFieldSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ export function FormFieldSetup(props: {
}) {
return (
<div>
<div className="mb-2 inline-flex gap-1 items-center">
<div className="mb-2 inline-flex items-center gap-1">
<Label htmlFor={props.htmlFor}>{props.label}</Label>

{props.isRequired && (
<AsteriskIcon className="text-destructive-text size-3.5" />
<AsteriskIcon className="size-3.5 text-destructive-text" />
)}

{props.tooltip && (
<ToolTipLabel label={props.tooltip}>
<InfoIcon className="text-muted-foreground size-3.5" />
<InfoIcon className="size-3.5 text-muted-foreground" />
</ToolTipLabel>
)}
</div>
{props.children}
{props.errorMessage && (
<p className="text-destructive-text text-sm mt-1">
<p className="mt-1 text-destructive-text text-sm">
{props.errorMessage}
</p>
)}
Expand Down
6 changes: 3 additions & 3 deletions apps/dashboard/src/@/components/blocks/MobileSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function MobileSidebar(props: {
const defaultTrigger = (
<Button
className={cn(
"w-full lg:hidden text-left justify-between gap-2 bg-muted/50",
"w-full justify-between gap-2 bg-muted/50 text-left lg:hidden",
props.triggerClassName,
)}
variant="outline"
Expand All @@ -41,7 +41,7 @@ export function MobileSidebar(props: {
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>{props.trigger || defaultTrigger}</DialogTrigger>
<DialogContent
className="p-4 rounded-t-xl rounded-b-none"
className="rounded-t-xl rounded-b-none p-4"
dialogCloseClassName="hidden"
onClick={(e) => {
if (e.target instanceof HTMLAnchorElement) {
Expand All @@ -55,7 +55,7 @@ export function MobileSidebar(props: {
<Button size="sm" variant="ghost" asChild key={link.href}>
<NavLink
href={link.href}
className="!text-left justify-start flex gap-2 h-auto py-3"
className="!text-left flex h-auto justify-start gap-2 py-3"
activeClassName="bg-accent"
exactMatch={link.exactMatch}
tracking={link.tracking}
Expand Down
10 changes: 5 additions & 5 deletions apps/dashboard/src/@/components/blocks/SettingsCard.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export const Mobile: Story = {

function Story() {
return (
<div className="min-h-screen bg-background text-foreground py-6">
<div className="lg:p-10 container max-w-[1100px] flex flex-col gap-10">
<div className="min-h-screen bg-background py-6 text-foreground">
<div className="container flex max-w-[1100px] flex-col gap-10 lg:p-10">
<BadgeContainer label="No Header">
<SettingsCard
bottomText="This is bottom text"
Expand Down Expand Up @@ -84,7 +84,7 @@ function Story() {
isPending: false,
onClick: () => {},
}}
noPermissionText={"You do not have permission to edit this"}
noPermissionText="You do not have permission to edit this"
errorText={undefined}
>
<ChildrenPlaceholder />
Expand Down Expand Up @@ -154,8 +154,8 @@ function Story() {

function ChildrenPlaceholder() {
return (
<div className="h-10 flex items-center justify-center text-muted-foreground/50 text-xs">
{"CHILDREN GOES HERE"}
<div className="flex h-10 items-center justify-center text-muted-foreground/50 text-xs">
CHILDREN GOES HERE
</div>
);
}
10 changes: 5 additions & 5 deletions apps/dashboard/src/@/components/blocks/SettingsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ export function SettingsCard(props: {
};
}) {
return (
<div className="border border-border rounded-lg bg-muted/50 relative">
<div className="relative rounded-lg border border-border bg-muted/50">
<div
className={cn(
"border-b border-border px-4 lg:px-6 py-6 relative",
"relative border-border border-b px-4 py-6 lg:px-6",
props.noPermissionText && "cursor-not-allowed",
)}
>
{props.header && (
<>
<h3 className="text-xl font-semibold tracking-tight">
<h3 className="font-semibold text-xl tracking-tight">
{props.header.title}
</h3>
{props.header.description && (
<p className="text-foreground text-sm mt-1.5 mb-4">
<p className="mt-1.5 mb-4 text-foreground text-sm">
{props.header.description}
</p>
)}
Expand All @@ -43,7 +43,7 @@ export function SettingsCard(props: {
{props.children}
</div>

<div className="px-4 lg:px-6 py-3 flex items-center justify-between gap-2 min-h-[60px]">
<div className="flex min-h-[60px] items-center justify-between gap-2 px-4 py-3 lg:px-6">
{props.noPermissionText ? (
<p className="text-muted-foreground text-sm">
{props.noPermissionText}
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/src/@/components/blocks/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function Sidebar(props: SidebarContentProps) {
return (
<aside
className={cn(
"w-[230px] flex-shrink-0 hidden lg:block self-start sticky top-0",
"sticky top-0 hidden w-[230px] flex-shrink-0 self-start lg:block",
props.className,
)}
>
Expand All @@ -37,7 +37,7 @@ export function Sidebar(props: SidebarContentProps) {
<NavLink
key={link.href}
href={link.href}
className="py-2 hover:bg-muted rounded-md px-3 text-muted-foreground text-sm flex items-center gap-2"
className="flex items-center gap-2 rounded-md px-3 py-2 text-muted-foreground text-sm hover:bg-muted"
activeClassName="text-foreground"
exactMatch={link.exactMatch}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ function Story() {

function ContentPlaceholder() {
return (
<div className="bg-muted grow flex items-center justify-center">
<p className="text-muted-foreground text-3xl"> CHILDREN </p>
<div className="flex grow items-center justify-center bg-muted">
<p className="text-3xl text-muted-foreground"> CHILDREN </p>
</div>
);
}
4 changes: 2 additions & 2 deletions apps/dashboard/src/@/components/blocks/SidebarLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function SidebarLayout(props: {
return (
<div
className={cn(
"flex flex-col lg:flex-row gap-6 container px-4 w-full grow max-sm:pt-6",
"container flex w-full grow flex-col gap-6 px-4 max-sm:pt-6 lg:flex-row",
props.className,
)}
>
Expand All @@ -23,7 +23,7 @@ export function SidebarLayout(props: {
triggerClassName={props.mobileSidebarClassName}
/>
{/* min-w-0 is enough to ensure the content inside does not stretch this container */}
<main className="grow max-sm:w-full flex flex-col lg:pt-8 pb-10 min-w-0">
<main className="flex min-w-0 grow flex-col pb-10 max-sm:w-full lg:pt-8">
{children}
</main>
</div>
Expand Down
42 changes: 21 additions & 21 deletions apps/dashboard/src/@/components/blocks/app-footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,115 +21,115 @@ export function AppFooter(props: AppFooterProps) {
return (
<footer
className={cn(
"bg-muted/50 border-t border-border py-6 md:py-8 w-full",
"w-full border-border border-t bg-muted/50 py-6 md:py-8",
props.className,
)}
>
<div className="container flex flex-col gap-4 md:gap-6">
{/* top row */}
<div className="flex flex-col md:flex-row gap-4 md:justify-between md:items-center">
<div className="flex flex-row gap-3 items-center">
<div className="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
<div className="flex flex-row items-center gap-3">
<ThirdwebMiniLogo className="h-7" />
<p className="text-sm text-muted-foreground">© 2024 thirdweb</p>
<p className="text-muted-foreground text-sm">© 2024 thirdweb</p>
</div>
<div className="flex flex-row gap-3">
<Button size="icon" variant="ghost" asChild className="size-9">
<Link href="https://github.com/thirdweb-dev" target="_blank">
<SiGithub className="text-muted-foreground size-5" />
<SiGithub className="size-5 text-muted-foreground" />
</Link>
</Button>
<Button size="icon" variant="ghost" asChild className="size-9">
<Link href="https://www.tiktok.com/@thirdweb" target="_blank">
<SiTiktok className="text-muted-foreground size-5" />
<SiTiktok className="size-5 text-muted-foreground" />
</Link>
</Button>
<Button size="icon" variant="ghost" asChild className="size-9">
<Link href="https://www.instagram.com/thirdweb/" target="_blank">
<SiInstagram className="text-muted-foreground size-5" />
<SiInstagram className="size-5 text-muted-foreground" />
</Link>
</Button>
<Button size="icon" variant="ghost" asChild className="size-9">
<Link
href="hhttps://www.linkedin.com/company/third-web/"
target="_blank"
>
<SiLinkedin className="text-muted-foreground size-5" />
<SiLinkedin className="size-5 text-muted-foreground" />
</Link>
</Button>
<Button size="icon" variant="ghost" asChild className="size-9">
<Link href="https://www.youtube.com/@thirdweb_" target="_blank">
<SiYoutube className="text-muted-foreground size-5" />
<SiYoutube className="size-5 text-muted-foreground" />
</Link>
</Button>
<Button size="icon" variant="ghost" asChild className="size-9">
<Link href="https://discord.gg/thirdweb" target="_blank">
<SiDiscord className="text-muted-foreground size-5" />
<SiDiscord className="size-5 text-muted-foreground" />
</Link>
</Button>
<Button size="icon" variant="ghost" asChild className="size-9">
<Link href="https://www.reddit.com/r/thirdweb/" target="_blank">
<SiReddit className="text-muted-foreground size-5" />
<SiReddit className="size-5 text-muted-foreground" />
</Link>
</Button>
<Button size="icon" variant="ghost" asChild className="size-9">
<Link href="https://x.com/thirdweb" target="_blank">
<SiX className="text-muted-foreground size-5" />
<SiX className="size-5 text-muted-foreground" />
</Link>
</Button>
</div>
</div>
{/* bottom row */}
<div className="grid grid-rows-5 grid-cols-2 grid-flow-col gap-2 md:flex md:flex-row md:justify-between">
<div className="grid grid-flow-col grid-cols-2 grid-rows-5 gap-2 md:flex md:flex-row md:justify-between">
<Link
className="py-[6px] px-[10px] text-muted-foreground text-sm hover:underline"
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
href="/"
>
Home
</Link>
<Link
className="py-[6px] px-[10px] text-muted-foreground text-sm hover:underline"
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
href="https://blog.thirdweb.com"
target="_blank"
>
Blog
</Link>
<Link
className="py-[6px] px-[10px] text-muted-foreground text-sm hover:underline"
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
href="https://portal.thirdweb.com/changelog"
target="_blank"
>
Changelog
</Link>
<Link
className="py-[6px] px-[10px] text-muted-foreground text-sm hover:underline"
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
href="https://feedback.thirdweb.com/"
target="_blank"
>
Feedback
</Link>
<Link
className="py-[6px] px-[10px] text-muted-foreground text-sm hover:underline"
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
href="https://thirdweb.com/privacy"
target="_blank"
>
Privacy Policy
</Link>
<Link
className="py-[6px] px-[10px] text-muted-foreground text-sm hover:underline"
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
href="https://thirdweb.com/tos"
target="_blank"
>
Terms of Service
</Link>
<Link
className="py-[6px] px-[10px] text-muted-foreground text-sm hover:underline"
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
href="https://thirdweb.com/gas"
target="_blank"
>
Gas Estimator
</Link>
<Link
className="py-[6px] px-[10px] text-muted-foreground text-sm hover:underline"
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
href="https://thirdweb.com/chainlist"
target="_blank"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function createList(len: number) {

function Story() {
return (
<div className="py-6 max-w-[600px] mx-auto w-full px-4 flex flex-col gap-6">
<div className="mx-auto flex w-full max-w-[600px] flex-col gap-6 px-4 py-6">
<VariantTest defaultValues={[]} storyLabel="5 items" listLen={5} />
<VariantTest defaultValues={[]} storyLabel="5000 items" listLen={5000} />
<VariantTest
Expand Down
Loading

0 comments on commit 3dd7144

Please sign in to comment.