Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

Commit

Permalink
fix: Don't pass fn reference(commandConvert) to commandArgs.map (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
sudo-suhas authored and Kent C. Dodds committed Aug 6, 2017
1 parent 277cf07 commit c03ec7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c03ec7a

Please sign in to comment.