Skip to main content

a11y/noRedundantAlt

enforce img alt prop does not contain the word “image”, “picture”, or “photo”

ESLint Equivalent: img-redundant-alt

Examples

Invalid

<img src='src' alt='photo content' />

 file.tsx:1 lint/a11y/noRedundantAlt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Avoid the words "image", "picture", or "photo" in img element alt
    text.

    <img src='src' alt='photo content' />
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Screen readers announce img elements as "images", so it is not
    necessary to redeclare this in alternative text.


<img src='src' alt='picture content' />

 file.tsx:1 lint/a11y/noRedundantAlt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Avoid the words "image", "picture", or "photo" in img element alt
    text.

    <img src='src' alt='picture content' />
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Screen readers announce img elements as "images", so it is not
    necessary to redeclare this in alternative text.


<img src='src' alt='image content' />

 file.tsx:1 lint/a11y/noRedundantAlt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Avoid the words "image", "picture", or "photo" in img element alt
    text.

    <img src='src' alt='image content' />
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Screen readers announce img elements as "images", so it is not
    necessary to redeclare this in alternative text.


<img src='src' alt='Photo content' />

 file.tsx:1 lint/a11y/noRedundantAlt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Avoid the words "image", "picture", or "photo" in img element alt
    text.

    <img src='src' alt='Photo content' />
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Screen readers announce img elements as "images", so it is not
    necessary to redeclare this in alternative text.


<img src='src' alt='Picture content' />

 file.tsx:1 lint/a11y/noRedundantAlt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Avoid the words "image", "picture", or "photo" in img element alt
    text.

    <img src='src' alt='Picture content' />
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Screen readers announce img elements as "images", so it is not
    necessary to redeclare this in alternative text.


<img src='src' alt='Image content' />

 file.tsx:1 lint/a11y/noRedundantAlt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Avoid the words "image", "picture", or "photo" in img element alt
    text.

    <img src='src' alt='Image content' />
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Screen readers announce img elements as "images", so it is not
    necessary to redeclare this in alternative text.

<img src="src" alt="photo content" />

 file.html:1 lint/a11y/noRedundantAlt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Avoid the words "image", "picture", or "photo" in img element alt
    text.

    <img src="src" alt="photo content" />
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Screen readers announce img elements as "images", so it is not
    necessary to redeclare this in alternative text.


<img src="src" alt="picture content" />

 file.html:1 lint/a11y/noRedundantAlt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Avoid the words "image", "picture", or "photo" in img element alt
    text.

    <img src="src" alt="picture content" />
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Screen readers announce img elements as "images", so it is not
    necessary to redeclare this in alternative text.


<img src="src" alt="image content" />

 file.html:1 lint/a11y/noRedundantAlt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Avoid the words "image", "picture", or "photo" in img element alt
    text.

    <img src="src" alt="image content" />
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Screen readers announce img elements as "images", so it is not
    necessary to redeclare this in alternative text.


<img src="src" alt="Photo content" />

 file.html:1 lint/a11y/noRedundantAlt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Avoid the words "image", "picture", or "photo" in img element alt
    text.

    <img src="src" alt="Photo content" />
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Screen readers announce img elements as "images", so it is not
    necessary to redeclare this in alternative text.


<img src="src" alt="Picture content" />

 file.html:1 lint/a11y/noRedundantAlt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Avoid the words "image", "picture", or "photo" in img element alt
    text.

    <img src="src" alt="Picture content" />
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Screen readers announce img elements as "images", so it is not
    necessary to redeclare this in alternative text.


<img src="src" alt="Image content" />

 file.html:1 lint/a11y/noRedundantAlt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Avoid the words "image", "picture", or "photo" in img element alt
    text.

    <img src="src" alt="Image content" />
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Screen readers announce img elements as "images", so it is not
    necessary to redeclare this in alternative text.

Valid

<img src='src' alt='alt' />
<img src='src' alt={photo} />
<img src="src" alt="content" />