DEV Community

Discussion on: I Have Very Good Feelings about ES2020 features

Collapse
 
pentacular profile image
pentacular

I'm not much a fan of export *.

The reason is that what you export is unclear and depends on changes far away.

But the following pattern seems nice to me.

export { A, B, C } from './index.js';
Collapse
 
daiyanze profile image
Yanze Dai

I think "export *" is somewhat corresponding to "import *". Of course it's unclear in some cases but for files with only one default export it would be very helpful IMHO.