Merge pull request #387 from mchangrh/no-console

[ESLint] noconsole
This commit is contained in:
Ajay Ramachandran
2021-10-26 20:39:43 -04:00
committed by GitHub
3 changed files with 3 additions and 0 deletions

View File

@@ -27,5 +27,6 @@ module.exports = {
"indent": ["warn", 4, { "SwitchCase": 1 }], "indent": ["warn", 4, { "SwitchCase": 1 }],
"object-curly-spacing": ["warn", "always"], "object-curly-spacing": ["warn", "always"],
"require-await": "warn", "require-await": "warn",
"no-console": "error"
}, },
}; };

View File

@@ -7,6 +7,7 @@ import { getCommit } from "./utils/getCommit";
async function init() { async function init() {
process.on("unhandledRejection", (error: any) => { process.on("unhandledRejection", (error: any) => {
// eslint-disable-next-line no-console
console.dir(error?.stack); console.dir(error?.stack);
process.exit(1); process.exit(1);
}); });

View File

@@ -79,6 +79,7 @@ class Logger {
if (levelStr.length === 4) { if (levelStr.length === 4) {
levelStr += " "; // ensure logs are aligned levelStr += " "; // ensure logs are aligned
} }
// eslint-disable-next-line no-console
console.log(colors.Dim, `${levelStr} ${new Date().toISOString()}: `, color, str, colors.Reset); console.log(colors.Dim, `${levelStr} ${new Date().toISOString()}: `, color, str, colors.Reset);
} }
} }