Add type-alias-readonlydeep rule and make ducks mostly immutable

This commit is contained in:
Jamie Kyle 2023-01-13 12:07:26 -08:00 committed by GitHub
parent 11ce3c3d59
commit c58a723f45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 1164 additions and 871 deletions

View file

@ -4,6 +4,7 @@
import React from 'react';
import { useSelector } from 'react-redux';
import type { ReadonlyDeep } from 'type-fest';
import type { GetConversationByIdType } from '../selectors/conversations';
import type { LocalizerType } from '../../types/Util';
import type { MediaItemType } from '../../types/MediaItem';
@ -33,7 +34,10 @@ export function SmartLightbox(): JSX.Element | null {
const isShowingLightbox = useSelector<StateType, boolean>(shouldShowLightbox);
const isViewOnce = useSelector<StateType, boolean>(getIsViewOnce);
const media = useSelector<StateType, ReadonlyArray<MediaItemType>>(getMedia);
const media = useSelector<
StateType,
ReadonlyArray<ReadonlyDeep<MediaItemType>>
>(getMedia);
const selectedIndex = useSelector<StateType, number>(getSelectedIndex);
if (!isShowingLightbox) {