put the dot with fn name when chaining

This commit is contained in:
Jake Teton-Landis
2015-01-22 17:38:38 -08:00
parent 3c68fc4946
commit 33363af613

View File

@@ -814,12 +814,21 @@
})(this);↵
```
- Use indentation when making long method chains.
- Use indentation when making long method chains. Use a leading dot, which
emphasizes that the line is a method call, not a new statement.
```javascript
// bad
$('#items').find('.selected').highlight().end().find('.open').updateCount();
// bad
$('#items').
find('selected').
highlight().
end().
find('.open').
updateCount();
// good
$('#items')
.find('.selected')