From df25b77d0fba39fe9ed054d045e5d26630d790c4 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Thu, 18 Aug 2022 11:24:10 -0700 Subject: [PATCH] Run eslint at root, rather than on src and scripts individually (#50327) --- .eslintignore | 3 +++ Gulpfile.js | 19 ++++--------------- package.json | 2 -- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/.eslintignore b/.eslintignore index 98f7b458c35..078de549000 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,9 @@ +**/node_modules/** /built/local/** /tests/** /lib/** /src/lib/*.generated.d.ts /scripts/*.js /scripts/eslint/built/** +/internal/** +/coverage/** diff --git a/Gulpfile.js b/Gulpfile.js index 007071282d0..ec4fafe66ba 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -350,7 +350,6 @@ task("run-eslint-rules-tests").description = "Runs the eslint rule tests"; /** @type { (folder: string) => { (): Promise; displayName?: string } } */ const eslint = (folder) => async () => { - const formatter = cmdLineOptions.ci ? "stylish" : "autolinkable-stylish"; const args = [ "node_modules/eslint/bin/eslint", @@ -370,22 +369,12 @@ const eslint = (folder) => async () => { return exec(process.execPath, args); }; -const lintScripts = eslint("scripts"); -lintScripts.displayName = "lint-scripts"; -task("lint-scripts", series([buildEslintRules, lintScripts])); -task("lint-scripts").description = "Runs eslint on the scripts sources."; +const lintRoot = eslint("."); +lintRoot.displayName = "lint"; -const lintCompiler = eslint("src"); -lintCompiler.displayName = "lint-compiler"; -task("lint-compiler", series([buildEslintRules, lintCompiler])); -task("lint-compiler").description = "Runs eslint on the compiler sources."; -task("lint-compiler").flags = { - " --ci": "Runs eslint additional rules", -}; - -const lint = series([buildEslintRules, lintScripts, lintCompiler]); +const lint = series([buildEslintRules, lintRoot]); lint.displayName = "lint"; -task("lint", series([buildEslintRules, lint])); +task("lint", lint); task("lint").description = "Runs eslint on the compiler and scripts sources."; task("lint").flags = { " --ci": "Runs eslint additional rules", diff --git a/package.json b/package.json index 5d04854f854..d0655e1343e 100644 --- a/package.json +++ b/package.json @@ -108,8 +108,6 @@ "gulp": "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" }, "browser": {