Skip to content

Commit

Permalink
Merge pull request #230 from justjake/no-trailing-dot
Browse files Browse the repository at this point in the history
put the dot with fn name when chaining
  • Loading branch information
hshoff committed Jan 30, 2015
2 parents 1e22029 + 33363af commit 7a9ca5a
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 7a9ca5a

Please sign in to comment.