Docs: Add version history for next lint deprecation and update error message (#85100)

Co-authored-by: Joseph <[email protected]>
This commit is contained in:
Delba de Oliveira
2025-10-20 19:58:07 +00:00
committed by GitHub
co-authored by Joseph
parent 20cf4c07da
commit ca7f57ee2d
2 changed files with 27 additions and 8 deletions
+23 -8
View File
@@ -2,13 +2,13 @@
title: 'Invalid `next.config.js`'
---
## Why This Error Occurred
## Why this error occurred
In your `next.config.js` file you passed invalid options that either are the incorrect type or an unknown field. This warning is shown to help catch typos that cause expected configs to not be applied.
In your `next.config.js` file, you passed invalid options that either are the incorrect type or an unknown field. This warning is shown to help catch typos, deprecated or updated options.
## Possible Ways to Fix It
## Possible ways to fix it
Fixing the listed config errors will remove this warning. You can also leverage the `NextConfig` type by importing from `next` to help ensure your config is correct.
You can use the `NextConfig` type to help ensure your config is correct.
```js filename="next.config.js"
/**
@@ -21,12 +21,27 @@ const nextConfig = {
module.exports = nextConfig
```
For example for the below warning, there is a typo and `rewritess` needs to be renamed to `rewrites` to resolve the issue.
Alternatively, you can use `next.config.ts` for better type safety and auto-completion:
```bash filename="Terminal"
The root value has an unexpected property, rewritess, which is not in the list of allowed properties
```ts filename="next.config.ts"
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
/* config options here */
}
export default nextConfig
```
## Useful Links
### Deprecated or updated options
Some configuration options have been removed or updated in recent versions of Next.js. For example:
- `eslint` configuration option has been removed from `next.config`. Remove the `eslint` option and use the ESLint CLI instead. See the [ESLint](/docs/app/api-reference/config/eslint) documentation.
- `experimental.turbo` configuration has moved to a top-level `turbopack` configuration. See the [`turbopack` option](/docs/app/api-reference/config/next-config-js/turbopack) documentation.
See the [`next.config.js` docs](/docs/app/api-reference/config/next-config-js) for a list of all available and legacy options.
## Useful links
- [`next.config.js`](/docs/pages/api-reference/config/next-config-js)