mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 23:15:48 +01:00
chore: eslint no-var, vars-on-top
This commit is contained in:
committed by
Julian Lam
parent
b56d9e12b5
commit
dab3b23575
@@ -13,7 +13,7 @@ function setupWinston() {
|
||||
return;
|
||||
}
|
||||
|
||||
var formats = [];
|
||||
const formats = [];
|
||||
if (nconf.get('log-colorize') !== 'false') {
|
||||
formats.push(winston.format.colorize());
|
||||
}
|
||||
@@ -23,7 +23,7 @@ function setupWinston() {
|
||||
formats.push(winston.format.json());
|
||||
} else {
|
||||
const timestampFormat = winston.format((info) => {
|
||||
var dateString = `${new Date().toISOString()} [${nconf.get('port')}/${global.process.pid}]`;
|
||||
const dateString = `${new Date().toISOString()} [${nconf.get('port')}/${global.process.pid}]`;
|
||||
info.level = `${dateString} - ${info.level}`;
|
||||
return info;
|
||||
});
|
||||
@@ -60,10 +60,10 @@ function loadConfig(configFile) {
|
||||
});
|
||||
|
||||
// Explicitly cast as Bool, loader.js passes in isCluster as string 'true'/'false'
|
||||
var castAsBool = ['isCluster', 'isPrimary', 'jobsDisabled'];
|
||||
const castAsBool = ['isCluster', 'isPrimary', 'jobsDisabled'];
|
||||
nconf.stores.env.readOnly = false;
|
||||
castAsBool.forEach((prop) => {
|
||||
var value = nconf.get(prop);
|
||||
const value = nconf.get(prop);
|
||||
if (value !== undefined) {
|
||||
nconf.set(prop, typeof value === 'boolean' ? value : String(value).toLowerCase() === 'true');
|
||||
}
|
||||
@@ -104,10 +104,10 @@ function loadConfig(configFile) {
|
||||
}
|
||||
|
||||
function versionCheck() {
|
||||
var version = process.version.slice(1);
|
||||
var range = pkg.engines.node;
|
||||
var semver = require('semver');
|
||||
var compatible = semver.satisfies(version, range);
|
||||
const version = process.version.slice(1);
|
||||
const range = pkg.engines.node;
|
||||
const semver = require('semver');
|
||||
const compatible = semver.satisfies(version, range);
|
||||
|
||||
if (!compatible) {
|
||||
winston.warn('Your version of Node.js is too outdated for NodeBB. Please update your version of Node.js.');
|
||||
|
||||
Reference in New Issue
Block a user