1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

manual changes for no-var eslint rule

This commit is contained in:
dkanada 2020-10-08 00:47:23 +09:00
parent 3374114a37
commit 237e8ddc4c
8 changed files with 13 additions and 12 deletions

View file

@ -49,6 +49,7 @@ module.exports = {
'prefer-const': ['error', {'destructuring': 'all'}], 'prefer-const': ['error', {'destructuring': 'all'}],
'quotes': ['error', 'single', { 'avoidEscape': true, 'allowTemplateLiterals': false }], 'quotes': ['error', 'single', { 'avoidEscape': true, 'allowTemplateLiterals': false }],
'@babel/semi': ['error'], '@babel/semi': ['error'],
'no-var': ['error'],
'space-before-blocks': ['error'], 'space-before-blocks': ['error'],
'space-infix-ops': 'error', 'space-infix-ops': 'error',
'yoda': 'error' 'yoda': 'error'

View file

@ -344,8 +344,8 @@ import scrollManager from 'scrollManager';
const midX = elementRect.left + (elementRect.width / 2); const midX = elementRect.left + (elementRect.width / 2);
const midY = elementRect.top + (elementRect.height / 2); const midY = elementRect.top + (elementRect.height / 2);
var distX; let distX;
var distY; let distY;
switch (direction) { switch (direction) {
case 0: case 0:

View file

@ -149,7 +149,7 @@ import events from 'events';
} else { } else {
// update video player position when media is ready to be sought // update video player position when media is ready to be sought
const events = ['durationchange', 'loadeddata', 'play', 'loadedmetadata']; const events = ['durationchange', 'loadeddata', 'play', 'loadedmetadata'];
var onMediaChange = function(e) { const onMediaChange = function(e) {
if (element.currentTime === 0 && element.duration >= seconds) { if (element.currentTime === 0 && element.duration >= seconds) {
// seek only when video position is exactly zero, // seek only when video position is exactly zero,
// as this is true only if video hasn't started yet or // as this is true only if video hasn't started yet or
@ -322,9 +322,8 @@ import events from 'events';
break; break;
case Hls.ErrorTypes.MEDIA_ERROR: case Hls.ErrorTypes.MEDIA_ERROR:
console.debug('fatal media error encountered, try to recover'); console.debug('fatal media error encountered, try to recover');
var currentReject = reject; handleHlsJsMediaError(instance, reject);
reject = null; reject = null;
handleHlsJsMediaError(instance, currentReject);
break; break;
default: default:

View file

@ -15,8 +15,7 @@
return getApiClient(serverId).then(function (apiClient) { return getApiClient(serverId).then(function (apiClient) {
switch (action) { switch (action) {
case 'cancel-install': case 'cancel-install':
var id = data.id; return apiClient.cancelPackageInstallation(data.id);
return apiClient.cancelPackageInstallation(id);
case 'restart': case 'restart':
return apiClient.restartServer(); return apiClient.restartServer();
default: default:

View file

@ -2,6 +2,7 @@
* and will be replaced soon by a Vue component. * and will be replaced soon by a Vue component.
*/ */
/* eslint-disable no-var */
import browser from 'browser'; import browser from 'browser';
import dom from 'dom'; import dom from 'dom';
import 'css!./navdrawer'; import 'css!./navdrawer';
@ -355,3 +356,4 @@ export default function (options) {
return new TouchMenuLA(); return new TouchMenuLA();
} }
/* eslint-enable no-var */

View file

@ -254,7 +254,7 @@ import 'material-icons';
function loadNodesToLoad(page, node) { function loadNodesToLoad(page, node) {
const children = node.children; const children = node.children;
for (let i = 0, length = children.length; i < length; i++) { for (let i = 0, length = children.length; i < length; i++) {
var child = children[i]; const child = children[i];
if (nodesToLoad.indexOf(child) != -1) { if (nodesToLoad.indexOf(child) != -1) {
nodesToLoad = nodesToLoad.filter(function (n) { nodesToLoad = nodesToLoad.filter(function (n) {
return n != child; return n != child;
@ -297,7 +297,7 @@ import 'material-icons';
const url = window.location.hash || window.location.href; const url = window.location.hash || window.location.href;
return getParameterByName('id', url); return getParameterByName('id', url);
} }
var nodesToLoad = []; let nodesToLoad = [];
let selectedNodeId; let selectedNodeId;
$(document).on('itemsaved', '.metadataEditorPage', function (e, item) { $(document).on('itemsaved', '.metadataEditorPage', function (e, item) {
updateEditorNode(this, item); updateEditorNode(this, item);

View file

@ -248,7 +248,7 @@ let inputLoopTimer;
function runInputLoop() { function runInputLoop() {
// Get the latest gamepad state. // Get the latest gamepad state.
const gamepads = navigator.getGamepads(); /* eslint-disable-line compat/compat */ const gamepads = navigator.getGamepads(); /* eslint-disable-line compat/compat */
for (var i = 0, len = gamepads.length; i < len; i++) { for (let i = 0, len = gamepads.length; i < len; i++) {
const gamepad = gamepads[i]; const gamepad = gamepads[i];
if (!gamepad) { if (!gamepad) {
continue; continue;
@ -273,7 +273,7 @@ function runInputLoop() {
} }
// Iterate through the buttons to see if Left thumbstick, DPad, A and B are pressed. // Iterate through the buttons to see if Left thumbstick, DPad, A and B are pressed.
const buttons = gamepad.buttons; const buttons = gamepad.buttons;
for (var j = 0, len = buttons.length; j < len; j++) { for (let j = 0, len = buttons.length; j < len; j++) {
if (ProcessedButtons.indexOf(j) !== -1) { if (ProcessedButtons.indexOf(j) !== -1) {
if (buttons[j].pressed) { if (buttons[j].pressed) {
switch (j) { switch (j) {

View file

@ -10,7 +10,7 @@ function fallback(urls) {
document.documentElement.appendChild(frame); document.documentElement.appendChild(frame);
// the download init has to be sequential otherwise IE only use the first // the download init has to be sequential otherwise IE only use the first
var interval = setInterval(function () { const interval = setInterval(function () {
if (frame.contentWindow.document.readyState === 'complete' || frame.contentWindow.document.readyState === 'interactive') { if (frame.contentWindow.document.readyState === 'complete' || frame.contentWindow.document.readyState === 'interactive') {
clearInterval(interval); clearInterval(interval);