Enable prefer-const lint rule (#3202)
This commit is contained in:
committed by
Florent Vilmart
parent
a6c988176e
commit
ca286b7108
@@ -35,7 +35,7 @@ function startServer(options, callback) {
|
||||
|
||||
app.use(options.mountPath, api);
|
||||
|
||||
let server = app.listen(options.port, options.host, callback);
|
||||
const server = app.listen(options.port, options.host, callback);
|
||||
server.on('connection', initializeConnections);
|
||||
|
||||
if (options.startLiveQueryServer || options.liveQueryServerOptions) {
|
||||
@@ -69,7 +69,7 @@ function startServer(options, callback) {
|
||||
}
|
||||
}
|
||||
|
||||
let handleShutdown = function() {
|
||||
const handleShutdown = function() {
|
||||
console.log('Termination signal received. Shutting down.');
|
||||
destroyAliveConnections();
|
||||
server.close(function () {
|
||||
|
||||
@@ -68,7 +68,7 @@ function parseConfigFile(program) {
|
||||
if (program.args.length > 0) {
|
||||
let jsonPath = program.args[0];
|
||||
jsonPath = path.resolve(jsonPath);
|
||||
let jsonConfig = require(jsonPath);
|
||||
const jsonConfig = require(jsonPath);
|
||||
if (jsonConfig.apps) {
|
||||
if (jsonConfig.apps.length > 1) {
|
||||
throw 'Multiple apps are not supported';
|
||||
@@ -78,11 +78,11 @@ function parseConfigFile(program) {
|
||||
options = jsonConfig;
|
||||
}
|
||||
Object.keys(options).forEach((key) => {
|
||||
let value = options[key];
|
||||
const value = options[key];
|
||||
if (!_definitions[key]) {
|
||||
throw `error: unknown option ${key}`;
|
||||
}
|
||||
let action = _definitions[key].action;
|
||||
const action = _definitions[key].action;
|
||||
if (action) {
|
||||
options[key] = action(value);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import program from './commander';
|
||||
|
||||
function logStartupOptions(options) {
|
||||
for (let key in options) {
|
||||
for (const key in options) {
|
||||
let value = options[key];
|
||||
if (key == "masterKey") {
|
||||
value = "***REDACTED***";
|
||||
@@ -31,7 +31,7 @@ export default function({
|
||||
}
|
||||
program.parse(process.argv, process.env);
|
||||
|
||||
let options = program.getOptions();
|
||||
const options = program.getOptions();
|
||||
start(program, options, function() {
|
||||
logStartupOptions(options);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user