From f4cd29ac1704a4192a58a26ba1760c5dad9f67d1 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Tue, 4 Oct 2022 14:24:24 -0400 Subject: [PATCH] Add no-return-assign eslint rule and fix issues --- .eslintrc.js | 1 + src/components/channelMapper/channelMapper.js | 6 ++++-- src/components/tunerPicker.js | 6 ++++-- src/components/viewManager/viewManager.js | 6 +++--- src/controllers/dashboard/apikeys.js | 3 ++- src/controllers/dashboard/dlna/profile.js | 3 ++- src/controllers/dashboard/plugins/available/index.js | 3 ++- src/controllers/livetvstatus.js | 3 ++- src/scripts/libraryBrowser.js | 3 ++- 9 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 562b457bf..c2de8f6c6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -52,6 +52,7 @@ module.exports = { 'no-multi-spaces': ['error'], 'no-multiple-empty-lines': ['error', { 'max': 1 }], 'no-restricted-globals': ['error'].concat(restrictedGlobals), + 'no-return-assign': ['error'], 'no-return-await': ['error'], 'no-sequences': ['error', { 'allowInParentheses': false }], 'no-trailing-spaces': ['error'], diff --git a/src/components/channelMapper/channelMapper.js b/src/components/channelMapper/channelMapper.js index be9ff841c..840f8bfd5 100644 --- a/src/components/channelMapper/channelMapper.js +++ b/src/components/channelMapper/channelMapper.js @@ -87,7 +87,8 @@ export default class channelMapper { html += ''; html += ''; html += ``; - return html += ''; + html += ''; + return html; } function getEditorHtml() { @@ -100,7 +101,8 @@ export default class channelMapper { html += ''; html += ''; html += ''; - return html += ''; + html += ''; + return html; } function initEditor(dlg, options) { diff --git a/src/components/tunerPicker.js b/src/components/tunerPicker.js index d31d3b5f6..b73337182 100644 --- a/src/components/tunerPicker.js +++ b/src/components/tunerPicker.js @@ -26,7 +26,8 @@ function getEditorHtml() { html += '
'; html += '
'; html += ''; - return html += ''; + html += ''; + return html; } function getDeviceHtml(device) { @@ -61,7 +62,8 @@ function getDeviceHtml(device) { html += ''; html += ''; html += ''; - return html += ''; + html += ''; + return html; } function getTunerName(providerId) { diff --git a/src/components/viewManager/viewManager.js b/src/components/viewManager/viewManager.js index 48c708d2a..03138797c 100644 --- a/src/components/viewManager/viewManager.js +++ b/src/components/viewManager/viewManager.js @@ -103,9 +103,9 @@ function getViewEventDetail(view, {state, url, options = {}}, isRestored) { const searchParams = new URLSearchParams(url.substring(index + 1)); const params = {}; - searchParams.forEach((value, key) => - params[key] = value - ); + searchParams.forEach((value, key) => { + params[key] = value; + }); return { detail: { diff --git a/src/controllers/dashboard/apikeys.js b/src/controllers/dashboard/apikeys.js index 300bdeb09..9eec8503c 100644 --- a/src/controllers/dashboard/apikeys.js +++ b/src/controllers/dashboard/apikeys.js @@ -37,7 +37,8 @@ import { pageIdOn } from '../../utils/dashboard'; const date = datetime.parseISO8601Date(item.DateCreated, true); html += datetime.toLocaleDateString(date) + ' ' + datetime.getDisplayTime(date); html += ''; - return html += ''; + html += ''; + return html; }).join(''); page.querySelector('.resultBody').innerHTML = rows; loading.hide(); diff --git a/src/controllers/dashboard/dlna/profile.js b/src/controllers/dashboard/dlna/profile.js index 133faa2c8..3f5d6c365 100644 --- a/src/controllers/dashboard/dlna/profile.js +++ b/src/controllers/dashboard/dlna/profile.js @@ -149,7 +149,8 @@ import { getParameterByName } from '../../../utils/url.ts'; li += '

' + escapeHtml(h.Name + ' = ' + (h.Value || '')) + '

'; li += ''; li += ''; - return li += ''; + li += ''; + return li; }).join('') + ''; const elem = $('.xmlDocumentAttributeList', page).html(html).trigger('create'); $('.btnDeleteXmlAttribute', elem).on('click', function () { diff --git a/src/controllers/dashboard/plugins/available/index.js b/src/controllers/dashboard/plugins/available/index.js index 02ad0bac1..b10518bc7 100644 --- a/src/controllers/dashboard/plugins/available/index.js +++ b/src/controllers/dashboard/plugins/available/index.js @@ -129,7 +129,8 @@ function getPluginHtml(plugin, options, installedPlugins) { html += ''; html += ''; html += ''; - return html += ''; + html += ''; + return html; } function getTabs() { diff --git a/src/controllers/livetvstatus.js b/src/controllers/livetvstatus.js index 1de366a02..d07b50c04 100644 --- a/src/controllers/livetvstatus.js +++ b/src/controllers/livetvstatus.js @@ -49,7 +49,8 @@ function getDeviceHtml(device) { html += ''; html += ''; html += ''; - return html += ''; + html += ''; + return html; } function renderDevices(page, devices) { diff --git a/src/scripts/libraryBrowser.js b/src/scripts/libraryBrowser.js index b9fe249bd..9cb54a8c4 100644 --- a/src/scripts/libraryBrowser.js +++ b/src/scripts/libraryBrowser.js @@ -115,7 +115,8 @@ export function getQueryPagingHtml (options) { html += ''; } - return html += ''; + html += ''; + return html; } export function showSortMenu (options) {