Javascript: Multiline imports and exports

Created on 30 Dec 2016  Â·  2Comments  Â·  Source: airbnb/javascript

10.8 says:

10.8 Multiline imports should be indented just like multiline array and object literals.

Only imports? What about exports?


Also, on section 18.5 the example contains:

// good
import { es6 } from './AirbnbStyleGuide';
  // ...
export default es6;↵

It shouldn't be like this?

// good
import {
  es6,
} from './AirbnbStyleGuide';
  // ...
export default es6;↵

It also happens on 10.3 and maybe at 10.4.

I can PR if i'm right here. If not, what number is good to go multiline?

question

All 2 comments

That's always entirely arbitrary. Both of your examples are equally fine.

why this is bad

export { es6 } from './AirbnbStyleGuide';

I usually use that in the index file of a module.

is this bad too? why?

export * from './AirbnbStyleGuide';

I always use this way for export types

and about the last one

export const foo = 'foo';
Was this page helpful?
0 / 5 - 0 ratings

Related issues

brendanvinson picture brendanvinson  Â·  4Comments

tunnckoCore picture tunnckoCore  Â·  3Comments

xgqfrms-GitHub picture xgqfrms-GitHub  Â·  3Comments

progre picture progre  Â·  3Comments

kozhevnikov picture kozhevnikov  Â·  3Comments