From 85282593b6cec5ee9ea8b6c93dc44c4c8abc1d35 Mon Sep 17 00:00:00 2001 From: v1rtl Date: Sat, 30 Nov 2024 03:11:18 +0200 Subject: [PATCH] remove unused code and replace some any with actual types --- components/package.json | 2 -- .../src/components/atoms/FileInput/FileInput.test.tsx | 2 +- components/src/components/molecules/Checkbox/Checkbox.tsx | 3 +-- .../components/molecules/CurrencyToggle/CurrencyToggle.tsx | 5 +---- components/src/components/molecules/Input/Input.tsx | 2 +- .../src/components/molecules/RadioButton/Radio.test.tsx | 7 ++++--- .../molecules/RadioButtonGroup/RadioButtonGroup.test.tsx | 2 +- components/src/components/molecules/Select/Select.test.tsx | 3 +-- .../src/components/molecules/Textarea/Textarea.test.tsx | 2 +- components/src/hooks/useCopied.ts | 4 ++-- components/src/hooks/useDocumentEvent.ts | 2 +- components/src/utils/debounce.ts | 3 ++- components/test/utils.ts | 7 ++++--- docs/src/pages/guides/[slug].tsx | 1 + 14 files changed, 21 insertions(+), 24 deletions(-) diff --git a/components/package.json b/components/package.json index f106cc30..537a0a73 100644 --- a/components/package.json +++ b/components/package.json @@ -30,8 +30,6 @@ "scripts": { "build": "vite build", "build:watch": "vite build --watch --mode development", - "lint": "eslint . -c eslint.config.mjs", - "lint:fix": "eslint . -c eslint.config.mjs --fix", "lint:types": "tsc --noEmit", "prepack": "pnpm build", "test": "vitest run", diff --git a/components/src/components/atoms/FileInput/FileInput.test.tsx b/components/src/components/atoms/FileInput/FileInput.test.tsx index dd5f26db..127683a5 100644 --- a/components/src/components/atoms/FileInput/FileInput.test.tsx +++ b/components/src/components/atoms/FileInput/FileInput.test.tsx @@ -18,7 +18,7 @@ describe('', () => { }) it('should pass a ref down', async () => { - const ref = { current: null } as React.RefObject + const ref = { current: null } as React.RefObject render( {context => diff --git a/components/src/components/molecules/Checkbox/Checkbox.tsx b/components/src/components/molecules/Checkbox/Checkbox.tsx index 88d4d290..f01fd67e 100644 --- a/components/src/components/molecules/Checkbox/Checkbox.tsx +++ b/components/src/components/molecules/Checkbox/Checkbox.tsx @@ -58,8 +58,7 @@ Omit< | 'width' > -// TODO: Fix the SVG type -const SVG = (props: any) => +const SVG = (props: React.SVGProps) => const InputBox = React.forwardRef( ({ baseColor, baseTheme, disabled, checked, ...props }, ref) => ( diff --git a/components/src/components/molecules/CurrencyToggle/CurrencyToggle.tsx b/components/src/components/molecules/CurrencyToggle/CurrencyToggle.tsx index 0ec94159..25f15692 100644 --- a/components/src/components/molecules/CurrencyToggle/CurrencyToggle.tsx +++ b/components/src/components/molecules/CurrencyToggle/CurrencyToggle.tsx @@ -26,10 +26,9 @@ const Container = (props: BoxProps) => ( ) const Label = ({ - $type, $size, ...props -}: BoxProps & { $size: Size, $type: 'eth' | 'fiat' }) => ( +}: BoxProps & { $size: Size }) => (