# jsx-a11y/img-redundant-alt

> Disallow the words "image", "photo" and "picture" in `alt` text

A screen reader already says "image" before it reads the `alt` text. With `alt="Photo of a lighthouse"`, the person hears "image, photo of a lighthouse". Describe what the image shows and leave the rest out.

The rule looks for whole words, in upper or lower case, in strings and in the fixed parts of templates. "Photography" isn't reported. An `img` with `aria-hidden` isn't checked.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

Off by default. To turn it on:

```toml bunfig.toml
[lint.rules]
"jsx-a11y/img-redundant-alt" = "error" # or "warn"
```

Every option, set to its default:

```toml bunfig.toml
[lint.rules]
"jsx-a11y/img-redundant-alt" = ["error", {
  components = [], # list of strings
  words = [], # list of strings
}]
```

{/* End of the generated section. */}

## Examples

Reported:

{/* bad {"count": 2} */}
```jsx
const cover = <img src="/lighthouse.jpg" alt="Photo of a lighthouse" />;
const avatar = <img src={user.photo} alt={`Picture of ${user.name}`} />;
```

Not reported:

{/* good */}
```jsx
const cover = <img src="/lighthouse.jpg" alt="A lighthouse at sunset" />;
const avatar = <img src={user.photo} alt={user.name} />;
const course = <img src="/course.jpg" alt="Photography for beginners" />;
```

## Options

| Option | Default | What it does |
| --- | --- | --- |
| `components` | `[]` | Components to check like `img`. |
| `words` | `[]` | More words to report, in addition to `image`, `photo` and `picture`. |

{/* bad {"options": [{"components": ["Avatar"], "words": ["icon"]}], "count": 2} */}
```jsx
const avatar = <Avatar src={user.photo} alt="Photo of the author" />;
const trash = <img src="/trash.svg" alt="Trash icon" />;
```
