Enable ESLint no-console rule to avoid future mistakes

This commit is contained in:
Jérémie Astori 2017-09-17 21:50:21 -04:00
parent 2e2e201784
commit b8399471b3
No known key found for this signature in database
GPG key ID: B9A4F245CD67BDE8
8 changed files with 7 additions and 7 deletions

View file

@ -28,7 +28,6 @@ rules:
linebreak-style: [2, unix]
no-catch-shadow: 2
no-confusing-arrow: 2
no-console: 0
no-control-regex: 0
no-duplicate-imports: 2
no-else-return: 2

View file

@ -35,8 +35,6 @@ const socket = io({
});
// Hides the "Send Message" button
$("#submit").remove();
console.error(data);
});
});

View file

@ -8,9 +8,11 @@ process.chdir(__dirname);
// Doing this check as soon as possible allows us to avoid ES6 parser errors or other issues
var pkg = require("./package.json");
if (!require("semver").satisfies(process.version, pkg.engines.node)) {
/* eslint-disable no-console */
console.error("=== WARNING!");
console.error("=== The oldest supported Node.js version is", pkg.engines.node);
console.error("=== We strongly encourage you to upgrade, see https://nodejs.org/en/download/package-manager/ for more details\n");
/* eslint-enable no-console */
}
require("./src/command-line");

View file

@ -1,3 +1,4 @@
/* eslint-disable no-console */
"use strict";
var fs = require("fs-extra");

View file

@ -15,7 +15,7 @@ class Utils {
"",
` LOUNGE_HOME Path for all configuration files and folders. Defaults to ${colors.green(Utils.defaultLoungeHome())}.`,
"",
].forEach((e) => console.log(e));
].forEach((e) => console.log(e)); // eslint-disable-line no-console
}
static defaultLoungeHome() {

View file

@ -16,6 +16,7 @@ function timestamp(type, messageArgs) {
return messageArgs;
}
/* eslint-disable no-console */
exports.error = function() {
console.error.apply(console, timestamp(colors.red("[ERROR]"), arguments));
};
@ -31,6 +32,7 @@ exports.info = function() {
exports.debug = function() {
console.log.apply(console, timestamp(colors.green("[DEBUG]"), arguments));
};
/* eslint-enable no-console */
exports.prompt = (options, callback) => {
options.prompt = timestamp(colors.cyan("[PROMPT]"), [options.text]).join(" ");

View file

@ -1,7 +1,7 @@
"use strict";
global.log = {
error: () => console.error.apply(console, arguments),
error: () => console.error.apply(console, arguments), // eslint-disable-line no-console
warn: () => {},
info: () => {},
debug: () => {},

View file

@ -79,8 +79,6 @@ if (process.env.NODE_ENV === "production") {
sourceMap: true,
comments: false
}));
} else {
console.log("Building in development mode, bundles will not be minified.");
}
module.exports = config;