import type { Plugin } from 'seolint' ; interface Image { 'image.alt.exists' : boolean ; 'image.alt.content.html' : boolean ; 'image.alt.content.undefined' : boolean ; 'image.alt.content.null' : boolean ; } export const image = function ( context , document ) { let images = document . querySelectorAll ( 'img' ) ; images . forEach ( img => { let alt = img . getAttribute ( 'alt' ) || '' ; context . assert ( 'image.alt.exists' , alt . trim ( ) . length > 0 , 'Must have an `alt` attribute' ) ; context . assert ( 'image.alt.content.undefined' , alt . indexOf ( 'undefined' ) === - 1 , 'Must not include "undefined" in `alt` value' ) ; context . assert ( 'image.alt.content.null' , alt . indexOf ( 'null' ) === - 1 , 'Must not include "null" in `alt` value' ) ; } ) ; } ;