Enable ESLint no-console
rule to avoid future mistakes
This commit is contained in:
parent
2e2e201784
commit
b8399471b3
@ -28,7 +28,6 @@ rules:
|
|||||||
linebreak-style: [2, unix]
|
linebreak-style: [2, unix]
|
||||||
no-catch-shadow: 2
|
no-catch-shadow: 2
|
||||||
no-confusing-arrow: 2
|
no-confusing-arrow: 2
|
||||||
no-console: 0
|
|
||||||
no-control-regex: 0
|
no-control-regex: 0
|
||||||
no-duplicate-imports: 2
|
no-duplicate-imports: 2
|
||||||
no-else-return: 2
|
no-else-return: 2
|
||||||
|
@ -35,8 +35,6 @@ const socket = io({
|
|||||||
});
|
});
|
||||||
// Hides the "Send Message" button
|
// Hides the "Send Message" button
|
||||||
$("#submit").remove();
|
$("#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
|
// Doing this check as soon as possible allows us to avoid ES6 parser errors or other issues
|
||||||
var pkg = require("./package.json");
|
var pkg = require("./package.json");
|
||||||
if (!require("semver").satisfies(process.version, pkg.engines.node)) {
|
if (!require("semver").satisfies(process.version, pkg.engines.node)) {
|
||||||
|
/* eslint-disable no-console */
|
||||||
console.error("=== WARNING!");
|
console.error("=== WARNING!");
|
||||||
console.error("=== The oldest supported Node.js version is", pkg.engines.node);
|
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");
|
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");
|
require("./src/command-line");
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable no-console */
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var fs = require("fs-extra");
|
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())}.`,
|
` 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() {
|
static defaultLoungeHome() {
|
||||||
|
@ -16,6 +16,7 @@ function timestamp(type, messageArgs) {
|
|||||||
return messageArgs;
|
return messageArgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* eslint-disable no-console */
|
||||||
exports.error = function() {
|
exports.error = function() {
|
||||||
console.error.apply(console, timestamp(colors.red("[ERROR]"), arguments));
|
console.error.apply(console, timestamp(colors.red("[ERROR]"), arguments));
|
||||||
};
|
};
|
||||||
@ -31,6 +32,7 @@ exports.info = function() {
|
|||||||
exports.debug = function() {
|
exports.debug = function() {
|
||||||
console.log.apply(console, timestamp(colors.green("[DEBUG]"), arguments));
|
console.log.apply(console, timestamp(colors.green("[DEBUG]"), arguments));
|
||||||
};
|
};
|
||||||
|
/* eslint-enable no-console */
|
||||||
|
|
||||||
exports.prompt = (options, callback) => {
|
exports.prompt = (options, callback) => {
|
||||||
options.prompt = timestamp(colors.cyan("[PROMPT]"), [options.text]).join(" ");
|
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";
|
"use strict";
|
||||||
|
|
||||||
global.log = {
|
global.log = {
|
||||||
error: () => console.error.apply(console, arguments),
|
error: () => console.error.apply(console, arguments), // eslint-disable-line no-console
|
||||||
warn: () => {},
|
warn: () => {},
|
||||||
info: () => {},
|
info: () => {},
|
||||||
debug: () => {},
|
debug: () => {},
|
||||||
|
@ -79,8 +79,6 @@ if (process.env.NODE_ENV === "production") {
|
|||||||
sourceMap: true,
|
sourceMap: true,
|
||||||
comments: false
|
comments: false
|
||||||
}));
|
}));
|
||||||
} else {
|
|
||||||
console.log("Building in development mode, bundles will not be minified.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = config;
|
module.exports = config;
|
||||||
|
Loading…
Reference in New Issue
Block a user