From 43cb152cb9e34a71bf698ae9a99f910b0ffb1838 Mon Sep 17 00:00:00 2001 From: pimlie Date: Sat, 24 Aug 2019 12:48:42 +0200 Subject: [PATCH] chore: fix lint --- bin/eslint-multiplexer.js | 2 +- lib/index.js | 12 ++++++------ test/cli.test.js | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bin/eslint-multiplexer.js b/bin/eslint-multiplexer.js index 8e8c756..9ed8bb3 100755 --- a/bin/eslint-multiplexer.js +++ b/bin/eslint-multiplexer.js @@ -47,7 +47,7 @@ const options = buildOptions({ const args = minimist(process.argv.slice(2), options) const cli = { - input: args['_'], + input: args._, flags: args } diff --git a/lib/index.js b/lib/index.js index 2ad2258..a49a7d8 100644 --- a/lib/index.js +++ b/lib/index.js @@ -80,11 +80,11 @@ class Multiplexer { resolveModulePath(modulePath) { const cwd = process.cwd() const paths = [ - [ cwd, 'node_modules', modulePath, 'bin', modulePath + '.js' ], - [ cwd, 'node_modules', modulePath, 'bin', modulePath ], - [ cwd, 'node_modules', '.bin', modulePath ], - [ __dirname, '..', 'node_modules', '.bin', modulePath ], - [ cwd, modulePath ], + [cwd, 'node_modules', modulePath, 'bin', modulePath + '.js'], + [cwd, 'node_modules', modulePath, 'bin', modulePath], + [cwd, 'node_modules', '.bin', modulePath], + [__dirname, '..', 'node_modules', '.bin', modulePath], + [cwd, modulePath], [''] ] for (let i = 0; i < paths.length; i++) { @@ -154,7 +154,7 @@ class Multiplexer { Array.prototype.push.apply(args, ['-f', 'json']) const sp = spawn(process.execPath, args, { - stdio: [ 'ignore', 'pipe', 'inherit' ] + stdio: ['ignore', 'pipe', 'inherit'] }) let data = '' diff --git a/test/cli.test.js b/test/cli.test.js index 2089c10..05626ad 100644 --- a/test/cli.test.js +++ b/test/cli.test.js @@ -153,13 +153,13 @@ describe('cli', () => { './node_modules/eslint/bin/eslint.js', '--no-ignore', './test/fixtures', '-f', 'json' - ], { stdio: [ 'inherit', 'pipe', 'inherit' ] }) + ], { stdio: ['inherit', 'pipe', 'inherit'] }) const multiplexer = spawn(process.execPath, [ './bin/eslint-multiplexer', '--nopipe', '-b' - ], { stdio: [ 'pipe', 'pipe', 'pipe' ] }) + ], { stdio: ['pipe', 'pipe', 'pipe'] }) multiplexer.stdin.setEncoding('utf8') eslint.stdout.pipe(multiplexer.stdin) @@ -189,13 +189,13 @@ describe('cli', () => { './bin/eslint-multiplexer', 'eslint', '--no-ignore', './test/fixtures/index.js' - ], { stdio: [ 'inherit', 'pipe', 'inherit' ] }) + ], { stdio: ['inherit', 'pipe', 'inherit'] }) const eslint2 = spawn(process.execPath, [ './bin/eslint-multiplexer', 'eslint', '--no-ignore', './test/fixtures/first/index.js' - ], { stdio: [ 'pipe', 'pipe', 'inherit' ] }) + ], { stdio: ['pipe', 'pipe', 'inherit'] }) eslint2.stdin.setEncoding('utf8') eslint1.stdout.pipe(eslint2.stdin) @@ -204,7 +204,7 @@ describe('cli', () => { './bin/eslint-multiplexer', '--nopipe', '-b', '--debug' - ], { stdio: [ 'pipe', 'pipe', 'pipe' ] }) + ], { stdio: ['pipe', 'pipe', 'pipe'] }) multiplexer.stdin.setEncoding('utf8') eslint2.stdout.pipe(multiplexer.stdin)