# nextjs

> Next.js apps: the framework and hooks rules, and server code that never reaches the client. A Semgrep rule refuses ignoreBuildErrors and ignoreDuringBuilds in next.config.

Next.js apps: the framework and hooks rules, and server code that never reaches the client. A Semgrep rule refuses ignoreBuildErrors and ignoreDuringBuilds in next.config. It requires [`typescript`](/reference/configurations/typescript/), [`react`](/reference/configurations/react/), [`react-dom`](/reference/configurations/react-dom/). The [JavaScript and TypeScript guide](/languages/javascript-typescript/) explains the setup.

## Checks

| Check                                         | Stage  | Level         | What it does                                                                            |
| --------------------------------------------- | ------ | ------------- | --------------------------------------------------------------------------------------- |
| [`nextjs/tsc`](/reference/checks/nextjs/tsc/) | `push` | `recommended` | Has Next.js write its types, then type-checks the app with the strict compiler options. |

## Selected when

gspot selects it in a scope with dependencies `next`.

## Lint rules turned off

| Lint rules               | Files                                                                                                           | Why                                                                                        |
| ------------------------ | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| `gspot/no-trivial-files` | `**/{page,layout,template,default,loading,error,not-found,global-error,route,middleware,proxy}.{js,jsx,ts,tsx}` | Next.js discovers route files by name, so each file can hold one export in its own folder. |

## Rules for coding agents

| Rule file                                                | Installed when |
| -------------------------------------------------------- | -------------- |
| `.gspot/configurations/framework/nextjs/rules/NEXTJS.md` | Always         |

## Tools and versions

| Tool                     | Version                  |
| ------------------------ | ------------------------ |
| next                     | Any, install it yourself |
| @next/eslint-plugin-next | `16.3.8`                 |

## Files gspot writes

gspot writes `.gspot/configurations/framework/nextjs/semgrep.yml`.
