diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91f44f272a645..e064f3eae3e1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: - run: npm ci - name: Linter - run: npm run lint:ci + run: npm run lint browser-integration: runs-on: ubuntu-latest diff --git a/Gulpfile.js b/Gulpfile.js index 7f527a93a0b57..d422b2f8e1a99 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -372,9 +372,6 @@ const lint = eslint("."); lint.displayName = "lint"; task("lint", lint); 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"); diff --git a/package.json b/package.json index 6ad6f556ae6a0..d21e3030d1b01 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,6 @@ "clean": "gulp clean", "gulp": "gulp", "lint": "gulp lint", - "lint:ci": "gulp lint --ci", "setup-hooks": "node scripts/link-hooks.js" }, "browser": { diff --git a/scripts/build/options.js b/scripts/build/options.js index 2c2d7c7b0a1db..8fe0bc5593ace 100644 --- a/scripts/build/options.js +++ b/scripts/build/options.js @@ -2,9 +2,11 @@ const minimist = require("minimist"); const os = require("os"); +const ci = ["1", "true"].includes(process.env.CI); + /** @type {CommandLineOptions} */ module.exports = minimist(process.argv.slice(2), { - boolean: ["dirty", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built"], + boolean: ["dirty", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built", "ci"], string: ["browser", "tests", "break", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"], alias: { /* eslint-disable quote-props */ @@ -33,12 +35,13 @@ module.exports = minimist(process.argv.slice(2), { reporter: process.env.reporter || process.env.r, lint: process.env.lint || true, fix: process.env.fix || process.env.f, - workers: process.env.workerCount || ((os.cpus().length - (process.env.CI ? 0 : 1)) || 1), + workers: process.env.workerCount || ((os.cpus().length - (ci ? 0 : 1)) || 1), failed: false, keepFailed: false, lkg: true, dirty: false, - built: false + built: false, + ci, } }); @@ -67,6 +70,7 @@ if (module.exports.built) { * @property {string|number} timeout * @property {boolean} failed * @property {boolean} keepFailed + * @property {boolean} ci * * @typedef {import("minimist").ParsedArgs & TypedOptions} CommandLineOptions */ diff --git a/scripts/build/tests.js b/scripts/build/tests.js index be5592faf8a1d..4dd76c1f62e69 100644 --- a/scripts/build/tests.js +++ b/scripts/build/tests.js @@ -123,7 +123,7 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode) errorStatus = exitCode; error = new Error(`Process exited with status code ${errorStatus}.`); } - else if (process.env.CI === "true") { + else if (cmdLineOptions.ci) { // finally, do a sanity check and build the compiler with the built version of itself log.info("Starting sanity check build..."); // Cleanup everything except lint rules (we'll need those later and would rather not waste time rebuilding them)