From 8c838b2a6eb3f92b32894926a19e8fd7116d3949 Mon Sep 17 00:00:00 2001 From: Kevin Barabash Date: Fri, 14 Apr 2023 16:25:26 -0400 Subject: [PATCH] Remove logging from eslint-plugin-khan (#649) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary: The console.logs make the CI logs really noisy and they don't need to be there. Issue: None ## Test plan: - yarn --cwd packages/eslint-plugin-khan test Author: kevinbarabash Reviewers: jeresig Required Reviewers: Approved By: jeresig Checks: ✅ codecov/project, ✅ Test (macos-latest, 16.x), ✅ CodeQL, ✅ Lint, typecheck, and coverage check (ubuntu-latest, 16.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 16.x), ⏭ dependabot, ✅ gerald, ✅ Analyze (javascript) Pull Request URL: https://github.com/Khan/wonder-stuff/pull/649 --- .changeset/calm-schools-tease.md | 5 +++++ packages/eslint-plugin-khan/.eslintrc.js | 1 - .../eslint-plugin-khan/lib/rules/imports-requiring-flow.js | 3 --- .../eslint-plugin-khan/test/flow-array-type-style_test.js | 4 +--- .../eslint-plugin-khan/test/imports-requiring-flow_test.js | 4 +--- packages/eslint-plugin-khan/test/sync-tag_test.js | 1 + 6 files changed, 8 insertions(+), 10 deletions(-) create mode 100644 .changeset/calm-schools-tease.md diff --git a/.changeset/calm-schools-tease.md b/.changeset/calm-schools-tease.md new file mode 100644 index 00000000..b9198bf9 --- /dev/null +++ b/.changeset/calm-schools-tease.md @@ -0,0 +1,5 @@ +--- +"@khanacademy/eslint-plugin": patch +--- + +Remove logging diff --git a/packages/eslint-plugin-khan/.eslintrc.js b/packages/eslint-plugin-khan/.eslintrc.js index 0153a84c..79120fd0 100644 --- a/packages/eslint-plugin-khan/.eslintrc.js +++ b/packages/eslint-plugin-khan/.eslintrc.js @@ -1,7 +1,6 @@ /* eslint-disable import/no-commonjs */ module.exports = { rules: { - "no-console": "off", "import/extensions": "off", "import/no-commonjs": "off", "import/order": "off", diff --git a/packages/eslint-plugin-khan/lib/rules/imports-requiring-flow.js b/packages/eslint-plugin-khan/lib/rules/imports-requiring-flow.js index 7ad80cce..1d6f8a00 100644 --- a/packages/eslint-plugin-khan/lib/rules/imports-requiring-flow.js +++ b/packages/eslint-plugin-khan/lib/rules/imports-requiring-flow.js @@ -9,9 +9,6 @@ const checkImport = (context, rootDir, importPath, node) => { ? testRulePath : `${testRulePath}${path.sep}`; - console.log("testImportPath = ", testImportPath); - console.log("testRulePath = ", testRulePath); - // If the path is the same, then it's a match for the error. // If the path starts with the module listed, then it's also a match. if ( diff --git a/packages/eslint-plugin-khan/test/flow-array-type-style_test.js b/packages/eslint-plugin-khan/test/flow-array-type-style_test.js index e5068851..1d3d4833 100644 --- a/packages/eslint-plugin-khan/test/flow-array-type-style_test.js +++ b/packages/eslint-plugin-khan/test/flow-array-type-style_test.js @@ -1,10 +1,8 @@ const {rules} = require("../lib/index.js"); const RuleTester = require("eslint").RuleTester; -const parserPath = require.resolve("@babel/eslint-parser"); -console.log("parserPath = ", parserPath); const parserOptions = { - parser: parserPath, + parser: require.resolve("@babel/eslint-parser"), }; const ruleTester = new RuleTester(parserOptions); diff --git a/packages/eslint-plugin-khan/test/imports-requiring-flow_test.js b/packages/eslint-plugin-khan/test/imports-requiring-flow_test.js index b7d0f285..d20f4ddb 100644 --- a/packages/eslint-plugin-khan/test/imports-requiring-flow_test.js +++ b/packages/eslint-plugin-khan/test/imports-requiring-flow_test.js @@ -3,10 +3,8 @@ const path = require("path"); const {rules} = require("../lib/index.js"); const RuleTester = require("eslint").RuleTester; -const parserPath = require.resolve("@babel/eslint-parser"); -console.log("parserPath = ", parserPath); const parserOptions = { - parser: parserPath, + parser: require.resolve("@babel/eslint-parser"), }; const ruleTester = new RuleTester(parserOptions); diff --git a/packages/eslint-plugin-khan/test/sync-tag_test.js b/packages/eslint-plugin-khan/test/sync-tag_test.js index a5160e00..3bcf3009 100644 --- a/packages/eslint-plugin-khan/test/sync-tag_test.js +++ b/packages/eslint-plugin-khan/test/sync-tag_test.js @@ -13,6 +13,7 @@ const rule = rules["sync-tag"]; assert(util.execSync); util.execSync = (command) => { + // eslint-disable-next-line no-console console.log("execSync mock --------"); if (command.includes("filea")) { const json = JSON.stringify({