From 6ad315c090208aca03dfcd761c3b84663a5ac1e2 Mon Sep 17 00:00:00 2001 From: Karan Thakkar Date: Thu, 6 Oct 2016 14:54:53 +0530 Subject: [PATCH 1/3] Add section on multi-line imports. Fixes #1051 --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index f3b4559d..5bb6080d 100644 --- a/README.md +++ b/README.md @@ -1223,6 +1223,25 @@ Other Style Guides foo.init(); ``` + + - [10.8](#modules--multiline-imports-over-newlines) Multi-line imports should be preferred over single line + + > 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 From 098894efee58242c066644919ac4f75ff2ac17db Mon Sep 17 00:00:00 2001 From: Karan Thakkar Date: Fri, 7 Oct 2016 12:16:21 +0530 Subject: [PATCH 2/3] Remove legacy anchor link. Add dangling comma --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5bb6080d..0312fb1c 100644 --- a/README.md +++ b/README.md @@ -1223,7 +1223,7 @@ Other Style Guides foo.init(); ``` - + - [10.8](#modules--multiline-imports-over-newlines) Multi-line imports should be preferred over single line > Why? The curly braces follow the same indentation rules as every other curly brace block in the style guide, as do the trailing commas. @@ -1238,7 +1238,7 @@ Other Style Guides longNameB, longNameC, longNameD, - longNameE + longNameE, } from 'path'; ``` From b72bd520b63622477ce40c9b5a52c3514920ab81 Mon Sep 17 00:00:00 2001 From: Karan Thakkar Date: Fri, 7 Oct 2016 12:34:36 +0530 Subject: [PATCH 3/3] Fix rule description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0312fb1c..0cbf24c7 100644 --- a/README.md +++ b/README.md @@ -1224,7 +1224,7 @@ Other Style Guides ``` - - [10.8](#modules--multiline-imports-over-newlines) Multi-line imports should be preferred over single line + - [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.