add --ci option to lint command to run eslint with the .eslintrc.ci config

This commit is contained in:
Alexander T 2019-08-16 11:55:54 +03:00
parent 2b11a18d6a
commit 4c30a6027b
2 changed files with 8 additions and 1 deletions

View file

@ -336,7 +336,7 @@ const lintFoldEnd = async () => { if (fold.isTravis()) console.log(fold.end("lin
const eslint = (folder) => async () => {
const ESLINTRC_CI = ".eslintrc.ci.json";
const ESLINTRC = ".eslintrc.json";
const isCIEnv = process.env.CI === "true";
const isCIEnv = cmdLineOptions.ci || process.env.CI === "true";
const config = isCIEnv && fs.existsSync(path.resolve(folder, ESLINTRC_CI)) ? ESLINTRC_CI : ESLINTRC;
const args = [
@ -364,11 +364,17 @@ const lintCompiler = eslint("src");
lintCompiler.displayName = "lint-compiler";
task("lint-compiler", series([buildEslintRules, lintFoldStart, lintCompiler, lintFoldEnd]));
task("lint-compiler").description = "Runs eslint on the compiler sources.";
task("lint-compiler").flags = {
" --ci": "Runs eslint additional rules",
};
const lint = series([buildEslintRules, lintFoldStart, lintScripts, lintCompiler, lintFoldEnd]);
lint.displayName = "lint";
task("lint", series([buildEslintRules, lintFoldStart, lint, lintFoldEnd]));
task("lint").description = "Runs eslint on the compiler and scripts sources.";
task("lint").flags = {
" --ci": "Runs eslint additional rules",
};
const buildCancellationToken = () => buildProject("src/cancellationToken");
const cleanCancellationToken = () => cleanProject("src/cancellationToken");

View file

@ -114,6 +114,7 @@
"gulp": "gulp",
"jake": "gulp",
"lint": "gulp lint",
"lint:ci": "gulp lint --ci",
"lint:compiler": "gulp lint-compiler",
"lint:scripts": "gulp lint-scripts",
"setup-hooks": "node scripts/link-hooks.js",