# eslint-plugin-img-alt

> An ESLint plugin to enforce adding the `alt` attribute to `img` tags in JSX. If an `img` tag doesn't have an `alt` attribute, the rule will automatically fix it by adding `alt="no data"`.

Latest version **1.0.7** (published 2023-04-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-img-alt
pnpm add eslint-plugin-img-alt
yarn add eslint-plugin-img-alt
bun add eslint-plugin-img-alt
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2023-04-30 |
| First published | 2023-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | sergeyisakhanyan |
| Maintainers | sergeyisakhanyan |
| Keywords | eslint, eslintplugin, es6, alt, img |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-img-alt
- npm.io page: https://npm.io/package/eslint-plugin-img-alt

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2023-04-30
- 1.0.6 — 2023-04-30
- 1.0.5 — 2023-04-30
- 1.0.4 — 2023-04-27
- 1.0.3 — 2023-04-26
- 1.0.2 — 2023-04-25
- 1.0.1 — 2023-04-25
- 1.0.0 — 2023-04-25

## README

# eslint-plugin-img-alt

An ESLint plugin to enforce adding the `alt` attribute to `img` tags in JSX. If an `img` tag doesn't have an `alt` attribute, the rule will automatically fix it by adding `alt="no data"`.

## Installation

You'll first need to install [ESLint](http://eslint.org):

```
npm install eslint --save-dev
```


Next, install `eslint-plugin-img-alt`:

```
npm install eslint-plugin-img-alt --save-dev
```

**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-img-alt` globally.

## Usage

Add `img-alt` to the plugins section of your `.eslintrc` configuration file. Then, configure the rule under the rules section:

```json
{
  "plugins": ["img-alt"],
  "rules": {
    "img-alt/require-alt-attribute": "error"
  }
}
```

## Supported Rules
- `require-alt-attribute`: Enforces the presence of the alt attribute on img tags. If the attribute is missing, ESLint will automatically fix it by adding alt="no data".

---
_Source: https://npm.io/package/eslint-plugin-img-alt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
