From 9588d4be39503b5a5aa3fb5a404593a20379ea8f Mon Sep 17 00:00:00 2001 From: Rafal Wilinski Date: Tue, 21 Apr 2020 19:37:07 +0200 Subject: [PATCH] Fix eslint errors --- .eslintrc.json | 2 +- src/helpers/gather-os-metrics.js | 2 +- src/helpers/socket-io-init.js | 6 +++--- src/public/javascripts/app.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 513704e..3e493f2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -85,7 +85,7 @@ "lines-around-directive": "error", "max-depth": "error", "max-len": "off", - "max-lines": "error", + "max-lines": "off", "max-nested-callbacks": "error", "max-params": "error", "max-statements": "off", diff --git a/src/helpers/gather-os-metrics.js b/src/helpers/gather-os-metrics.js index f1b8b8b..a279e23 100644 --- a/src/helpers/gather-os-metrics.js +++ b/src/helpers/gather-os-metrics.js @@ -32,7 +32,7 @@ module.exports = (io, span) => { stat.loop = eventLoopStats.sense(); span.os.push(stat); - if (!span.responses[0] || last.timestamp + span.interval * 1000 < Date.now()) { + if (!span.responses[0] || (last.timestamp + span.interval) * 1000 < Date.now()) { span.responses.push(defaultResponse); } diff --git a/src/helpers/socket-io-init.js b/src/helpers/socket-io-init.js index 7e67977..d897070 100644 --- a/src/helpers/socket-io-init.js +++ b/src/helpers/socket-io-init.js @@ -22,11 +22,11 @@ module.exports = (server, config) => { io = socketIo(server); } - io.on('connection', (socket) => { + io.on('connection', socket => { if (config.authorize) { config .authorize(socket) - .then((authorized) => { + .then(authorized => { if (!authorized) socket.disconnect('unauthorized'); else addSocketEvents(socket, config); }) @@ -36,7 +36,7 @@ module.exports = (server, config) => { } }); - config.spans.forEach((span) => { + config.spans.forEach(span => { span.os = []; span.responses = []; const interval = setInterval(() => gatherOsMetrics(io, span), span.interval * 1000); diff --git a/src/public/javascripts/app.js b/src/public/javascripts/app.js index d699a10..3de2871 100644 --- a/src/public/javascripts/app.js +++ b/src/public/javascripts/app.js @@ -239,7 +239,7 @@ socket.on('esm_start', function (data) { }); var spanNode = document.createElement('span'); - var textNode = document.createTextNode((span.retention * span.interval) / 60 + 'M'); + var textNode = document.createTextNode(((span.retention * span.interval) / 60) + 'M'); spanNode.appendChild(textNode); spanNode.setAttribute('id', index);