chore(root): migrate to biome

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-09-16 12:20:40 +02:00
parent 1f6e198336
commit 32e91959f6
383 changed files with 1943 additions and 3085 deletions

View File

@@ -1,7 +1,7 @@
import { forwardRef } from 'react';
import { cn } from '@/utils/cn';
import { slug } from '@/utils/slug';
import type { LucideIcon } from 'lucide-react';
import { forwardRef } from 'react';
import type { ControllerRenderProps } from 'react-hook-form';
import { Switch } from '../ui/switch';
@@ -17,7 +17,7 @@ type Props = {
export const CheckboxItem = forwardRef<HTMLButtonElement, Props>(
(
{ label, description, Icon, children, onChange, value, disabled, error },
ref
ref,
) => {
const id = slug(label);
return (
@@ -25,7 +25,7 @@ export const CheckboxItem = forwardRef<HTMLButtonElement, Props>(
<label
className={cn(
'flex items-center gap-4 px-4 py-6 transition-colors hover:bg-def-200',
disabled && 'cursor-not-allowed opacity-50'
disabled && 'cursor-not-allowed opacity-50',
)}
htmlFor={id}
>
@@ -48,7 +48,7 @@ export const CheckboxItem = forwardRef<HTMLButtonElement, Props>(
{children}
</div>
);
}
},
);
CheckboxItem.displayName = 'CheckboxItem';

View File

@@ -13,6 +13,7 @@ type Props = {
const CopyInput = ({ label, value, className }: Props) => {
return (
<button
type="button"
className={cn('w-full text-left', className)}
onClick={() => clipboard(value)}
>

View File

@@ -1,5 +1,5 @@
import { forwardRef } from 'react';
import { BanIcon, InfoIcon } from 'lucide-react';
import { forwardRef } from 'react';
import { Input } from '../ui/input';
import type { InputProps } from '../ui/input';
@@ -57,7 +57,7 @@ export const InputWithLabel = forwardRef<HTMLInputElement, InputWithLabelProps>(
<Input ref={ref} id={props.label} {...props} />
</WithLabel>
);
}
},
);
InputWithLabel.displayName = 'InputWithLabel';

View File

@@ -1,11 +1,11 @@
// Based on Christin Alares tag input component (https://github.com/christianalares/seventy-seven)
import type { ElementRef } from 'react';
import { useEffect, useRef, useState } from 'react';
import { Button } from '@/components/ui/button';
import { cn } from '@/utils/cn';
import { useAnimate } from 'framer-motion';
import { XIcon } from 'lucide-react';
import type { ElementRef } from 'react';
import { useEffect, useRef, useState } from 'react';
type Props = {
placeholder: string;
@@ -47,7 +47,7 @@ const TagInput = ({
e.preventDefault();
const tagAlreadyExists = value.some(
(tag) => tag.toLowerCase() === inputValue.toLowerCase()
(tag) => tag.toLowerCase() === inputValue.toLowerCase(),
);
if (inputValue) {
@@ -59,7 +59,7 @@ const TagInput = ({
},
{
duration: 0.3,
}
},
);
return;
}
@@ -101,7 +101,7 @@ const TagInput = ({
ref={scope}
className={cn(
'inline-flex w-full flex-wrap items-center gap-2 rounded-md border border-input p-1 px-3 ring-offset-background has-[input:focus]:ring-2 has-[input:focus]:ring-ring has-[input:focus]:ring-offset-1',
!!error && 'border-destructive'
!!error && 'border-destructive',
)}
>
{value.map((tag, i) => {
@@ -116,7 +116,7 @@ const TagInput = ({
isMarkedForDeletion &&
i === value.length - 1 &&
'bg-destructive-foreground ring-2 ring-destructive/50 ring-offset-1',
isCreating && 'opacity-60'
isCreating && 'opacity-60',
)}
>
{renderTag ? renderTag(tag) : tag}