From 815df94db4cd2097297fd5be7199dcedc363079c Mon Sep 17 00:00:00 2001 From: Michael C Date: Wed, 20 Oct 2021 01:01:58 -0400 Subject: [PATCH 1/2] add eslint rule for no-console --- .eslintrc.js | 1 + src/utils/logger.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 14b67b2..e96d7da 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -27,5 +27,6 @@ module.exports = { "indent": ["warn", 4, { "SwitchCase": 1 }], "object-curly-spacing": ["warn", "always"], "require-await": "warn", + "no-console": "error" }, }; diff --git a/src/utils/logger.ts b/src/utils/logger.ts index 56a7e95..8507a46 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -79,6 +79,7 @@ class Logger { if (levelStr.length === 4) { levelStr += " "; // ensure logs are aligned } + // eslint-disable-next-line no-console console.log(colors.Dim, `${levelStr} ${new Date().toISOString()}: `, color, str, colors.Reset); } } From a9adfbc06dafee579411c2358894ba5f6a27f81e Mon Sep 17 00:00:00 2001 From: Michael C Date: Tue, 26 Oct 2021 20:37:49 -0400 Subject: [PATCH 2/2] disable eslint for error dump --- src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.ts b/src/index.ts index d945178..e58aacd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,7 @@ import { getCommit } from "./utils/getCommit"; async function init() { process.on("unhandledRejection", (error: any) => { + // eslint-disable-next-line no-console console.dir(error?.stack); process.exit(1); });