Skip to content

Commit

Permalink
put the dot with fn name when chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Teton-Landis committed Jan 30, 2015
1 parent 3c68fc4 commit 33363af
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 33363af

Please sign in to comment.