diff --git a/.eslintrc.js b/.eslintrc.js index 8f0e4bd8c3..1250b270f5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -75,8 +75,7 @@ module.exports = { 'sonarjs/cognitive-complexity': ['warn'], // TODO: Enable the following rules and fix issues - 'sonarjs/no-duplicate-string': ['off'], - 'sonarjs/prefer-object-literal': ['off'] + 'sonarjs/no-duplicate-string': ['off'] }, settings: { react: { diff --git a/src/components/imageeditor/imageeditor.js b/src/components/imageeditor/imageeditor.js index 509fe02789..5b37a786ce 100644 --- a/src/components/imageeditor/imageeditor.js +++ b/src/components/imageeditor/imageeditor.js @@ -26,11 +26,7 @@ import template from './imageeditor.template.html'; let hasChanges = false; function getBaseRemoteOptions() { - const options = {}; - - options.itemId = currentItem.Id; - - return options; + return { itemId: currentItem.Id }; } function reload(page, item, focusContext) { diff --git a/src/components/playback/playbackmanager.js b/src/components/playback/playbackmanager.js index 8b8bc63921..761bb80556 100644 --- a/src/components/playback/playbackmanager.js +++ b/src/components/playback/playbackmanager.js @@ -3609,9 +3609,10 @@ class PlaybackManager { const apiClient = ServerConnections.getApiClient(item.ServerId); - const options = {}; - options.UserId = apiClient.getCurrentUserId(); - options.Limit = 200; + const options = { + UserId: apiClient.getCurrentUserId(), + Limit: 200 + }; const instance = this; diff --git a/src/components/subtitlesettings/subtitlesettings.js b/src/components/subtitlesettings/subtitlesettings.js index c201200399..1aef935bc8 100644 --- a/src/components/subtitlesettings/subtitlesettings.js +++ b/src/components/subtitlesettings/subtitlesettings.js @@ -25,17 +25,15 @@ import template from './subtitlesettings.template.html'; */ function getSubtitleAppearanceObject(context) { - const appearanceSettings = {}; - - appearanceSettings.textSize = context.querySelector('#selectTextSize').value; - appearanceSettings.textWeight = context.querySelector('#selectTextWeight').value; - appearanceSettings.dropShadow = context.querySelector('#selectDropShadow').value; - appearanceSettings.font = context.querySelector('#selectFont').value; - appearanceSettings.textBackground = context.querySelector('#inputTextBackground').value; - appearanceSettings.textColor = layoutManager.tv ? context.querySelector('#selectTextColor').value : context.querySelector('#inputTextColor').value; - appearanceSettings.verticalPosition = context.querySelector('#sliderVerticalPosition').value; - - return appearanceSettings; + return { + textSize: context.querySelector('#selectTextSize').value, + textWeight: context.querySelector('#selectTextWeight').value, + dropShadow: context.querySelector('#selectDropShadow').value, + font: context.querySelector('#selectFont').value, + textBackground: context.querySelector('#inputTextBackground').value, + textColor: layoutManager.tv ? context.querySelector('#selectTextColor').value : context.querySelector('#inputTextColor').value, + verticalPosition: context.querySelector('#sliderVerticalPosition').value + }; } function loadForm(context, user, userSettings, appearanceSettings, apiClient) { diff --git a/src/controllers/wizard/remote/index.js b/src/controllers/wizard/remote/index.js index e8a761666c..94ad441409 100644 --- a/src/controllers/wizard/remote/index.js +++ b/src/controllers/wizard/remote/index.js @@ -7,9 +7,11 @@ import Dashboard from '../../../utils/dashboard'; function save(page) { loading.show(); const apiClient = ApiClient; - const config = {}; - config.EnableRemoteAccess = page.querySelector('#chkRemoteAccess').checked; - config.EnableAutomaticPortMapping = page.querySelector('#chkEnableUpnp').checked; + const config = { + EnableRemoteAccess: page.querySelector('#chkRemoteAccess').checked, + EnableAutomaticPortMapping: page.querySelector('#chkEnableUpnp').checked + }; + apiClient.ajax({ type: 'POST', data: JSON.stringify(config), diff --git a/src/scripts/browserDeviceProfile.js b/src/scripts/browserDeviceProfile.js index f68faf4e40..18330b165e 100644 --- a/src/scripts/browserDeviceProfile.js +++ b/src/scripts/browserDeviceProfile.js @@ -349,13 +349,12 @@ import browser from './browser'; const canPlayMkv = testCanPlayMkv(videoTestElement); - const profile = {}; - - profile.MaxStreamingBitrate = bitrateSetting; - profile.MaxStaticBitrate = 100000000; - profile.MusicStreamingTranscodingBitrate = Math.min(bitrateSetting, 384000); - - profile.DirectPlayProfiles = []; + const profile = { + MaxStreamingBitrate: bitrateSetting, + MaxStaticBitrate: 100000000, + MusicStreamingTranscodingBitrate: Math.min(bitrateSetting, 384000), + DirectPlayProfiles: [] + }; let videoAudioCodecs = []; let hlsInTsVideoAudioCodecs = [];