From 74cea8f26d064c5494db2e3ad01d20c49962208d Mon Sep 17 00:00:00 2001 From: Martin Giger Date: Fri, 17 Jul 2020 17:59:11 +0200 Subject: [PATCH] docs: make it clearer how the reverse rules works from the doc examples (fixes #68) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ef738cb..7f66972 100644 --- a/README.md +++ b/README.md @@ -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();