From c03ec7a2b6c53e17c6e51e742570122d4af68505 Mon Sep 17 00:00:00 2001 From: Suhas Karanth Date: Sun, 6 Aug 2017 15:21:21 +0530 Subject: [PATCH] fix: Don't pass fn reference(`commandConvert`) to `commandArgs.map` (#135) If a function reference is passed directly to `Array#map`, it is invoked with the array item, index, and the array. Instead of passing the function reference, invoke it explicitly with just the array item. See https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/no-fn-reference-in-iterator.md --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 8c9f9e9..e8c68f4 100644 --- a/src/index.js +++ b/src/index.js @@ -13,7 +13,7 @@ function crossEnv(args, options = {}) { // run `path.normalize` for command(on windows) commandConvert(command, true), // by default normalize is `false`, so not run for cmd args - commandArgs.map(commandConvert), + commandArgs.map(arg => commandConvert(arg)), { stdio: 'inherit', shell: options.shell,