[request] better typescript type for `next.config.js` NextConfig
See original GitHub issueFeature request
Is your feature request related to a problem? Please describe.
i only see this, but any
not a good type
declare type NextConfig = any;
if 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.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:17
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Basic Features: TypeScript - Next.js
Next.js provides an integrated TypeScript experience, including zero-configuration set up and built-in types for Pages, APIs, and more.
Read more >Next.js + TypeScript: Tips and FAQs for Every Stage of Your ...
Types enable better introspection, which catches bugs before they have a chance to run in the application. Code editors are able to provide...
Read more >Next.js-config with type checking - flaming.codes
Next.js doesn't support Typescript-types for its config yet, but you can still include some utility typings.
Read more >Why does my jest setup not work with top-level await
My next.config.js to support top-level await via Webpack: /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: ...
Read more >Next.js - Tauri Apps
We want to customize this file to get the best compatibility with Tauri. Update the file with the following content: next.config.js. /** @type...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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 like
Export types of
next.config.js
so that people can use JSDOC to get autcomplete for the config viaDescribe alternatives you’ve considered
Declare the types locally starting from https://github.com/zeit/next.js/blob/287961ed9142a53f8e9a23bafb2f31257339ea98/packages/next/next-server/server/config.ts#L12-L65
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)