Open
Description
What is the documentation issue?
Per
and the type definition ( ),rewrites
is an async function. The examples, however, neither await
anything, nor explicitly return a promise.
JavaScript of course wraps the return value in a promise, so this works, but it may be considered bad form. And some of us have our linters turned up to 11.
Is there any context that might help us understand?
I ran an automated installation script for PostHog, which added this configuration and produced an eslint failure, and that led me to noticing this in the Next.js documentation.
I know that it's trivial to work around and I have done so, but I thought it might be worth considering changing the docs.
Does the docs page already exist? Please link to it.
https://nextjs.org/docs/app/api-reference/config/next-config-js/rewrites