Skip to content

Commit ddec3b2

Browse files
authored
chore: update prettier-plugin-tailwindcss order (#88)
* chore: make prettier-plugin-tailwindcss works Update the position of `prettier-plugin-tailwindcss` in `.prettierrc` plugin array. Otherwise, the plugin doesn't work as expected. * refactor: update formatting for classNames
1 parent f7223b4 commit ddec3b2

File tree

22 files changed

+39
-39
lines changed

22 files changed

+39
-39
lines changed

.prettierrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"bracketSpacing": true,
1010
"endOfLine": "lf",
1111
"plugins": [
12-
"prettier-plugin-tailwindcss",
13-
"@trivago/prettier-plugin-sort-imports"
12+
"@trivago/prettier-plugin-sort-imports",
13+
"prettier-plugin-tailwindcss"
1414
],
1515
"importOrder": [
1616
"^path$",

src/components/layout/header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export const Header = ({
3131
return (
3232
<header
3333
className={cn(
34-
'flex items-center gap-3 sm:gap-4 bg-background p-4 h-16',
35-
fixed && 'header-fixed peer/header w-[inherit] fixed z-50 rounded-md',
34+
'flex h-16 items-center gap-3 bg-background p-4 sm:gap-4',
35+
fixed && 'header-fixed peer/header fixed z-50 w-[inherit] rounded-md',
3636
offset > 10 && fixed ? 'shadow' : 'shadow-none',
3737
className
3838
)}

src/components/layout/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const Main = ({ fixed, ...props }: MainProps) => {
1212
className={cn(
1313
'peer-[.header-fixed]/header:mt-16',
1414
'px-4 py-6',
15-
fixed && 'fixed-main flex flex-col flex-grow overflow-hidden'
15+
fixed && 'fixed-main flex flex-grow flex-col overflow-hidden'
1616
)}
1717
{...props}
1818
/>

src/components/layout/nav-group.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function NavGroup({ title, items }: NavGroup) {
5454
}
5555

5656
const NavBadge = ({ children }: { children: ReactNode }) => (
57-
<Badge className='text-xs rounded-full px-1 py-0'>{children}</Badge>
57+
<Badge className='rounded-full px-1 py-0 text-xs'>{children}</Badge>
5858
)
5959

6060
const SidebarMenuLink = ({ item, href }: { item: NavLink; href: string }) => {

src/components/search.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function Search({ className = '', placeholder = 'Search' }: Props) {
1515
<Button
1616
variant='outline'
1717
className={cn(
18-
'relative h-8 w-full flex-1 md:flex-none justify-start rounded-md bg-muted/25 hover:bg-muted/50 text-sm font-normal text-muted-foreground shadow-none sm:pr-12 md:w-40 lg:w-56 xl:w-64',
18+
'relative h-8 w-full flex-1 justify-start rounded-md bg-muted/25 text-sm font-normal text-muted-foreground shadow-none hover:bg-muted/50 sm:pr-12 md:w-40 md:flex-none lg:w-56 xl:w-64',
1919
className
2020
)}
2121
onClick={() => setOpen(true)}

src/components/ui/command.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const CommandItem = React.forwardRef<
124124
<CommandPrimitive.Item
125125
ref={ref}
126126
className={cn(
127-
'relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
127+
'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
128128
className
129129
)}
130130
{...props}

src/components/ui/dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const DialogOverlay = React.forwardRef<
2020
<DialogPrimitive.Overlay
2121
ref={ref}
2222
className={cn(
23-
'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
23+
'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
2424
className
2525
)}
2626
{...props}

src/components/ui/dropdown-menu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const DropdownMenuSubTrigger = React.forwardRef<
2424
<DropdownMenuPrimitive.SubTrigger
2525
ref={ref}
2626
className={cn(
27-
'flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
27+
'flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
2828
inset && 'pl-8',
2929
className
3030
)}

src/components/ui/sheet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const SheetOverlay = React.forwardRef<
2020
>(({ className, ...props }, ref) => (
2121
<SheetPrimitive.Overlay
2222
className={cn(
23-
'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
23+
'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
2424
className
2525
)}
2626
{...props}

src/components/ui/sidebar.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ const Sidebar = React.forwardRef<
224224
return (
225225
<div
226226
ref={ref}
227-
className='group peer hidden md:block text-sidebar-foreground'
227+
className='group peer hidden text-sidebar-foreground md:block'
228228
data-state={state}
229229
data-collapsible={state === 'collapsed' ? collapsible : ''}
230230
data-variant={variant}
@@ -233,7 +233,7 @@ const Sidebar = React.forwardRef<
233233
{/* This is what handles the sidebar gap on desktop */}
234234
<div
235235
className={cn(
236-
'duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear',
236+
'relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear',
237237
'group-data-[collapsible=offcanvas]:w-0',
238238
'group-data-[side=right]:rotate-180',
239239
variant === 'floating' || variant === 'inset'
@@ -243,7 +243,7 @@ const Sidebar = React.forwardRef<
243243
/>
244244
<div
245245
className={cn(
246-
'duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex',
246+
'fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex',
247247
side === 'left'
248248
? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'
249249
: 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',
@@ -448,7 +448,7 @@ const SidebarGroupLabel = React.forwardRef<
448448
ref={ref}
449449
data-sidebar='group-label'
450450
className={cn(
451-
'duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
451+
'flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
452452
'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0',
453453
className
454454
)}
@@ -640,7 +640,7 @@ const SidebarMenuBadge = React.forwardRef<
640640
ref={ref}
641641
data-sidebar='menu-badge'
642642
className={cn(
643-
'absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none',
643+
'pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground',
644644
'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground',
645645
'peer-data-[size=sm]/menu-button:top-1',
646646
'peer-data-[size=default]/menu-button:top-1.5',
@@ -668,7 +668,7 @@ const SidebarMenuSkeleton = React.forwardRef<
668668
<div
669669
ref={ref}
670670
data-sidebar='menu-skeleton'
671-
className={cn('rounded-md h-8 flex gap-2 px-2 items-center', className)}
671+
className={cn('flex h-8 items-center gap-2 rounded-md px-2', className)}
672672
{...props}
673673
>
674674
{showIcon && (
@@ -678,7 +678,7 @@ const SidebarMenuSkeleton = React.forwardRef<
678678
/>
679679
)}
680680
<Skeleton
681-
className='h-4 flex-1 max-w-[--skeleton-width]'
681+
className='h-4 max-w-[--skeleton-width] flex-1'
682682
data-sidebar='menu-skeleton-text'
683683
style={
684684
{

0 commit comments

Comments
 (0)