From 5517a913d44c8781983f7e5577df13c1eb3fa67d Mon Sep 17 00:00:00 2001 From: rejas Date: Thu, 13 Feb 2020 08:35:09 +0100 Subject: [PATCH] Run linter manually --- config/config.js.sample | 2 +- js/server.js | 4 ++-- modules/default/clock/clock.js | 16 ++++++++-------- tests/node_modules/webdriverajaxstub/index.js | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/config/config.js.sample b/config/config.js.sample index 01a41caa..67656392 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -24,7 +24,7 @@ var config = { useHttps: false, // Support HTTPS or not, default "false" will use HTTP httpsPrivateKey: "", // HTTPS private key path, only require when useHttps is true httpsCertificate: "", // HTTPS Certificate path, only require when useHttps is true - + language: "en", timeFormat: 24, units: "metric", diff --git a/js/server.js b/js/server.js index 19bdfb91..185790af 100644 --- a/js/server.js +++ b/js/server.js @@ -25,13 +25,13 @@ var Server = function(config, callback) { var options = { key: fs.readFileSync(config.httpsPrivateKey), cert: fs.readFileSync(config.httpsCertificate) - } + }; server = require("https").Server(options, app); }else{ server = require("http").Server(app); } var io = require("socket.io")(server); - + console.log("Starting server on port " + port + " ... "); server.listen(port, config.address ? config.address : "localhost"); diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index 2490a0ce..ab17a3c7 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -152,9 +152,9 @@ Module.register("clock",{ } function formatTime(config, time) { - var formatString = hourSymbol + ':mm'; + var formatString = hourSymbol + ":mm"; if (config.showPeriod && config.timeFormat !== 24) { - formatString += config.showPeriodUpper ? 'A' : 'a'; + formatString += config.showPeriodUpper ? "A" : "a"; } return moment(time).format(formatString); } @@ -167,14 +167,14 @@ Module.register("clock",{ } else if (now.isBefore(sunTimes.sunset)) { nextEvent = sunTimes.sunset; } else { - const tomorrowSunTimes = SunCalc.getTimes(now.clone().add(1, 'day'), this.config.lat, this.config.lon); + const tomorrowSunTimes = SunCalc.getTimes(now.clone().add(1, "day"), this.config.lat, this.config.lon); nextEvent = tomorrowSunTimes.sunrise; } const untilNextEvent = moment.duration(moment(nextEvent).diff(now)); - const untilNextEventString = untilNextEvent.hours() + 'h ' + untilNextEvent.minutes() + 'm'; - sunWrapper.innerHTML = ' ' + untilNextEventString + '' + - '' + formatTime(this.config, sunTimes.sunrise) + '' + - '' + formatTime(this.config, sunTimes.sunset) + ''; + const untilNextEventString = untilNextEvent.hours() + "h " + untilNextEvent.minutes() + "m"; + sunWrapper.innerHTML = " " + untilNextEventString + "" + + "" + formatTime(this.config, sunTimes.sunrise) + "" + + "" + formatTime(this.config, sunTimes.sunset) + ""; } if (this.config.showMoonTimes) { const moonIllumination = SunCalc.getMoonIllumination(now.toDate()); @@ -184,7 +184,7 @@ Module.register("clock",{ if (moment(moonTimes.set).isAfter(moonTimes.rise)) { moonSet = moonTimes.set; } else { - const nextMoonTimes = SunCalc.getMoonTimes(now.clone().add(1, 'day'), this.config.lat, this.config.lon); + const nextMoonTimes = SunCalc.getMoonTimes(now.clone().add(1, "day"), this.config.lat, this.config.lon); moonSet = nextMoonTimes.set; } const isVisible = now.isBetween(moonRise, moonSet) || moonTimes.alwaysUp === true; diff --git a/tests/node_modules/webdriverajaxstub/index.js b/tests/node_modules/webdriverajaxstub/index.js index 031de5ac..186033b6 100644 --- a/tests/node_modules/webdriverajaxstub/index.js +++ b/tests/node_modules/webdriverajaxstub/index.js @@ -13,7 +13,7 @@ function plugin (wdInstance, requests) { this.send = function () { this.status = 200; this.readyState = 4; - const response = this.url.includes('.njk') ? template : data; + const response = this.url.includes(".njk") ? template : data; this.response = response; this.responseText = response; this.onreadystatechange();