Skip to content

Commit

Permalink
docs: make it clearer how the reverse rules works from the doc exampl…
Browse files Browse the repository at this point in the history
…es (fixes #68)
  • Loading branch information
freaktechnik committed Jul 17, 2020
1 parent 2957434 commit 74cea8f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,16 @@ This rule is auto fixable.
#### Examples
Code that triggers this rule:
```js
const sum = array.reverse().reduce((p, c) => p + c, 0);
const string = array.reverse().reduce((p, c) => p + c, '');

const reverseSum = array.reverse().reduceRight((p, c) => p + c, 0);
const reverseString = array.reverse().reduceRight((p, c) => p + c, '');
```

Code that doesn't trigger this rule:
```js
const sum = array.reduce((p, c) => p + c, 0);
const reverseString = array.reduce((p, c) => p + c, '');

const reverseSum = array.reduceRight((p, c) => p + c, 0);
const string = array.reduceRight((p, c) => p + c, '');

const reverseArray = array.reverse();

Expand Down

0 comments on commit 74cea8f

Please sign in to comment.