-
Notifications
You must be signed in to change notification settings - Fork 26.3k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[request] better typescript type for next.config.js
NextConfig
#10254
Comments
Just leaving my use case here after #8044 was closed without much considerations: Is your feature request related to a problem? Please describe.Documentation for config is incomplete and spread out. In-editor autocomplete solves this via types. Describe the solution you'd likeExport types of /**
* @type {import('next').Config}
*/
const config = {
// your config here
};
module.exports = config; Describe alternatives you've consideredDeclare the types locally starting from https://github.com/zeit/next.js/blob/287961ed9142a53f8e9a23bafb2f31257339ea98/packages/next/next-server/server/config.ts#L12-L65 |
I just used a similar approach for typing relay's configuration file : // @ts-check
/**
* @type import("relay-compiler/lib/bin/RelayCompilerMain").Config
*/
module.exports = {
// free auto-complete and type-checking yay!
}; It's a great addition for discoverability. |
they don't want type for it |
See #13429 |
It doesn't look like that PR adds a public type. It was suggested (#13429 (comment)) but it's not apparent how I would import the config type. |
Gatsby exposes really good types for their config, which allows you to strongly type the JavaScript config file using JSDoc as described above. |
This is not one of our current priorities but I'm open to review a PR that adds types for Next.js configurations (similar to #13429 which was closed due to being quite outdated) |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Feature request
Is your feature request related to a problem? Please describe.
i only see this, but
any
not a good typeif have a type/interface for this
we can more easy write a next.config or a config plugin
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: