From c7082acb09c81e134b44d1739c3d511e2683f4b7 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Fri, 24 Jan 2020 11:31:32 -0500 Subject: [PATCH] Support arbitrary ESLint CLI args --- packages/node-build-scripts/es-lint.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/node-build-scripts/es-lint.js b/packages/node-build-scripts/es-lint.js index 24c4a46966..319189ed3d 100755 --- a/packages/node-build-scripts/es-lint.js +++ b/packages/node-build-scripts/es-lint.js @@ -24,10 +24,11 @@ if (process.env.JUNIT_REPORT_PATH != null) { outputStream = fs.createWriteStream(out, { flags: "w+" }); } -const commandLineOptions = ["--color", "-f", format]; -if (process.argv.includes("--fix")) { - commandLineOptions.push("--fix") -} +const additionalArgs = process.argv.filter(a => { + // exclude engine and script name + return ["node", "es-lint"].every(s => path.basename(a) !== s); +}); +const commandLineOptions = ["--color", "-f", format, ...additionalArgs]; // ESLint will fail if provided with no files, so we expand the glob before running it const fileGlob = "{src,test}/!(generated)/**/*.{ts,tsx}";