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

Fix lint errors

This commit is contained in:
Bill Thornton 2025-02-20 12:51:59 -05:00
parent 7d9acf30b6
commit 4730a30c3d
29 changed files with 53 additions and 23 deletions

View file

@ -86,7 +86,7 @@ function iOSversion() {
/Version\/(\d+)/
];
for (const test of tests) {
const matches = (navigator.appVersion).match(test);
const matches = RegExp(test).exec(navigator.appVersion);
if (matches) {
return [
parseInt(matches[1], 10),
@ -163,6 +163,7 @@ function supportsCssAnimation(allowPrefix) {
const domPrefixes = ['Webkit', 'O', 'Moz'];
const elm = document.createElement('div');
// eslint-disable-next-line sonarjs/different-types-comparison
if (elm.style.animationName !== undefined) {
animation = true;
}
@ -298,7 +299,7 @@ if (browser.web0s) {
delete browser.chrome;
delete browser.safari;
} else if (browser.tizen) {
const v = (navigator.appVersion).match(/Tizen (\d+).(\d+)/);
const v = RegExp(/Tizen (\d+).(\d+)/).exec(navigator.appVersion);
browser.tizenVersion = parseInt(v[1], 10);
// UserAgent string contains 'Chrome' and 'Safari', but we only want 'tizen' to be true
@ -319,7 +320,6 @@ if (browser.mobile || browser.tv) {
browser.slow = true;
}
/* eslint-disable-next-line compat/compat */
if (typeof document !== 'undefined' && ('ontouchstart' in window) || (navigator.maxTouchPoints > 0)) {
browser.touch = true;
}

View file

@ -230,7 +230,8 @@ function supportsVc1(videoTestElement) {
}
function supportsHdr10(options) {
return options.supportsHdr10 ?? (false // eslint-disable-line sonarjs/no-redundant-boolean
// eslint-disable-next-line no-constant-binary-expression, sonarjs/no-redundant-boolean
return options.supportsHdr10 ?? (false
|| browser.vidaa
|| browser.tizen
|| browser.web0s
@ -253,7 +254,8 @@ function supportsHlg(options) {
}
function supportsDolbyVision(options) {
return options.supportsDolbyVision ?? (false // eslint-disable-line sonarjs/no-redundant-boolean
// eslint-disable-next-line no-constant-binary-expression, sonarjs/no-redundant-boolean
return options.supportsDolbyVision ?? (false
|| browser.safari && ((browser.iOS && browser.iOSVersion >= 13) || browser.osx)
);
}
@ -512,10 +514,8 @@ export default function (options) {
}
}
/* eslint-disable compat/compat */
let maxVideoWidth = browser.xboxOne ? window.screen?.width : null;
/* eslint-enable compat/compat */
if (options.maxVideoWidth) {
maxVideoWidth = options.maxVideoWidth;
}

View file

@ -33,7 +33,7 @@ function textAreaCopy(text) {
} else {
ret = Promise.reject();
}
} catch (_) {
} catch {
ret = Promise.reject();
}
@ -48,11 +48,10 @@ function textAreaCopy(text) {
* @returns {Promise<void>} Promise.
*/
export function copy(text) {
/* eslint-disable-next-line compat/compat */
// eslint-disable-next-line sonarjs/different-types-comparison
if (navigator.clipboard === undefined) {
return textAreaCopy(text);
} else {
/* eslint-disable-next-line compat/compat */
return navigator.clipboard.writeText(text).catch(() => {
return textAreaCopy(text);
});