Skip to content

Commit 2faffb4

Browse files
authored
refactor: reorganize utility files into lib/ folder (#209)
* refactor: reorganize utility files into lib/ folder * chore: add ESLint rule to prevent duplicate imports
1 parent 627219a commit 2faffb4

27 files changed

+30
-33
lines changed

eslint.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export default tseslint.config(
5151
disallowTypeAnnotations: false,
5252
},
5353
],
54+
// Prevent duplicate imports from the same module
55+
'no-duplicate-imports': 'error',
5456
},
5557
}
5658
)

src/components/layout/data/sidebar-data.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ import {
1818
Users,
1919
MessagesSquare,
2020
ShieldCheck,
21+
AudioWaveform,
22+
Command,
23+
GalleryVerticalEnd,
2124
} from 'lucide-react'
22-
import { AudioWaveform, Command, GalleryVerticalEnd } from 'lucide-react'
2325
import { ClerkLogo } from '@/assets/clerk-logo'
2426
import { type SidebarData } from '../types'
2527

src/features/auth/forgot-password/components/forgot-password-form.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { zodResolver } from '@hookform/resolvers/zod'
55
import { useNavigate } from '@tanstack/react-router'
66
import { ArrowRight, Loader2 } from 'lucide-react'
77
import { toast } from 'sonner'
8-
import { cn } from '@/lib/utils'
9-
import { sleep } from '@/utils/sleep'
8+
import { sleep, cn } from '@/lib/utils'
109
import { Button } from '@/components/ui/button'
1110
import {
1211
Form,

src/features/auth/otp/components/otp-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { z } from 'zod'
33
import { useForm } from 'react-hook-form'
44
import { zodResolver } from '@hookform/resolvers/zod'
55
import { useNavigate } from '@tanstack/react-router'
6+
import { showSubmittedData } from '@/lib/show-submitted-data'
67
import { cn } from '@/lib/utils'
7-
import { showSubmittedData } from '@/utils/show-submitted-data'
88
import { Button } from '@/components/ui/button'
99
import {
1010
Form,

src/features/auth/sign-in/components/user-auth-form.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import { Loader2, LogIn } from 'lucide-react'
77
import { toast } from 'sonner'
88
import { IconFacebook, IconGithub } from '@/assets/brand-icons'
99
import { useAuthStore } from '@/stores/auth-store'
10-
import { cn } from '@/lib/utils'
11-
import { sleep } from '@/utils/sleep'
10+
import { sleep, cn } from '@/lib/utils'
1211
import { Button } from '@/components/ui/button'
1312
import {
1413
Form,

src/features/chats/components/new-chat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect, useState } from 'react'
22
import { Check, X } from 'lucide-react'
3-
import { showSubmittedData } from '@/utils/show-submitted-data'
3+
import { showSubmittedData } from '@/lib/show-submitted-data'
44
import { Badge } from '@/components/ui/badge'
55
import { Button } from '@/components/ui/button'
66
import {

src/features/settings/account/account-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { z } from 'zod'
22
import { useForm } from 'react-hook-form'
33
import { CaretSortIcon, CheckIcon } from '@radix-ui/react-icons'
44
import { zodResolver } from '@hookform/resolvers/zod'
5+
import { showSubmittedData } from '@/lib/show-submitted-data'
56
import { cn } from '@/lib/utils'
6-
import { showSubmittedData } from '@/utils/show-submitted-data'
77
import { Button } from '@/components/ui/button'
88
import {
99
Command,

src/features/settings/appearance/appearance-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { useForm } from 'react-hook-form'
33
import { ChevronDownIcon } from '@radix-ui/react-icons'
44
import { zodResolver } from '@hookform/resolvers/zod'
55
import { fonts } from '@/config/fonts'
6+
import { showSubmittedData } from '@/lib/show-submitted-data'
67
import { cn } from '@/lib/utils'
7-
import { showSubmittedData } from '@/utils/show-submitted-data'
88
import { useFont } from '@/context/font-provider'
99
import { useTheme } from '@/context/theme-provider'
1010
import { Button, buttonVariants } from '@/components/ui/button'

src/features/settings/components/sidebar-nav.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useState, type JSX } from 'react'
2-
import { useLocation, useNavigate } from '@tanstack/react-router'
3-
import { Link } from '@tanstack/react-router'
2+
import { useLocation, useNavigate, Link } from '@tanstack/react-router'
43
import { cn } from '@/lib/utils'
54
import { buttonVariants } from '@/components/ui/button'
65
import { ScrollArea } from '@/components/ui/scroll-area'

src/features/settings/display/display-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { z } from 'zod'
22
import { useForm } from 'react-hook-form'
33
import { zodResolver } from '@hookform/resolvers/zod'
4-
import { showSubmittedData } from '@/utils/show-submitted-data'
4+
import { showSubmittedData } from '@/lib/show-submitted-data'
55
import { Button } from '@/components/ui/button'
66
import { Checkbox } from '@/components/ui/checkbox'
77
import {

0 commit comments

Comments
 (0)