Skip to content

Commit

Permalink
Support arbitrary ESLint CLI args
Browse files Browse the repository at this point in the history
  • Loading branch information
adidahiya committed Jan 24, 2020
1 parent 19bad11 commit c7082ac
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/node-build-scripts/es-lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
Expand Down

1 comment on commit c7082ac

@blueprint-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Support arbitrary ESLint CLI args

Previews: documentation | landing | table

Please sign in to comment.