From 899d3995f9429a5deee04bdf51345676bd2ffe3c Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Wed, 1 Apr 2020 12:20:52 +0530 Subject: [PATCH 1/2] refactor: remove redundant check --- lib/runAll.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/runAll.js b/lib/runAll.js index fe5fd1a4e..76e223759 100644 --- a/lib/runAll.js +++ b/lib/runAll.js @@ -115,7 +115,7 @@ const runAll = async ( // lint-staged 10 will automatically add modifications to index // Warn user when their command includes `git add` - let hasDeprecatedGitAdd = false + let hasDeprecatedGitAdd const listrOptions = { dateFormat: false, @@ -137,9 +137,7 @@ const runAll = async ( shell }) - if (subTasks.some(subTask => subTask.command === 'git add')) { - hasDeprecatedGitAdd = true - } + hasDeprecatedGitAdd = subTasks.some(subTask => subTask.command === 'git add') chunkListrTasks.push({ title: `Running tasks for ${task.pattern}`, From 3c57d2952cbeea0e60d2aa222a484a05e02a1f9e Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Wed, 1 Apr 2020 13:38:58 +0530 Subject: [PATCH 2/2] refactor: prefer explicit default value --- lib/runAll.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/runAll.js b/lib/runAll.js index 76e223759..328efa5d9 100644 --- a/lib/runAll.js +++ b/lib/runAll.js @@ -115,7 +115,7 @@ const runAll = async ( // lint-staged 10 will automatically add modifications to index // Warn user when their command includes `git add` - let hasDeprecatedGitAdd + let hasDeprecatedGitAdd = false const listrOptions = { dateFormat: false,