# no-img-element

Rule `nextjs/no-img-element`. Prevent usage of `<img>` element due to slower LCP and higher bandwidth.

- Source: nextjs
- Technologies: Next.js, React
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 130.3M weekly downloads of presets that enable it
- Trend: +60.5% last quarter
- Rank: #133 by reach, #713 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@next/next/no-img-element` | yes | no | package `@next/eslint-plugin-next` | [docs](https://nextjs.org/docs/messages/no-img-element) |
| Oxlint | `nextjs/no-img-element` | no | no | plugin `nextjs`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/nextjs/no-img-element.html) |
| Biome | `performance/noImgElement` | yes | no | group performance, since 1.9.4 | [docs](https://biomejs.dev/linter/rules/no-img-element/) |

## Code examples

### Incorrect: the rule reports this

```js
export function MyComponent() {
  return (
    <div>
      <img src="/test.png" alt="Test picture" />
    </div>
  );
}
```

### Correct: the rule accepts this

```js
import Image from "next/image";
import testImage from "./test.png"
export function MyComponent() {
  return (
    <div>
            <Image src={testImage} alt="Test picture" />
        </div>
    );
}
```

Examples from the Oxlint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import next from "@next/eslint-plugin-next";

export default [
  {
    plugins: { "@next/next": next },
    rules: {
      "@next/next/no-img-element": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "nextjs"
  ],
  "rules": {
    "nextjs/no-img-element": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "performance": {
        "noImgElement": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Next.js recommended](https://lintradar.dev/presets/next-recommended.md) | ESLint | `@next/eslint-plugin-next` | 22 | 52.9M | +50.7% |
| [Next.js Core Web Vitals](https://lintradar.dev/presets/next-core-web-vitals.md) | ESLint | `eslint-config-next` | 62 | 46.8M | +48.8% |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [nextjs/no-head-import-in-document](https://lintradar.dev/rules/nextjs/no-head-import-in-document.md): Prevent usage of `next/head` in `pages/_document.js`.
- [nextjs/no-unwanted-polyfillio](https://lintradar.dev/rules/nextjs/no-unwanted-polyfillio.md): Prevent duplicate polyfills from Polyfill.io.
- [nextjs/no-head-element](https://lintradar.dev/rules/nextjs/no-head-element.md): Prevent usage of `<head>` element.
- [nextjs/no-document-import-in-page](https://lintradar.dev/rules/nextjs/no-document-import-in-page.md): Prevent importing `next/document` outside of `pages/_document.js`.
- [nextjs/inline-script-id](https://lintradar.dev/rules/nextjs/inline-script-id.md): Enforce `id` attribute on `next/script` components with inline content.
- [nextjs/google-font-preconnect](https://lintradar.dev/rules/nextjs/google-font-preconnect.md): Ensure `preconnect` is used with Google Fonts.

---

Web page: https://lintradar.dev/rules/nextjs/no-img-element. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
