Skip to content
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

Use a consistent style for named vs. default exports #6336

Open
anandthakker opened this issue Mar 14, 2018 · 2 comments
Open

Use a consistent style for named vs. default exports #6336

anandthakker opened this issue Mar 14, 2018 · 2 comments

Comments

@anandthakker
Copy link
Contributor

My proposal:

  • No exported "namespace objects" (Replace exported objects with named exports #6335) -- modules should export either classes or functions, with an occasional exception as needed for stubbing.
  • If a module exports one thing, use a default export
  • If a module exports multiple things, use named exports only

Whatever we decide, it should be backed up by lint rules.

@jfirebaugh
Copy link
Contributor

Counterproposal:

  • If a module exports something with the same name as the file name (modulo case), it should be the default export.
  • Anything else should be a named export.

@anandthakker
Copy link
Contributor Author

When you put it that way, I'm sold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants