mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 03:53:08 +00:00
Enable ESLint no-console
rule to avoid future mistakes
This commit is contained in:
parent
2e2e201784
commit
b8399471b3
8 changed files with 7 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -35,8 +35,6 @@ const socket = io({
|
|||
});
|
||||
// Hides the "Send Message" button
|
||||
$("#submit").remove();
|
||||
|
||||
console.error(data);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
2
index.js
2
index.js
|
@ -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");
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable no-console */
|
||||
"use strict";
|
||||
|
||||
var fs = require("fs-extra");
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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(" ");
|
||||
|
|
2
test/fixtures/env.js
vendored
2
test/fixtures/env.js
vendored
|
@ -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: () => {},
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue