Skip to content

Commit 7a9ca5a

Browse files
committed
Merge pull request #230 from justjake/no-trailing-dot
put the dot with fn name when chaining
2 parents 1e22029 + 33363af commit 7a9ca5a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,12 +814,21 @@
814814
})(this);↵
815815
```
816816

817-
- Use indentation when making long method chains.
817+
- Use indentation when making long method chains. Use a leading dot, which
818+
emphasizes that the line is a method call, not a new statement.
818819

819820
```javascript
820821
// bad
821822
$('#items').find('.selected').highlight().end().find('.open').updateCount();
822823
824+
// bad
825+
$('#items').
826+
find('selected').
827+
highlight().
828+
end().
829+
find('.open').
830+
updateCount();
831+
823832
// good
824833
$('#items')
825834
.find('.selected')

0 commit comments

Comments
 (0)