From b1cbefb73456fb4ed1bc417028beda94fc038603 Mon Sep 17 00:00:00 2001 From: Kevin Kipp Date: Fri, 9 Aug 2024 17:57:49 -0500 Subject: [PATCH] A few tweaks on proposed changes - Move to using ComponentProps instead of IntrinsicElements - Remove void checking of functions - Use arrow function for inner function --- .eslintrc.cjs | 8 ++++ app/components/AudioInputSelector.tsx | 1 - app/components/Button.tsx | 4 +- app/components/Icon/Icon.tsx | 10 +++-- .../Icon/custom/MicrophoneSlashIcon.tsx | 6 +-- app/components/Input.tsx | 45 +++++++++---------- app/components/Participant.tsx | 4 +- app/components/TextArea.tsx | 4 +- app/components/VideoSrcObject.tsx | 7 +-- app/hooks/useBroadcastStatus.ts | 3 +- app/utils/blurVideoTrack.ts | 1 - app/utils/rxjs/getUserMediaTrack$.ts | 2 - 12 files changed, 47 insertions(+), 48 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 253c6ce4..9b5d474d 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -30,6 +30,14 @@ module.exports = { argsIgnorePattern: '^_', }, ], + '@typescript-eslint/no-misused-promises': [ + 'error', + { + checksConditionals: true, + checksVoidReturn: false, + checksSpreads: true, + }, + ], }, root: true, } diff --git a/app/components/AudioInputSelector.tsx b/app/components/AudioInputSelector.tsx index 33442046..627d85c7 100644 --- a/app/components/AudioInputSelector.tsx +++ b/app/components/AudioInputSelector.tsx @@ -29,7 +29,6 @@ export const AudioInputSelector: FC<{ id?: string }> = ({ id }) => { return (
- {/* eslint-disable-next-line @typescript-eslint/no-misused-promises */} -)) +export const Input = forwardRef>( + ({ className, ...rest }, ref) => ( + + ) +) Input.displayName = 'Input' diff --git a/app/components/Participant.tsx b/app/components/Participant.tsx index 5037ab8f..4f35bd4c 100644 --- a/app/components/Participant.tsx +++ b/app/components/Participant.tsx @@ -1,5 +1,5 @@ import { VisuallyHidden } from '@radix-ui/react-visually-hidden' -import { forwardRef, useEffect } from 'react' +import { forwardRef, useEffect, type ComponentProps } from 'react' import { Flipped } from 'react-flip-toolkit' import { useDeadPulledTrackMonitor } from '~/hooks/useDeadPulledTrackMonitor' import { useRoomContext } from '~/hooks/useRoomContext' @@ -19,7 +19,7 @@ import { VideoSrcObject } from './VideoSrcObject' export const Participant = forwardRef< HTMLDivElement, - React.JSX.IntrinsicElements['div'] & { + ComponentProps<'div'> & { flipId: string isScreenShare?: boolean user: User diff --git a/app/components/TextArea.tsx b/app/components/TextArea.tsx index 3e32cd5f..79a4e46a 100644 --- a/app/components/TextArea.tsx +++ b/app/components/TextArea.tsx @@ -1,9 +1,9 @@ -import { forwardRef } from 'react' +import { forwardRef, type ComponentProps } from 'react' import { cn } from '~/utils/style' export const TextArea = forwardRef< HTMLTextAreaElement, - React.JSX.IntrinsicElements['textarea'] + ComponentProps<'textarea'> >(({ className, ...rest }, ref) => (