chore: enable noUncheckedIndexedAccess, better type check (#2608)

This commit is contained in:
Stephen Zhou
2025-01-18 22:35:23 +08:00
committed by GitHub
parent f947bd1d1e
commit 2cd1b5daf9
182 changed files with 489 additions and 589 deletions
+1 -1
View File
@@ -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)