Skip to content

Commit

Permalink
feat: fix biome to format classes
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbrusegard committed Sep 16, 2024
1 parent e8814a7 commit 2cb35ec
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
11 changes: 9 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.1/schema.json",
"formatter": {
"enabled": true,
"indentStyle": "space"
Expand All @@ -12,7 +12,14 @@
"rules": {
"recommended": true,
"nursery": {
"useSortedClasses": "warn"
"useSortedClasses": {
"level": "warn",
"fix": "safe",
"options": {
"attributes": ["className"],
"functions": ["cva", "cx"]
}
}
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"prebuild": "next telemetry disable",
"build": "next build",
"dev": "next dev --turbo",
"lint": "biome check --write --unsafe",
"lint": "biome check --write",
"start": "next start",
"db:start": "docker-compose up db",
"db:generate": "drizzle-kit generate",
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useTranslations } from 'next-intl';
function Header() {
const t = useTranslations('layout');
return (
<header className='sticky top-0 z-20 mx-auto flex min-h-14 w-full max-w-screen-2xl items-center justify-between border-border/40 border-b bg-background/95 ~px-4/24 backdrop-blur supports-[backdrop-filter]:bg-background/60'>
<header className='~px-4/24 sticky top-0 z-20 mx-auto flex min-h-14 w-full max-w-screen-2xl items-center justify-between border-border/40 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60'>
<MobileSheet
className='flex md:hidden'
t={{
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function Main({ children, className }: MainProps) {
return (
<main
className={cx(
'mx-auto w-full max-w-screen-2xl flex-grow ~px-4/24',
'~px-4/24 mx-auto w-full max-w-screen-2xl flex-grow',
className,
)}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type VariantProps, cva, cx } from '@/lib/utils';
import type * as React from 'react';

const badgeVariants = cva({
base: 'inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
base: 'inline-flex items-center rounded-md border px-2.5 py-0.5 font-semibold text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
variants: {
variant: {
default:
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Slot } from '@radix-ui/react-slot';
import * as React from 'react';

const buttonVariants = cva({
base: 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
base: 'inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium text-sm ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
variants: {
variant: {
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
Expand Down
10 changes: 5 additions & 5 deletions src/components/ui/Sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ const SheetOverlay = React.forwardRef<
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;

const sheetVariants = cva({
base: 'fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out',
base: 'fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:duration-300 data-[state=open]:duration-500',
variants: {
side: {
top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
top: 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 border-b',
bottom:
'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 border-t',
left: 'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
right:
'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',
},
},
defaultVariants: {
Expand Down

0 comments on commit 2cb35ec

Please sign in to comment.