Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ module.exports = {
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-misused-promises': [
'error',
{
checksConditionals: true,
checksVoidReturn: false,
checksSpreads: true,
},
],
},
root: true,
}
1 change: 0 additions & 1 deletion app/components/AudioInputSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const AudioInputSelector: FC<{ id?: string }> = ({ id }) => {

return (
<div className="max-w-[40ch]">
{/* eslint-disable-next-line @typescript-eslint/no-misused-promises */}
<Select id={id} value={audioDeviceId} onValueChange={setAudioDeviceId}>
{audioInputDevices.map((d) => (
<Option key={d.deviceId} value={d.deviceId}>
Expand Down
4 changes: 2 additions & 2 deletions app/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { LinkProps } from '@remix-run/react'
import { Link } from '@remix-run/react'
import { forwardRef } from 'react'
import { forwardRef, type ComponentProps } from 'react'
import { cn } from '~/utils/style'

const displayTypeMap = {
Expand All @@ -26,7 +26,7 @@ const displayTypeMap = {
],
}

export type ButtonProps = Omit<React.JSX.IntrinsicElements['button'], 'ref'> & {
export type ButtonProps = ComponentProps<'button'> & {
displayType?: keyof typeof displayTypeMap
}

Expand Down
10 changes: 6 additions & 4 deletions app/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
WifiIcon,
XCircleIcon,
} from '@heroicons/react/20/solid'
import type { FC } from 'react'
import type { ComponentProps, FC } from 'react'
import { cn } from '~/utils/style'
import { MicrophoneSlashIcon } from './custom/MicrophoneSlashIcon'

Expand Down Expand Up @@ -64,9 +64,11 @@ interface IconProps {
type: keyof typeof iconMap
}

export const Icon: FC<
IconProps & Omit<React.JSX.IntrinsicElements['svg'], 'ref'>
> = ({ type, className, ...rest }) => {
export const Icon: FC<IconProps & ComponentProps<'svg'>> = ({
type,
className,
...rest
}) => {
const Component = iconMap[type]
return <Component className={cn('h-[1em]', className)} {...rest} />
}
6 changes: 2 additions & 4 deletions app/components/Icon/custom/MicrophoneSlashIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { FC } from 'react'
import type { ComponentProps, FC } from 'react'

export const MicrophoneSlashIcon: FC<React.JSX.IntrinsicElements['svg']> = (
props
) => {
export const MicrophoneSlashIcon: FC<ComponentProps<'svg'>> = (props) => {
return (
<svg
aria-hidden="true"
Expand Down
45 changes: 22 additions & 23 deletions app/components/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
import { forwardRef } from 'react'
import { forwardRef, type ComponentProps } from 'react'
import { cn } from '~/utils/style'

export const Input = forwardRef<
HTMLInputElement,
React.JSX.IntrinsicElements['input']
>(({ className, ...rest }, ref) => (
<input
className={cn(
'w-full',
'rounded',
'border-2',
'border-zinc-500',
'text-zinc-900',
'dark:text-zinc-50',
'bg-zinc-50',
'dark:bg-zinc-700',
'px-2',
'py-1',
className
)}
{...rest}
ref={ref}
/>
))
export const Input = forwardRef<HTMLInputElement, ComponentProps<'input'>>(
({ className, ...rest }, ref) => (
<input
className={cn(
'w-full',
'rounded',
'border-2',
'border-zinc-500',
'text-zinc-900',
'dark:text-zinc-50',
'bg-zinc-50',
'dark:bg-zinc-700',
'px-2',
'py-1',
className
)}
{...rest}
ref={ref}
/>
)
)

Input.displayName = 'Input'
4 changes: 2 additions & 2 deletions app/components/Participant.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/components/TextArea.tsx
Original file line number Diff line number Diff line change
@@ -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) => (
<textarea
ref={ref}
Expand Down
7 changes: 2 additions & 5 deletions app/components/VideoSrcObject.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { forwardRef, useEffect, useRef } from 'react'
import { forwardRef, useEffect, useRef, type ComponentProps } from 'react'
import { cn } from '~/utils/style'

export type VideoSrcObjectProps = Omit<
React.JSX.IntrinsicElements['video'],
'ref'
> & {
export type VideoSrcObjectProps = ComponentProps<'video'> & {
videoTrack?: MediaStreamTrack
}

Expand Down
3 changes: 1 addition & 2 deletions app/hooks/useBroadcastStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ export default function useBroadcastStatus({
},
}

// eslint-disable-next-line no-inner-declarations
function sendUserUpdate() {
const sendUserUpdate = () => {
websocket.send(
JSON.stringify({
type: 'userUpdate',
Expand Down
1 change: 0 additions & 1 deletion app/utils/blurVideoTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export default async function blurVideoTrack(
let t = -1
async function tick() {
await drawBlur()
// eslint-disable-next-line @typescript-eslint/no-misused-promises
t = window.setTimeout(tick, 1000 / 30) // 30fps
}

Expand Down
2 changes: 0 additions & 2 deletions app/utils/rxjs/getUserMediaTrack$.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ function acquireTrack(
const cleanup = () => {
console.log('🛑 Stopping track')
track.stop()
// eslint-disable-next-line @typescript-eslint/no-misused-promises
document.removeEventListener('visibilitychange', onVisibleHandler)
}
const onVisibleHandler = async () => {
Expand All @@ -92,7 +91,6 @@ function acquireTrack(
cleanup()
acquireTrack(subscriber, device, constraints, cleanupRef)
}
// eslint-disable-next-line @typescript-eslint/no-misused-promises
document.addEventListener('visibilitychange', onVisibleHandler)
cleanupRef.current = cleanup
subscriber.next(track)
Expand Down