Skip to content
← Back to rules

nextjs/no-typos Correctness

💡 A suggestion is available for this rule.

What it does

Detects common typos in Next.js data fetching function names.

Why is this bad?

Next.js will not call incorrectly named data fetching functions, causing pages to render without expected data.

Examples

Examples of incorrect code for this rule:

javascript
export default function Page() {
  return <div></div>;
}
export async function getServurSideProps() {}

Examples of correct code for this rule:

javascript
export default function Page() {
  return <div></div>;
}
export async function getServerSideProps() {}

How to use

To enable this rule using the config file or in the CLI, you can use:

json
{
  "plugins": ["nextjs"],
  "rules": {
    "nextjs/no-typos": "error"
  }
}
ts
import { defineConfig } from "oxlint";

export default defineConfig({
  plugins: ["nextjs"],
  rules: {
    "nextjs/no-typos": "error",
  },
});
bash
oxlint --deny nextjs/no-typos --nextjs-plugin

Version

This rule was added in v0.2.1.

References