Replies: 2 comments 1 reply
-
TypeScript does a good job with default exports when the default export is named, I think having this rule enabled forces you to never use a default export 🤔 |
Beta Was this translation helpful? Give feedback.
-
Beyond consistency and avoiding divergent names for default exports, I'd also like to reduce the import bloat and pollution in Intellisense. Layouts and pages will rarely if ever be imported anyway. The ideal solution imo would be if there was a named export in |
Beta Was this translation helpful? Give feedback.
-
Describe the feature you'd like to request
Our style guide enforces
import/no-default-export
. We find this helps with TypeScript IntelliSense (auto-completion) in IDEs like VSCode.Right now, Next.js requires default exports in pages and API routes.
Describe the solution you'd like
Where Next.js expects default exports today, we'd like the option of using named exports.
For example:
Describe alternatives you've considered
We could, as an alternative, disable this rule for anything in the pages directory (and in any other places it would be needed).
Beta Was this translation helpful? Give feedback.
All reactions