Merge pull request #3244 from thornbill/eslint-empty-functions
Add eslint rule for empty functions
This commit is contained in:
commit
682295bde0
20 changed files with 30 additions and 48 deletions
|
@ -42,6 +42,7 @@ module.exports = {
|
||||||
'jsx-quotes': ['error', 'prefer-single'],
|
'jsx-quotes': ['error', 'prefer-single'],
|
||||||
'keyword-spacing': ['error'],
|
'keyword-spacing': ['error'],
|
||||||
'max-statements-per-line': ['error'],
|
'max-statements-per-line': ['error'],
|
||||||
|
'no-empty-function': ['error'],
|
||||||
'no-floating-decimal': ['error'],
|
'no-floating-decimal': ['error'],
|
||||||
'no-multi-spaces': ['error'],
|
'no-multi-spaces': ['error'],
|
||||||
'no-multiple-empty-lines': ['error', { 'max': 1 }],
|
'no-multiple-empty-lines': ['error', { 'max': 1 }],
|
||||||
|
|
|
@ -166,7 +166,6 @@ function Guide(options) {
|
||||||
stopAutoRefresh();
|
stopAutoRefresh();
|
||||||
|
|
||||||
Events.off(serverNotifications, 'TimerCreated', onTimerCreated);
|
Events.off(serverNotifications, 'TimerCreated', onTimerCreated);
|
||||||
Events.off(serverNotifications, 'SeriesTimerCreated', onSeriesTimerCreated);
|
|
||||||
Events.off(serverNotifications, 'TimerCancelled', onTimerCancelled);
|
Events.off(serverNotifications, 'TimerCancelled', onTimerCancelled);
|
||||||
Events.off(serverNotifications, 'SeriesTimerCancelled', onSeriesTimerCancelled);
|
Events.off(serverNotifications, 'SeriesTimerCancelled', onSeriesTimerCancelled);
|
||||||
|
|
||||||
|
@ -1057,9 +1056,6 @@ function Guide(options) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSeriesTimerCreated() {
|
|
||||||
}
|
|
||||||
|
|
||||||
function onTimerCancelled(e, apiClient, data) {
|
function onTimerCancelled(e, apiClient, data) {
|
||||||
const id = data.Id;
|
const id = data.Id;
|
||||||
// find guide cells by timer id, remove timer icon
|
// find guide cells by timer id, remove timer icon
|
||||||
|
@ -1186,7 +1182,6 @@ function Guide(options) {
|
||||||
Events.trigger(self, 'load');
|
Events.trigger(self, 'load');
|
||||||
|
|
||||||
Events.on(serverNotifications, 'TimerCreated', onTimerCreated);
|
Events.on(serverNotifications, 'TimerCreated', onTimerCreated);
|
||||||
Events.on(serverNotifications, 'SeriesTimerCreated', onSeriesTimerCreated);
|
|
||||||
Events.on(serverNotifications, 'TimerCancelled', onTimerCancelled);
|
Events.on(serverNotifications, 'TimerCancelled', onTimerCancelled);
|
||||||
Events.on(serverNotifications, 'SeriesTimerCancelled', onSeriesTimerCancelled);
|
Events.on(serverNotifications, 'SeriesTimerCancelled', onSeriesTimerCancelled);
|
||||||
|
|
||||||
|
|
|
@ -3322,6 +3322,7 @@ class PlaybackManager {
|
||||||
mediaSource.MediaStreams = info.MediaStreams;
|
mediaSource.MediaStreams = info.MediaStreams;
|
||||||
Events.trigger(player, 'mediastreamschange');
|
Events.trigger(player, 'mediastreamschange');
|
||||||
}, function () {
|
}, function () {
|
||||||
|
// Swallow errors
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,14 +183,14 @@ class GenericPlayer {
|
||||||
* Unpauses the player.
|
* Unpauses the player.
|
||||||
*/
|
*/
|
||||||
localUnpause() {
|
localUnpause() {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pauses the player.
|
* Pauses the player.
|
||||||
*/
|
*/
|
||||||
localPause() {
|
localPause() {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -199,14 +199,14 @@ class GenericPlayer {
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
localSeek(positionTicks) {
|
localSeek(positionTicks) {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stops the player.
|
* Stops the player.
|
||||||
*/
|
*/
|
||||||
localStop() {
|
localStop() {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -215,7 +215,7 @@ class GenericPlayer {
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
localSendCommand(command) {
|
localSendCommand(command) {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -224,7 +224,7 @@ class GenericPlayer {
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
localPlay(options) {
|
localPlay(options) {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -233,7 +233,7 @@ class GenericPlayer {
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
localSetCurrentPlaylistItem(playlistItemId) {
|
localSetCurrentPlaylistItem(playlistItemId) {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -242,7 +242,7 @@ class GenericPlayer {
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
localRemoveFromPlaylist(playlistItemIds) {
|
localRemoveFromPlaylist(playlistItemIds) {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -252,7 +252,7 @@ class GenericPlayer {
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
localMovePlaylistItem(playlistItemId, newIndex) {
|
localMovePlaylistItem(playlistItemId, newIndex) {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -261,7 +261,7 @@ class GenericPlayer {
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
localQueue(options) {
|
localQueue(options) {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -270,21 +270,21 @@ class GenericPlayer {
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
localQueueNext(options) {
|
localQueueNext(options) {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Picks next item in playlist.
|
* Picks next item in playlist.
|
||||||
*/
|
*/
|
||||||
localNextItem() {
|
localNextItem() {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Picks previous item in playlist.
|
* Picks previous item in playlist.
|
||||||
*/
|
*/
|
||||||
localPreviousItem() {
|
localPreviousItem() {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -293,7 +293,7 @@ class GenericPlayer {
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
localSetRepeatMode(value) {
|
localSetRepeatMode(value) {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -302,14 +302,14 @@ class GenericPlayer {
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
localSetQueueShuffleMode(value) {
|
localSetQueueShuffleMode(value) {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggles shuffle mode.
|
* Toggles shuffle mode.
|
||||||
*/
|
*/
|
||||||
localToggleQueueShuffleMode() {
|
localToggleQueueShuffleMode() {
|
||||||
|
// Override
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,10 +23,6 @@ function onViewDestroy() {
|
||||||
this.initialTabIndex = null;
|
this.initialTabIndex = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBeforeTabChange() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class TabbedView {
|
class TabbedView {
|
||||||
constructor(view, params) {
|
constructor(view, params) {
|
||||||
this.tabControllers = [];
|
this.tabControllers = [];
|
||||||
|
@ -79,7 +75,7 @@ class TabbedView {
|
||||||
view.addEventListener('viewbeforehide', this.onPause.bind(this));
|
view.addEventListener('viewbeforehide', this.onPause.bind(this));
|
||||||
|
|
||||||
view.addEventListener('viewbeforeshow', function () {
|
view.addEventListener('viewbeforeshow', function () {
|
||||||
mainTabsManager.setTabs(view, currentTabIndex, self.getTabs, getTabContainers, onBeforeTabChange, onTabChange, false);
|
mainTabsManager.setTabs(view, currentTabIndex, self.getTabs, getTabContainers, null, onTabChange, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
view.addEventListener('viewshow', function (e) {
|
view.addEventListener('viewshow', function (e) {
|
||||||
|
|
|
@ -56,8 +56,6 @@ function showIfAllowed(context, selector, visible) {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ViewSettings {
|
class ViewSettings {
|
||||||
constructor() {
|
|
||||||
}
|
|
||||||
show(options) {
|
show(options) {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
const dialogOptions = {
|
const dialogOptions = {
|
||||||
|
|
|
@ -262,8 +262,6 @@ import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||||
this.renderTab = function () {
|
this.renderTab = function () {
|
||||||
reloadItems(tabContent);
|
reloadItems(tabContent);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.destroy = function () {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-enable indent */
|
/* eslint-enable indent */
|
||||||
|
|
|
@ -273,8 +273,6 @@ import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||||
reloadItems();
|
reloadItems();
|
||||||
this.alphaPicker?.updateControls(getQuery(tabContent));
|
this.alphaPicker?.updateControls(getQuery(tabContent));
|
||||||
};
|
};
|
||||||
|
|
||||||
this.destroy = function () {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-enable indent */
|
/* eslint-enable indent */
|
||||||
|
|
|
@ -298,8 +298,6 @@ import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||||
reloadItems();
|
reloadItems();
|
||||||
this.alphaPicker?.updateControls(getQuery());
|
this.alphaPicker?.updateControls(getQuery());
|
||||||
};
|
};
|
||||||
|
|
||||||
this.destroy = function () {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-enable indent */
|
/* eslint-enable indent */
|
||||||
|
|
|
@ -239,8 +239,6 @@ import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||||
reloadItems(tabContent);
|
reloadItems(tabContent);
|
||||||
this.alphaPicker?.updateControls(getQuery(tabContent));
|
this.alphaPicker?.updateControls(getQuery(tabContent));
|
||||||
};
|
};
|
||||||
|
|
||||||
this.destroy = function () {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-enable indent */
|
/* eslint-enable indent */
|
||||||
|
|
|
@ -199,8 +199,6 @@ import Dashboard from '../../scripts/clientUtils';
|
||||||
self.renderTab = function () {
|
self.renderTab = function () {
|
||||||
reloadItems(tabContent);
|
reloadItems(tabContent);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.destroy = function () {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-enable indent */
|
/* eslint-enable indent */
|
||||||
|
|
|
@ -246,8 +246,6 @@ import Dashboard from '../../scripts/clientUtils';
|
||||||
self.renderTab = function () {
|
self.renderTab = function () {
|
||||||
reloadItems(tabContent);
|
reloadItems(tabContent);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.destroy = function () {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-enable indent */
|
/* eslint-enable indent */
|
||||||
|
|
|
@ -297,8 +297,6 @@ import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||||
reloadItems(tabContent);
|
reloadItems(tabContent);
|
||||||
this.alphaPicker?.updateControls(getQuery(tabContent));
|
this.alphaPicker?.updateControls(getQuery(tabContent));
|
||||||
};
|
};
|
||||||
|
|
||||||
this.destroy = function () {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-enable indent */
|
/* eslint-enable indent */
|
||||||
|
|
|
@ -74,7 +74,7 @@ import template from './emby-progressring.template.html';
|
||||||
};
|
};
|
||||||
|
|
||||||
EmbyProgressRing.attachedCallback = function () {
|
EmbyProgressRing.attachedCallback = function () {
|
||||||
|
// no-op
|
||||||
};
|
};
|
||||||
|
|
||||||
EmbyProgressRing.detachedCallback = function () {
|
EmbyProgressRing.detachedCallback = function () {
|
||||||
|
|
|
@ -6,7 +6,9 @@ import '../emby-button/paper-icon-button-light';
|
||||||
|
|
||||||
const EmbyScrollButtonsPrototype = Object.create(HTMLDivElement.prototype);
|
const EmbyScrollButtonsPrototype = Object.create(HTMLDivElement.prototype);
|
||||||
|
|
||||||
EmbyScrollButtonsPrototype.createdCallback = function () {};
|
EmbyScrollButtonsPrototype.createdCallback = function () {
|
||||||
|
// no-op
|
||||||
|
};
|
||||||
|
|
||||||
function getScrollButtonHtml(direction) {
|
function getScrollButtonHtml(direction) {
|
||||||
let html = '';
|
let html = '';
|
||||||
|
|
|
@ -1056,6 +1056,7 @@ class ChromecastPlayer {
|
||||||
}
|
}
|
||||||
|
|
||||||
getCurrentPlaylistItemId() {
|
getCurrentPlaylistItemId() {
|
||||||
|
// not supported?
|
||||||
}
|
}
|
||||||
|
|
||||||
setCurrentPlaylistItem() {
|
setCurrentPlaylistItem() {
|
||||||
|
|
|
@ -451,6 +451,7 @@ class SessionPlayer {
|
||||||
}
|
}
|
||||||
|
|
||||||
getRepeatMode() {
|
getRepeatMode() {
|
||||||
|
// not supported?
|
||||||
}
|
}
|
||||||
|
|
||||||
setQueueShuffleMode(mode) {
|
setQueueShuffleMode(mode) {
|
||||||
|
@ -460,6 +461,7 @@ class SessionPlayer {
|
||||||
}
|
}
|
||||||
|
|
||||||
getQueueShuffleMode() {
|
getQueueShuffleMode() {
|
||||||
|
// not supported?
|
||||||
}
|
}
|
||||||
|
|
||||||
displayContent(options) {
|
displayContent(options) {
|
||||||
|
@ -488,6 +490,7 @@ class SessionPlayer {
|
||||||
}
|
}
|
||||||
|
|
||||||
getCurrentPlaylistItemId() {
|
getCurrentPlaylistItemId() {
|
||||||
|
// not supported?
|
||||||
}
|
}
|
||||||
|
|
||||||
setCurrentPlaylistItem() {
|
setCurrentPlaylistItem() {
|
||||||
|
|
|
@ -256,11 +256,13 @@ class YoutubePlayer {
|
||||||
return this._currentSrc;
|
return this._currentSrc;
|
||||||
}
|
}
|
||||||
setSubtitleStreamIndex() {
|
setSubtitleStreamIndex() {
|
||||||
|
// not supported
|
||||||
}
|
}
|
||||||
canSetAudioStreamIndex() {
|
canSetAudioStreamIndex() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
setAudioStreamIndex() {
|
setAudioStreamIndex() {
|
||||||
|
// not supported
|
||||||
}
|
}
|
||||||
// Save this for when playback stops, because querying the time at that point might return 0
|
// Save this for when playback stops, because querying the time at that point might return 0
|
||||||
currentTime(val) {
|
currentTime(val) {
|
||||||
|
|
|
@ -155,7 +155,7 @@ export function alert(options) {
|
||||||
baseAlert({
|
baseAlert({
|
||||||
title: options.title || globalize.translate('HeaderAlert'),
|
title: options.title || globalize.translate('HeaderAlert'),
|
||||||
text: options.message
|
text: options.message
|
||||||
}).then(options.callback || function () {});
|
}).then(options.callback || function () { /* no-op */ });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,6 @@ const defaultSubtitleAppearanceSettings = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export class UserSettings {
|
export class UserSettings {
|
||||||
constructor() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bind UserSettings instance to user.
|
* Bind UserSettings instance to user.
|
||||||
* @param {string} - User identifier.
|
* @param {string} - User identifier.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue