diff --git a/core/editor/photo.tsx b/core/editor/photo.tsx index 5dcae9c..e8be11d 100644 --- a/core/editor/photo.tsx +++ b/core/editor/photo.tsx @@ -29,6 +29,7 @@ export const Photo = ({ className, placeholder }: PropsWithChildren) URL.revokeObjectURL(file) } } + return }, [files, setSrc]) return ( diff --git a/core/editor/tools/board-background.tsx b/core/editor/tools/board-background.tsx index aa0a0c8..624a34b 100644 --- a/core/editor/tools/board-background.tsx +++ b/core/editor/tools/board-background.tsx @@ -25,7 +25,7 @@ export const BoardBackground = () => { const mesh = (enable: boolean) => { if (enable) { const [, i] = meshGradient(colord(color).toHex(), { amount: 5 }) - setImage(i) + setImage(i!) } else { setImage('none') } diff --git a/core/editor/tools/frame-scale.tsx b/core/editor/tools/frame-scale.tsx index 4bcc9cd..16788a4 100644 --- a/core/editor/tools/frame-scale.tsx +++ b/core/editor/tools/frame-scale.tsx @@ -21,7 +21,7 @@ export const FrameScale = () => { max={1} min={0.6} onValueChange={value => { - setScale(value[0]) + setScale(value[0]!) }} step={0.01} value={[scale]} diff --git a/core/editor/tools/photo-blur-vignette.tsx b/core/editor/tools/photo-blur-vignette.tsx index 8834044..372a910 100644 --- a/core/editor/tools/photo-blur-vignette.tsx +++ b/core/editor/tools/photo-blur-vignette.tsx @@ -12,9 +12,9 @@ export const PhotoBlurVignette = () => { return (
Blur Vignette
- setInset(value[0])} value={[inset]} /> - setTransition(value[0])} value={[transition]} /> - setBlur(value[0])} value={[blur]} /> + setInset(value[0]!)} value={[inset]} /> + setTransition(value[0]!)} value={[transition]} /> + setBlur(value[0]!)} value={[blur]} />
) } diff --git a/core/ui/checkbox.tsx b/core/ui/checkbox.tsx index cf10bed..f4b188a 100644 --- a/core/ui/checkbox.tsx +++ b/core/ui/checkbox.tsx @@ -1,26 +1,25 @@ -"use client" +'use client' -import * as React from "react" -import * as CheckboxPrimitive from "@radix-ui/react-checkbox" -import { CheckIcon } from "@radix-ui/react-icons" +import * as React from 'react' -import { cn } from "~/core/utils" +import * as CheckboxPrimitive from '@radix-ui/react-checkbox' +import { CheckIcon } from '@radix-ui/react-icons' + +import { cn } from '~/core/utils' const Checkbox = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + diff --git a/core/ui/color/generator.ts b/core/ui/color/generator.ts index 5371403..769fee2 100644 --- a/core/ui/color/generator.ts +++ b/core/ui/color/generator.ts @@ -48,7 +48,7 @@ const format = (input: Input, args: Args): Output => { return args.format === 'hex' ? rgbToHex(rgb) : rgb }) - return args.amount === 1 || list.length === 1 ? list[0] : list + return args.amount === 1 || list.length === 1 ? list[0]! : list } const group = (number: number, grouping: number): number => { @@ -83,9 +83,9 @@ const getAverage = (data: Data, args: Args): Output => { const rgb = { b: 0, g: 0, r: 0 } for (let i = 0; i < data.length; i += gap) { - rgb.r += data[i] - rgb.g += data[i + 1] - rgb.b += data[i + 2] + rgb.r += data[i]! + rgb.g += data[i + 1]! + rgb.b += data[i + 2]! } return format([[Math.round(rgb.r / amount), Math.round(rgb.g / amount), Math.round(rgb.b / amount)]], args) @@ -96,9 +96,11 @@ const getProminent = (data: Data, args: Args): Output => { const colors: { [key: string]: number } = {} for (let i = 0; i < data.length; i += gap) { - const rgb = [group(data[i], args.group), group(data[i + 1], args.group), group(data[i + 2], args.group)].join(',') + const rgb = [group(data[i]!, args.group), group(data[i + 1]!, args.group), group(data[i + 2]!, args.group)].join( + ',', + ) - colors[rgb] = colors[rgb] ? colors[rgb] + 1 : 1 + colors[rgb] = colors[rgb] ? colors[rgb]! + 1 : 1 } return format( diff --git a/core/ui/tabs.tsx b/core/ui/tabs.tsx index 3518d2a..8d94315 100644 --- a/core/ui/tabs.tsx +++ b/core/ui/tabs.tsx @@ -1,9 +1,10 @@ -"use client" +'use client' -import * as React from "react" -import * as TabsPrimitive from "@radix-ui/react-tabs" +import * as React from 'react' -import { cn } from "~/core/utils" +import * as TabsPrimitive from '@radix-ui/react-tabs' + +import { cn } from '~/core/utils' const Tabs = TabsPrimitive.Root @@ -12,11 +13,11 @@ const TabsList = React.forwardRef< React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )) @@ -27,11 +28,11 @@ const TabsTrigger = React.forwardRef< React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )) @@ -42,14 +43,14 @@ const TabsContent = React.forwardRef< React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )) TabsContent.displayName = TabsPrimitive.Content.displayName -export { Tabs, TabsList, TabsTrigger, TabsContent } +export { Tabs, TabsContent, TabsList, TabsTrigger } diff --git a/core/ui/upload/use-upload.ts b/core/ui/upload/use-upload.ts index 1f98d45..b226622 100644 --- a/core/ui/upload/use-upload.ts +++ b/core/ui/upload/use-upload.ts @@ -27,6 +27,7 @@ export const useUpload = ({ accept = '*', multiple }: UseUploadProps = {}) => { input.removeEventListener('change', handleChange) } } + return }, []) return [inputRef, files] as const diff --git a/package.json b/package.json index 9954e6e..2d5cf77 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "add": "pnpm dlx shadcn-ui@latest add", "build": "next build", "dev": "next dev", - "lint": "next lint", + "lint": "tsc --noEmit", "start": "next start" }, "dependencies": { diff --git a/tsconfig.json b/tsconfig.json index 3b83ab0..07f7be5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,9 +2,7 @@ "extends": "@nnecec/tsconfig/next.json", "compilerOptions": { "paths": { - "~/*": [ - "./*" - ] + "~/*": ["./*"] }, "plugins": [ { @@ -13,14 +11,6 @@ ], "allowJs": true }, - "include": [ - "next-env.d.ts", - "**/*.ts", - "**/*.tsx", - "next.config.mjs", - ".next/types/**/*.ts" - ], - "exclude": [ - "node_modules" - ] + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "next.config.mjs", ".next/types/**/*.ts"], + "exclude": ["node_modules"] }