Skip to content

Commit 3e402bd

Browse files
authored
lint (#36)
1 parent 14028ab commit 3e402bd

File tree

4 files changed

+45
-49
lines changed

4 files changed

+45
-49
lines changed

Diff for: app/components/ui/avatar.tsx

+40-43
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,45 @@
1-
import * as React from "react"
2-
import * as AvatarPrimitive from "@radix-ui/react-avatar"
1+
import { cn } from '@/lib/utils';
2+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
33

4-
import { cn } from "@/lib/utils"
4+
import * as React from 'react';
55

6-
const Avatar = React.forwardRef<
7-
React.ElementRef<typeof AvatarPrimitive.Root>,
8-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
9-
>(({ className, ...props }, ref) => (
10-
<AvatarPrimitive.Root
11-
ref={ref}
12-
className={cn(
13-
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
14-
className
15-
)}
16-
{...props}
17-
/>
18-
))
19-
Avatar.displayName = AvatarPrimitive.Root.displayName
6+
function Avatar({ ref, className, ...props }: React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> & { ref?: React.RefObject<React.ElementRef<typeof AvatarPrimitive.Root>> }) {
7+
return (
8+
<AvatarPrimitive.Root
9+
className={cn(
10+
'relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full',
11+
className,
12+
)}
13+
ref={ref}
14+
{...props}
15+
/>
16+
);
17+
}
18+
Avatar.displayName = AvatarPrimitive.Root.displayName;
2019

21-
const AvatarImage = React.forwardRef<
22-
React.ElementRef<typeof AvatarPrimitive.Image>,
23-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
24-
>(({ className, ...props }, ref) => (
25-
<AvatarPrimitive.Image
26-
ref={ref}
27-
className={cn("aspect-square h-full w-full", className)}
28-
{...props}
29-
/>
30-
))
31-
AvatarImage.displayName = AvatarPrimitive.Image.displayName
20+
function AvatarImage({ ref, className, ...props }: React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image> & { ref?: React.RefObject<React.ElementRef<typeof AvatarPrimitive.Image>> }) {
21+
return (
22+
<AvatarPrimitive.Image
23+
className={cn('aspect-square h-full w-full', className)}
24+
ref={ref}
25+
{...props}
26+
/>
27+
);
28+
}
29+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
3230

33-
const AvatarFallback = React.forwardRef<
34-
React.ElementRef<typeof AvatarPrimitive.Fallback>,
35-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
36-
>(({ className, ...props }, ref) => (
37-
<AvatarPrimitive.Fallback
38-
ref={ref}
39-
className={cn(
40-
"flex h-full w-full items-center justify-center rounded-full bg-muted",
41-
className
42-
)}
43-
{...props}
44-
/>
45-
))
46-
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
31+
function AvatarFallback({ ref, className, ...props }: React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback> & { ref?: React.RefObject<React.ElementRef<typeof AvatarPrimitive.Fallback>> }) {
32+
return (
33+
<AvatarPrimitive.Fallback
34+
className={cn(
35+
'flex h-full w-full items-center justify-center rounded-full bg-muted',
36+
className,
37+
)}
38+
ref={ref}
39+
{...props}
40+
/>
41+
);
42+
}
43+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
4744

48-
export { Avatar, AvatarImage, AvatarFallback }
45+
export { Avatar, AvatarFallback, AvatarImage };

Diff for: app/global.css

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ body {
2626
min-height: calc(100vh - var(--header-height) - var(--footer-height));
2727
}
2828

29-
main:has([data-scrollable="false"]) {
29+
main:has([data-scrollable='false']) {
3030
height: calc(100vh - var(--header-height) - var(--footer-height));
3131
}
3232
}
@@ -95,7 +95,6 @@ body {
9595
}
9696
}
9797

98-
9998
@layer base {
10099
* {
101100
@apply border-border;

Diff for: app/lib/utils.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { clsx, type ClassValue } from "clsx"
2-
import { twMerge } from "tailwind-merge"
1+
import { type ClassValue, clsx } from 'clsx';
2+
import { twMerge } from 'tailwind-merge';
33

44
export function cn(...inputs: ClassValue[]) {
5-
return twMerge(clsx(inputs))
5+
return twMerge(clsx(inputs));
66
}

Diff for: eslint.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import antfu from '@antfu/eslint-config';
22
import tailwind from 'eslint-plugin-tailwindcss';
33

44
export default antfu({
5-
ignores: ['*.md', '*.json', '.github/**/*', 'wrangler.toml', 'worker-configuration.d.ts'],
5+
ignores: ['*.md', '*.json', '.github/**/*', '.vscode/**/*', 'wrangler.toml', 'worker-configuration.d.ts'],
66
include: ['app/**/*.ts', 'app/**/*.tsx', 'app/**/*.js', 'app/**/*.jsx', 'prisma/*.ts'],
77
formatters: true,
88
stylistic: {

0 commit comments

Comments
 (0)