chore: enable noUncheckedIndexedAccess, better type check (#2608)
This commit is contained in:
@@ -20,7 +20,7 @@ export const GridList: FC<{
|
||||
<Wrapper key={entry.id} href={entry.url || entry.authorUrl || ""}>
|
||||
<div className="relative -mx-1.5 -mt-1.5">
|
||||
<LazyImage
|
||||
src={entry.media?.[0].url}
|
||||
src={entry.media?.[0]!.url}
|
||||
className="aspect-video h-auto w-full shrink-0 rounded-md object-cover"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -49,7 +49,7 @@ const MasonryItemFixedDimensionWrapper = (
|
||||
const style = useMemo(
|
||||
() => ({
|
||||
width: itemWidth,
|
||||
height: itemWidth / stableRadioCtx,
|
||||
height: itemWidth / stableRadioCtx!,
|
||||
}),
|
||||
[itemWidth, stableRadioCtx],
|
||||
)
|
||||
@@ -148,10 +148,10 @@ export const PictureList: FC<{
|
||||
const flattenedItems = []
|
||||
const imageSrcSet = new Set<string>()
|
||||
for (let i = 0; i < entries?.length || 0; i++) {
|
||||
const entry = entries[i]
|
||||
const entry = entries[i]!
|
||||
if (!entry.media) continue
|
||||
for (let j = 0; j < entry.media?.length || 0; j++) {
|
||||
const media = entry.media[j]
|
||||
const media = entry.media[j]!
|
||||
if (imageSrcSet.has(media.url)) continue
|
||||
imageSrcSet.add(media.url)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user