From a3b4d985ac46a84fcdfaf545022983516cda60c8 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 29 Oct 2021 22:47:56 -0400 Subject: [PATCH] lint: Fix awkward string formatting --- src/node/handler/PadMessageHandler.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index ead00a3b5..e4631359b 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -134,12 +134,14 @@ exports.handleDisconnect = async (socket) => { // send a disconnect message to the others if (session && session.author) { const {session: {user} = {}} = socket.client.request; - accessLogger.info(`${'[LEAVE]' + + /* eslint-disable prefer-template -- it doesn't support breaking across multiple lines */ + accessLogger.info('[LEAVE]' + ` pad:${session.padId}` + ` socket:${socket.id}` + ` IP:${settings.disableIPlogging ? 'ANONYMOUS' : socket.request.ip}` + - ` authorID:${session.author}`}${ - (user && user.username) ? ` username:${user.username}` : ''}`); + ` authorID:${session.author}` + + (user && user.username ? ` username:${user.username}` : '')); + /* eslint-enable prefer-template */ // get the author color out of the db const color = await authorManager.getAuthorColorId(session.author); @@ -906,12 +908,14 @@ const handleClientReady = async (socket, message, authorID) => { padIds.readonly || !webaccess.userCanModify(message.padId, socket.client.request); const {session: {user} = {}} = socket.client.request; - accessLogger.info(`${`[${pad.head > 0 ? 'ENTER' : 'CREATE'}]` + + /* eslint-disable prefer-template -- it doesn't support breaking across multiple lines */ + accessLogger.info(`[${pad.head > 0 ? 'ENTER' : 'CREATE'}]` + ` pad:${padIds.padId}` + ` socket:${socket.id}` + ` IP:${settings.disableIPlogging ? 'ANONYMOUS' : socket.request.ip}` + - ` authorID:${authorID}`}${ - (user && user.username) ? ` username:${user.username}` : ''}`); + ` authorID:${authorID}` + + (user && user.username ? ` username:${user.username}` : '')); + /* eslint-enable prefer-template */ if (message.reconnect) { // If this is a reconnect, we don't have to send the client the ClientVars again