From a565c01001bf2ff2acb8a608d53580b0b990f54f Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Tue, 16 Aug 2022 16:30:59 -0700 Subject: [PATCH 1/3] Run eslint at root, rather than on src and scripts individually --- .eslintignore | 3 +++ Gulpfile.js | 7 +++++-- package.json | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.eslintignore b/.eslintignore index 98f7b458c3539..078de54900063 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 007071282d0d1..6fdf58b24ad31 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -383,9 +383,12 @@ task("lint-compiler").flags = { " --ci": "Runs eslint additional rules", }; -const lint = series([buildEslintRules, lintScripts, lintCompiler]); +const lintRoot = eslint("."); +lintRoot.displayName = "lint-root"; + +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 1a4d0f4ab67dd..0f7adb0d9696d 100644 --- a/package.json +++ b/package.json @@ -107,8 +107,8 @@ "gulp": "gulp", "lint": "gulp lint", "lint:ci": "gulp lint --ci", - "lint:compiler": "gulp lint-compiler", - "lint:scripts": "gulp lint-scripts", + "lint:compiler": "gulp lint", + "lint:scripts": "gulp lint", "setup-hooks": "node scripts/link-hooks.js" }, "browser": { From 01e5ad46ec21ed990c4b074c898eddf5f4570995 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Tue, 16 Aug 2022 16:32:26 -0700 Subject: [PATCH 2/3] Undo package.json change --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0f7adb0d9696d..1a4d0f4ab67dd 100644 --- a/package.json +++ b/package.json @@ -107,8 +107,8 @@ "gulp": "gulp", "lint": "gulp lint", "lint:ci": "gulp lint --ci", - "lint:compiler": "gulp lint", - "lint:scripts": "gulp lint", + "lint:compiler": "gulp lint-compiler", + "lint:scripts": "gulp lint-scripts", "setup-hooks": "node scripts/link-hooks.js" }, "browser": { From b51f2d07e0472f76afc42fe732860281386aab4f Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Thu, 18 Aug 2022 10:22:15 -0700 Subject: [PATCH 3/3] Remove other lint tasks --- Gulpfile.js | 16 +--------------- package.json | 2 -- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/Gulpfile.js b/Gulpfile.js index 6fdf58b24ad31..ec4fafe66ba68 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,21 +369,8 @@ 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 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 lintRoot = eslint("."); -lintRoot.displayName = "lint-root"; +lintRoot.displayName = "lint"; const lint = series([buildEslintRules, lintRoot]); lint.displayName = "lint"; diff --git a/package.json b/package.json index 1a4d0f4ab67dd..1936f8a31c86f 100644 --- a/package.json +++ b/package.json @@ -107,8 +107,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": {