mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 14:48:14 -05:00
Merge pull request #1110 from karanjthakkar/multiline-imports
[guide] Add section on multiline imports. Fixes #1051
This commit is contained in:
19
README.md
19
README.md
@@ -1223,6 +1223,25 @@ Other Style Guides
|
||||
foo.init();
|
||||
```
|
||||
|
||||
<a name="modules--multiline-imports-over-newlines"></a>
|
||||
- [10.8](#modules--multiline-imports-over-newlines) Multiline imports should be indented just like multiline array and object literals.
|
||||
|
||||
> Why? The curly braces follow the same indentation rules as every other curly brace block in the style guide, as do the trailing commas.
|
||||
|
||||
```javascript
|
||||
// bad
|
||||
import {longNameA, longNameB, longNameC, longNameD, longNameE} from 'path';
|
||||
|
||||
// good
|
||||
import {
|
||||
longNameA,
|
||||
longNameB,
|
||||
longNameC,
|
||||
longNameD,
|
||||
longNameE,
|
||||
} from 'path';
|
||||
```
|
||||
|
||||
**[⬆ back to top](#table-of-contents)**
|
||||
|
||||
## Iterators and Generators
|
||||
|
||||
Reference in New Issue
Block a user