Open
Description
Hi, I'm using image props with an interface as below and eslint is showing a warning Image elements must have an alt prop, either with meaningful text, or an empty string for decorative images.
interface ImageProps {
src: string
width: number
height: number
alt: string
priority?: boolean
}
const ImageList = ({ images, imgClassName }: { images: ImageProps[], imgClassName: string }) => {
return (
<Carousel responsive={CAROUSEL_RESPONSIVE} renderDotsOutside ssr>
{images.map((image, index) => <Image key={index} className={imgClassName} {...image} />)}
</Carousel>
)
}
Correct me if I'm wrong but In this case, the alt tag is guaranteed by the interface and eslint shouldn't show the warning.