# no-html-link-for-pages

Rule `nextjs/no-html-link-for-pages`. Prevent usage of `<a>` elements to navigate to internal Next.js pages.

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@next/next/no-html-link-for-pages` | yes | no | package `@next/eslint-plugin-next` | [docs](https://nextjs.org/docs/messages/no-html-link-for-pages) |
| Oxlint | `nextjs/no-html-link-for-pages` | no | no | plugin `nextjs`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/nextjs/no-html-link-for-pages.html) |

## Code examples

### Incorrect: the rule reports this

```jsx
function HomePage() {
  return (
    <div>
      <a href="/about">About Us</a>
      <a href="/contact">Contact</a>
    </div>
  );
}
```

### Correct: the rule accepts this

```jsx
import Link from 'next/link';

function HomePage() {
  return (
    <div>
      <Link href="/about">About Us</Link>
      <Link href="/contact">Contact</Link>
    </div>
  );
}
```

```jsx
function HomePage() {
  return (
    <div>
      <a href="https://example.com">External Link</a>
      <a href="mailto:contact@example.com">Email</a>
      <a href="tel:+1234567890">Phone</a>
    </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-html-link-for-pages": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "nextjs"
  ],
  "rules": {
    "nextjs/no-html-link-for-pages": "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% |

## Related rules

- [nextjs/no-duplicate-head](https://lintradar.dev/rules/nextjs/no-duplicate-head.md): Prevent duplicate usage of `<Head>` in `pages/_document.js`.
- [nextjs/no-page-custom-font](https://lintradar.dev/rules/nextjs/no-page-custom-font.md): Prevent page-only custom fonts.
- [nextjs/no-css-tags](https://lintradar.dev/rules/nextjs/no-css-tags.md): Prevent manual stylesheet tags.
- [nextjs/no-script-component-in-head](https://lintradar.dev/rules/nextjs/no-script-component-in-head.md): Prevent usage of `next/script` in `next/head` component.
- [nextjs/no-assign-module-variable](https://lintradar.dev/rules/nextjs/no-assign-module-variable.md): Prevent assignment to the `module` variable.
- [nextjs/no-styled-jsx-in-document](https://lintradar.dev/rules/nextjs/no-styled-jsx-in-document.md): Prevent usage of `styled-jsx` in `pages/_document.js`.

---

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