Как исправить избыточный атрибут alt?

При проверки программы на ошибки eslint, вывелось такое сообщение:

Redundant alt attribute. Screen-readers already announce `img` tags as an image. You don’t need to use the words `image`, `photo,` or `picture` (or any specified custom words) in the alt prop

Участок кода, на который ссылается сообщение, выглядит так:
function ItemList(): JSX.Element {
  const href = '#';
  return (
    <div className="cities__image-wrapper place-card__image-wrapper">
      <a href={href}>
        <img className="place-card__image" src="img/apartment-01.jpg" width="260" height="200" alt="Place image" />
      </a>
    </div>
  );
}

export default ItemList;

С чем это связанно и как это можно исправить?
  • Вопрос задан
  • 376 просмотров
Решения вопроса 2
Aetae
@Aetae
Тлен
Place image -> Place

Ну или отрубить это тупое eslint правило.
Ответ написан
alexey-m-ukolov
@alexey-m-ukolov Куратор тега HTML
You don’t need to use the words `image`, `photo,` or `picture` (or any specified custom words) in the alt prop

Ну серьёзно, что тут может быть непонятно?
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы