question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Best practice for import/export

See original GitHub issue

The best example here doesn’t work anymore with babel 6 https://github.com/airbnb/javascript/blob/master/README.md#10.

What is the proposed update? Stop using default so you can keep using import the same way?

{ es6 } from './AirbnbStyleGuide';
export default es6;

Or just change your import method?

import AirbnbStyleGuide from './AirbnbStyleGuide';
export default es6;

Or something else?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:16

github_iconTop GitHub Comments

9reactions
billyzkidcommented, Apr 28, 2017

So, it sounds like using named exports (option 2) is the general consensus (thanks!) and avoiding the wildcard import if possible, although I don’t really get why. Maintaining one file for each exported function seems a little extreme to me.

6reactions
ljharbcommented, Jun 28, 2017

There are only ever two reasons to use wildcard import:

  1. laziness (you don’t want to have to type out the explicit imports)
  2. reflection/metaprogramming

If the former, toughen up and just type them out.

If the latter, seriously consider not doing that - but if you still insist on it, then that’s what import * is for.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best Practices for Import and Export Management - Oracle
In the following sections, we provide essential best practices and deployment guidance for Import and Export Management, using a simple checklist approach to ......
Read more >
Best Practices for Import/Export
We recommend that you follow established best practices for import and export. If possible, for non-catalog feeds, create import feeds that contain only...
Read more >
Import/Export Compliance Best Practices - PPAI
Import /Export Compliance And Transportation. • Manufacturers. • Importers. Mitigating risk through transportation security best practices. Introduction.
Read more >
Tips for New Importers and Exporters
... you are importing/exporting, including those of other federal agencies. To assist you, we offer the following tips for new importers and ...
Read more >
Import and export best practices | Adobe Campaign
Import and export best practices · Using workflow templates. Most workflows aimed at importing data should contain the following activities: Load ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found