Skip to content
This repository was archived by the owner on May 29, 2023. It is now read-only.

Commit 1bc2f3f

Browse files
authored
Merge pull request airbnb#1110 from karanjthakkar/multiline-imports
[guide] Add section on multiline imports. Fixes airbnb#1051
2 parents e2de71e + b72bd52 commit 1bc2f3f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,25 @@ Other Style Guides
12231223
foo.init();
12241224
```
12251225
1226+
<a name="modules--multiline-imports-over-newlines"></a>
1227+
- [10.8](#modules--multiline-imports-over-newlines) Multiline imports should be indented just like multiline array and object literals.
1228+
1229+
> Why? The curly braces follow the same indentation rules as every other curly brace block in the style guide, as do the trailing commas.
1230+
1231+
```javascript
1232+
// bad
1233+
import {longNameA, longNameB, longNameC, longNameD, longNameE} from 'path';
1234+
1235+
// good
1236+
import {
1237+
longNameA,
1238+
longNameB,
1239+
longNameC,
1240+
longNameD,
1241+
longNameE,
1242+
} from 'path';
1243+
```
1244+
12261245
**[⬆ back to top](#table-of-contents)**
12271246
12281247
## Iterators and Generators

0 commit comments

Comments
 (0)