From 07244d38526bd17620549cb4c0821b5de2ac51fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Molini=C3=A9?= Date: Fri, 24 Dec 2021 14:23:51 +0100 Subject: [PATCH] chore: review fixes --- lib/rules/block-indentation.js | 2 +- test/unit/rules/block-indentation-test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rules/block-indentation.js b/lib/rules/block-indentation.js index d5fb5f0be1..6e43b0a779 100644 --- a/lib/rules/block-indentation.js +++ b/lib/rules/block-indentation.js @@ -276,7 +276,7 @@ module.exports = class BlockIndentation extends Rule { } } - // Process all the child with the path to access the child from the current node + // Recreate the node only if the source has changed, otherwise this would mean useless computation and possible mistake if (sourceBeforeFix !== this.sourceEdited && this.sourceEdited) { fixedNode = this.fixLine( this.sourceEdited.split('\n'), diff --git a/test/unit/rules/block-indentation-test.js b/test/unit/rules/block-indentation-test.js index dbffd22345..a179144074 100644 --- a/test/unit/rules/block-indentation-test.js +++ b/test/unit/rules/block-indentation-test.js @@ -227,7 +227,7 @@ generateRuleTests({ '{{/if}}', ].join('\n'), }, - ].filter((value, index) => index >= 0), + ], bad: [ {