Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add next.config.js validation with ajv (#38498)
* Add next.config.js validation with ajv * update manifest * update lib type * remove old tests * update to pre-build validation code * ensure validate output is ncced * Apply suggestions from code review Co-authored-by: Steven <steven@ceriously.com> * Add example of typing next.config.js Co-authored-by: Steven <steven@ceriously.com>
- Loading branch information
Showing
12 changed files
with
782 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Invalid next.config.js | ||
|
||
#### Why This Error Occurred | ||
|
||
In your `next.config.js` file you passed invalid options that either are the incorrect type or an unknown field. | ||
|
||
#### 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. | ||
|
||
```ts | ||
/** | ||
* @type {import('next').NextConfig} | ||
*/ | ||
const nextConfig = { | ||
/* config options here */ | ||
} | ||
|
||
module.exports = nextConfig | ||
``` | ||
|
||
### Useful Links | ||
|
||
- [`next.config.js`](https://nextjs.org/docs/api-reference/next.config.js/introduction) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.