mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2026-09-03 03:50:02 +03:00
@@ -106,6 +106,8 @@ export default tseslint.config(
|
||||
// TODO: Enable the following sonarjs rules and fix issues
|
||||
'sonarjs/no-duplicate-string': 'off',
|
||||
'sonarjs/no-nested-functions': 'warn',
|
||||
// NOTE: This rule is currently blowing up `TypeError: secretSignatures[fqn].forEach is not a function`
|
||||
'sonarjs/hardcoded-secret-signatures': 'off',
|
||||
|
||||
// TODO: Replace with stylistic.configs.customize()
|
||||
'@stylistic/block-spacing': 'error',
|
||||
@@ -243,6 +245,9 @@ export default tseslint.config(
|
||||
'Promise',
|
||||
// whatwg-fetch
|
||||
'fetch',
|
||||
'Response',
|
||||
'Response.headers',
|
||||
'Response.json',
|
||||
// document-register-element
|
||||
'document.registerElement',
|
||||
// resize-observer-polyfill
|
||||
@@ -298,6 +303,8 @@ export default tseslint.config(
|
||||
'String.strike',
|
||||
'String.sub',
|
||||
'String.sup',
|
||||
'URL',
|
||||
'URLSearchParams',
|
||||
'RegExp',
|
||||
'Number',
|
||||
'Math',
|
||||
|
||||
Generated
+533
-400
File diff suppressed because it is too large
Load Diff
+10
-10
@@ -9,8 +9,8 @@
|
||||
"@babel/plugin-transform-modules-umd": "7.27.1",
|
||||
"@babel/preset-env": "7.29.0",
|
||||
"@babel/preset-react": "7.28.5",
|
||||
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
|
||||
"@eslint/js": "9.30.1",
|
||||
"@eslint-community/eslint-plugin-eslint-comments": "4.7.1",
|
||||
"@eslint/js": "9.39.4",
|
||||
"@stylistic/eslint-plugin": "4.4.1",
|
||||
"@stylistic/stylelint-plugin": "3.1.3",
|
||||
"@types/dompurify": "3.0.5",
|
||||
@@ -22,7 +22,7 @@
|
||||
"@types/react-dom": "18.3.7",
|
||||
"@types/react-lazy-load-image-component": "1.6.4",
|
||||
"@types/sortablejs": "1.15.8",
|
||||
"@typescript-eslint/parser": "8.35.1",
|
||||
"@typescript-eslint/parser": "8.57.0",
|
||||
"@uupaa/dynamic-import-polyfill": "1.0.2",
|
||||
"@vitest/coverage-v8": "3.2.4",
|
||||
"autoprefixer": "10.4.21",
|
||||
@@ -35,13 +35,13 @@
|
||||
"css-loader": "7.1.2",
|
||||
"cssnano": "7.0.7",
|
||||
"es-check": "9.1.4",
|
||||
"eslint": "9.30.1",
|
||||
"eslint-plugin-compat": "6.0.2",
|
||||
"eslint": "9.39.4",
|
||||
"eslint-plugin-compat": "6.2.1",
|
||||
"eslint-plugin-import": "2.32.0",
|
||||
"eslint-plugin-jsx-a11y": "6.10.2",
|
||||
"eslint-plugin-react": "7.37.5",
|
||||
"eslint-plugin-react-hooks": "5.2.0",
|
||||
"eslint-plugin-sonarjs": "3.0.4",
|
||||
"eslint-plugin-sonarjs": "3.0.7",
|
||||
"expose-loader": "5.0.1",
|
||||
"fast-glob": "3.3.3",
|
||||
"fork-ts-checker-webpack-plugin": "9.1.0",
|
||||
@@ -59,14 +59,14 @@
|
||||
"source-map-loader": "5.0.0",
|
||||
"speed-measure-webpack-plugin": "1.5.0",
|
||||
"style-loader": "4.0.0",
|
||||
"stylelint": "16.21.0",
|
||||
"stylelint": "16.26.1",
|
||||
"stylelint-config-rational-order": "0.1.2",
|
||||
"stylelint-no-browser-hacks": "2.0.0",
|
||||
"stylelint-order": "7.0.0",
|
||||
"stylelint-scss": "6.12.1",
|
||||
"stylelint-order": "7.0.1",
|
||||
"stylelint-scss": "6.14.0",
|
||||
"ts-loader": "9.5.2",
|
||||
"typescript": "5.8.3",
|
||||
"typescript-eslint": "8.35.1",
|
||||
"typescript-eslint": "8.57.0",
|
||||
"vite-tsconfig-paths": "5.1.4",
|
||||
"vitest": "3.2.4",
|
||||
"webpack": "5.104.1",
|
||||
|
||||
@@ -29,7 +29,6 @@ const ListItemLink: FC<ListItemLinkProps> = ({
|
||||
const [ searchParams ] = useSearchParams();
|
||||
|
||||
const [ toPath, toParams ] = to.split('?');
|
||||
// eslint-disable-next-line compat/compat
|
||||
const toSearchParams = new URLSearchParams(`?${toParams}`);
|
||||
const selectedPaths = [ toPath, ...includePaths ];
|
||||
|
||||
|
||||
@@ -100,7 +100,6 @@ function dispatchViewEvent(view, eventInfo, eventName, isCancellable) {
|
||||
|
||||
function getViewEventDetail(view, { state, url, options = {} }, isRestored) {
|
||||
const index = url.indexOf('?');
|
||||
// eslint-disable-next-line compat/compat
|
||||
const searchParams = new URLSearchParams(url.substring(index + 1));
|
||||
const params = {};
|
||||
|
||||
|
||||
@@ -342,9 +342,8 @@ class CastPlayer {
|
||||
|
||||
/* If serverAddress is localhost,this address can not be used for the cast receiver device.
|
||||
* Use the local address (ULA, Unique Local Address) in that case.
|
||||
*/
|
||||
*/
|
||||
const serverAddress = apiClient.serverAddress();
|
||||
// eslint-disable-next-line compat/compat
|
||||
const hostname = (new URL(serverAddress)).hostname;
|
||||
const isLocalhost = hostname === 'localhost' || hostname.startsWith('127.') || hostname === '[::1]';
|
||||
const serverLocalAddress = isLocalhost ? apiClient.serverInfo().LocalAddress : serverAddress;
|
||||
@@ -387,18 +386,18 @@ class CastPlayer {
|
||||
|
||||
/**
|
||||
* Callback function for loadMedia success
|
||||
* @param {Object} mediaSession A new media object.
|
||||
* @param {Object} media A new media object.
|
||||
*/
|
||||
onMediaDiscovered(how, mediaSession) {
|
||||
console.debug('[chromecastPlayer] new media session ID:' + mediaSession.mediaSessionId + ' (' + how + ')');
|
||||
this.currentMediaSession = mediaSession;
|
||||
onMediaDiscovered(how, media) {
|
||||
console.debug('[chromecastPlayer] new media session ID:' + media.mediaSessionId + ' (' + how + ')');
|
||||
this.currentMediaSession = media;
|
||||
|
||||
if (how === 'loadMedia') {
|
||||
this.castPlayerState = PLAYER_STATE.PLAYING;
|
||||
}
|
||||
|
||||
if (how === 'activeSession') {
|
||||
this.castPlayerState = mediaSession.playerState;
|
||||
this.castPlayerState = media.playerState;
|
||||
}
|
||||
|
||||
this.currentMediaSession.addUpdateListener(this.mediaStatusUpdateHandler);
|
||||
|
||||
@@ -408,7 +408,6 @@ class ArchiveSource {
|
||||
});
|
||||
|
||||
for (const file of files) {
|
||||
/* eslint-disable-next-line compat/compat */
|
||||
const url = URL.createObjectURL(file.file);
|
||||
this.urls.push(url);
|
||||
}
|
||||
@@ -416,7 +415,6 @@ class ArchiveSource {
|
||||
|
||||
release() {
|
||||
this.files = [];
|
||||
/* eslint-disable-next-line compat/compat */
|
||||
this.urls.forEach(URL.revokeObjectURL);
|
||||
this.urls = [];
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ function onPlaying(instance, playOptions, resolve) {
|
||||
function setCurrentSrc(instance, elem, options) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
instance._currentSrc = options.url;
|
||||
const params = new URLSearchParams(options.url.split('?')[1]); /* eslint-disable-line compat/compat */
|
||||
const params = new URLSearchParams(options.url.split('?')[1]);
|
||||
// 3. This function creates an <iframe> (and YouTube player)
|
||||
// after the API code downloads.
|
||||
window.onYouTubeIframeAPIReady = function () {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-env serviceworker */
|
||||
|
||||
function getApiClient(serverId) {
|
||||
return Promise.resolve(window.connectionManager.getApiClient(serverId));
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ export default async function fetchLocal(url: string, options?: FetchOptions) {
|
||||
status = 200;
|
||||
}
|
||||
|
||||
/* eslint-disable-next-line compat/compat */
|
||||
resolve(new Response(xhr.responseText, { status }));
|
||||
};
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import { describe, expect, it, vi } from 'vitest';
|
||||
import { getLocationSearch } from './url';
|
||||
|
||||
const mockLocation = (urlString: string) => {
|
||||
// eslint-disable-next-line compat/compat
|
||||
const url = new URL(urlString);
|
||||
vi.spyOn(window, 'location', 'get')
|
||||
.mockReturnValue({
|
||||
|
||||
@@ -36,6 +36,5 @@ export const getParameterByName = (name: string, url?: string | null | undefined
|
||||
url = getLocationSearch();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line compat/compat
|
||||
return new URLSearchParams(url).get(name) || '';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user