# Next.js recommended

Only the Next.js plugin's own rules, without the React and accessibility rules that eslint-config-next adds.

- Linter: ESLint
- Package: `@next/eslint-plugin-next` (https://nextjs.org/docs/app/api-reference/config/eslint)
- Author: Vercel (official)
- Rules: 22
- Weekly downloads: 52.9M, +50.7% last quarter
- Technologies: nextjs (22)

## Install

```sh
npm install -D eslint @next/eslint-plugin-next
pnpm add -D eslint @next/eslint-plugin-next
yarn add -D eslint @next/eslint-plugin-next
bun add -d eslint @next/eslint-plugin-next
```

## Config: `eslint.config.js`

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

export default [
  next.configs.recommended,
];
```

## Rules it enables

| Rule | Severity | Description | Reach |
| --- | --- | --- | --- |
| [nextjs/google-font-display](https://lintradar.dev/rules/nextjs/google-font-display.md) | warn | Enforce font-display behavior with Google Fonts. | 130.3M |
| [nextjs/google-font-preconnect](https://lintradar.dev/rules/nextjs/google-font-preconnect.md) | warn | Ensure `preconnect` is used with Google Fonts. | 130.3M |
| [nextjs/inline-script-id](https://lintradar.dev/rules/nextjs/inline-script-id.md) | error | Enforce `id` attribute on `next/script` components with inline content. | 130.3M |
| [nextjs/no-document-import-in-page](https://lintradar.dev/rules/nextjs/no-document-import-in-page.md) | error | Prevent importing `next/document` outside of `pages/_document.js`. | 130.3M |
| [nextjs/no-head-element](https://lintradar.dev/rules/nextjs/no-head-element.md) | warn | Prevent usage of `<head>` element. | 130.3M |
| [nextjs/no-head-import-in-document](https://lintradar.dev/rules/nextjs/no-head-import-in-document.md) | error | Prevent usage of `next/head` in `pages/_document.js`. | 130.3M |
| [nextjs/no-img-element](https://lintradar.dev/rules/nextjs/no-img-element.md) | warn | Prevent usage of `<img>` element due to slower LCP and higher bandwidth. | 130.3M |
| [nextjs/no-unwanted-polyfillio](https://lintradar.dev/rules/nextjs/no-unwanted-polyfillio.md) | warn | Prevent duplicate polyfills from Polyfill.io. | 130.3M |
| [nextjs/no-sync-scripts](https://lintradar.dev/rules/nextjs/no-sync-scripts.md) | warn | Prevent synchronous scripts. | 101.8M |
| [nextjs/next-script-for-ga](https://lintradar.dev/rules/nextjs/next-script-for-ga.md) | warn | Prefer `@next/third-parties/google` when using the inline script for Google Analytics and Tag Manager. | 99.7M |
| [nextjs/no-async-client-component](https://lintradar.dev/rules/nextjs/no-async-client-component.md) | warn | Prevent Client Components from being async functions. | 99.7M |
| [nextjs/no-before-interactive-script-outside-document](https://lintradar.dev/rules/nextjs/no-before-interactive-script-outside-document.md) | warn | Prevent usage of `next/script`'s `beforeInteractive` strategy outside of `pages/_document.js`. | 99.7M |
| [nextjs/no-assign-module-variable](https://lintradar.dev/rules/nextjs/no-assign-module-variable.md) | error | Prevent assignment to the `module` variable. | 99.7M |
| [nextjs/no-css-tags](https://lintradar.dev/rules/nextjs/no-css-tags.md) | warn | Prevent manual stylesheet tags. | 99.7M |
| [nextjs/no-duplicate-head](https://lintradar.dev/rules/nextjs/no-duplicate-head.md) | error | Prevent duplicate usage of `<Head>` in `pages/_document.js`. | 99.7M |
| [nextjs/no-html-link-for-pages](https://lintradar.dev/rules/nextjs/no-html-link-for-pages.md) | warn | Prevent usage of `<a>` elements to navigate to internal Next.js pages. | 99.7M |
| [nextjs/no-page-custom-font](https://lintradar.dev/rules/nextjs/no-page-custom-font.md) | warn | Prevent page-only custom fonts. | 99.7M |
| [nextjs/no-script-component-in-head](https://lintradar.dev/rules/nextjs/no-script-component-in-head.md) | error | Prevent usage of `next/script` in `next/head` component. | 99.7M |
| [nextjs/no-styled-jsx-in-document](https://lintradar.dev/rules/nextjs/no-styled-jsx-in-document.md) | warn | Prevent usage of `styled-jsx` in `pages/_document.js`. | 99.7M |
| [nextjs/no-title-in-document-head](https://lintradar.dev/rules/nextjs/no-title-in-document-head.md) | warn | Prevent usage of `<title>` with `Head` component from `next/document`. | 99.7M |
| [nextjs/no-typos](https://lintradar.dev/rules/nextjs/no-typos.md) | warn | Prevent common typos in Next.js data fetching functions. | 99.7M |
| [nextjs/no-location-assign-relative-destination](https://lintradar.dev/rules/nextjs/no-location-assign-relative-destination.md) | warn | Prevent usage of `location.assign` or `location.href` assignment to navigate to internal Next.js pages. | 99.7M |

---

Web page: https://lintradar.dev/presets/next-recommended. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
