mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Update to typescript-eslint v8 (#6372)
* Update typescript-eslint to v8 * Disable @typescript-eslint/prefer-optional-chain This rule now requires type information which is not currently enabled for the Typescript ESLint checks. * Remove unused vars * Disable no-empty-function for line using updated config * Disable rule for lines that violate updated typescript-eslint rules * Use void operator to fix no-floating-promises Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com> * Use void operator to fix no-floating-promises Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com> --------- Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>
This commit is contained in:
parent
ffd40405bd
commit
a337f7af2b
14 changed files with 276 additions and 304 deletions
|
@ -1,9 +1,6 @@
|
|||
import type { BaseItemDto } from '@jellyfin/sdk/lib/generated-client/models/base-item-dto';
|
||||
import type { MediaSegmentDto } from '@jellyfin/sdk/lib/generated-client/models/media-segment-dto';
|
||||
import type { MediaSourceInfo } from '@jellyfin/sdk/lib/generated-client/models/media-source-info';
|
||||
|
||||
import { PlaybackManagerEvent } from 'apps/stable/features/playback/constants/playbackManagerEvent';
|
||||
import { PlayerEvent } from 'apps/stable/features/playback/constants/playerEvent';
|
||||
import type { ManagedPlayerStopInfo, MovedItem, PlayerError, PlayerErrorCode, PlayerStopInfo, RemovedItems } from 'apps/stable/features/playback/types/callbacks';
|
||||
import type { PlaybackManager } from 'components/playback/playbackmanager';
|
||||
import type { MediaError } from 'types/mediaError';
|
||||
|
@ -11,7 +8,10 @@ import type { PlayTarget } from 'types/playTarget';
|
|||
import type { PlaybackStopInfo, PlayerState } from 'types/playbackStopInfo';
|
||||
import type { PlayerPlugin } from 'types/plugin';
|
||||
import Events, { type Event } from 'utils/events';
|
||||
import { PlaybackManagerEvent } from '../constants/playbackManagerEvent';
|
||||
import { PlayerEvent } from '../constants/playerEvent';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
|
||||
export interface PlaybackSubscriber {
|
||||
onPlaybackCancelled?(e: Event): void
|
||||
onPlaybackError?(e: Event, errorType: MediaError): void
|
||||
|
@ -40,6 +40,7 @@ export interface PlaybackSubscriber {
|
|||
onReportPlayback?(e: Event, isServerItem: boolean): void
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
|
||||
export abstract class PlaybackSubscriber {
|
||||
protected player: PlayerPlugin | undefined;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ const AppHeader: FC<AppHeaderParams> = ({
|
|||
}) => {
|
||||
useEffect(() => {
|
||||
// Initialize the UI components after first render
|
||||
import('../scripts/libraryMenu');
|
||||
void import('../scripts/libraryMenu');
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
|
|
@ -13,7 +13,7 @@ const styles = layoutManager.experimental ? {
|
|||
const Backdrop = () => {
|
||||
useEffect(() => {
|
||||
// Initialize the UI components after first render
|
||||
import('../scripts/autoBackdrops');
|
||||
void import('../scripts/autoBackdrops');
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
|
|
@ -7,7 +7,7 @@ type AlphaPickerProps = {
|
|||
};
|
||||
|
||||
// React compatibility wrapper component for alphaPicker.js
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
// eslint-disable-next-line no-empty-function
|
||||
const AlphaPickerComponent: FunctionComponent<AlphaPickerProps> = ({ onAlphaPicked = () => {} }: AlphaPickerProps) => {
|
||||
const [ alphaPicker, setAlphaPicker ] = useState<AlphaPicker>();
|
||||
const element = useRef<HTMLDivElement>(null);
|
||||
|
|
|
@ -132,7 +132,7 @@ export function getAirTimeText(
|
|||
date = datetime.parseISO8601Date(item.EndDate);
|
||||
airTimeText += ' - ' + datetime.getDisplayTime(date);
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
console.error('error parsing date: ' + item.StartDate);
|
||||
}
|
||||
}
|
||||
|
@ -521,7 +521,7 @@ function getPremiereDate(PremiereDate: string | null | undefined) {
|
|||
datetime.parseISO8601Date(PremiereDate),
|
||||
{ weekday: 'long', month: 'long', day: 'numeric' }
|
||||
);
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -80,7 +80,7 @@ function addOriginalAirDateInfo(
|
|||
itemType !== ItemKind.Episode
|
||||
);
|
||||
addMiscInfo({ text: datetime.toLocaleDateString(date) });
|
||||
} catch (e) {
|
||||
} catch {
|
||||
console.error('error parsing date:', itemPremiereDate);
|
||||
}
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ function addProgramTextInfo(
|
|||
datetime.toLocaleDateString(date)
|
||||
);
|
||||
addMiscInfo({ text: text });
|
||||
} catch (e) {
|
||||
} catch {
|
||||
console.error('error parsing date:', program.PremiereDate);
|
||||
}
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ function addStartDateInfo(
|
|||
if (itemType !== ItemKind.Recording) {
|
||||
addMiscInfo({ text: datetime.getDisplayTime(date) });
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
console.error('error parsing date:', itemStartDate);
|
||||
}
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ function addproductionYearWithEndDate(
|
|||
if (endYear !== itemProductionYear) {
|
||||
productionYear += `-${endYear}`;
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
console.error('error parsing date:', itemEndDate);
|
||||
}
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ function addYearInfo(
|
|||
{ useGrouping: false }
|
||||
);
|
||||
addMiscInfo({ text: text });
|
||||
} catch (e) {
|
||||
} catch {
|
||||
console.error('error parsing date:', itemPremiereDate);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ function addProgramTime(
|
|||
programTimeText += ` - ${datetime.getDisplayTime(date)}`;
|
||||
}
|
||||
addMiscInfo({ text: programTimeText });
|
||||
} catch (e) {
|
||||
} catch {
|
||||
console.error('error parsing date:', itemStartDate);
|
||||
}
|
||||
}
|
||||
|
|
1
src/global.d.ts
vendored
1
src/global.d.ts
vendored
|
@ -4,6 +4,7 @@ export declare global {
|
|||
interface Window {
|
||||
ApiClient: ApiClient;
|
||||
Events: Events;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
NativeShell: any;
|
||||
Loading: {
|
||||
show();
|
||||
|
|
|
@ -440,7 +440,7 @@ function groupsUpcomingEpisodes(items: ItemDto[]) {
|
|||
month: 'short',
|
||||
day: 'numeric'
|
||||
});
|
||||
} catch (err) {
|
||||
} catch {
|
||||
console.error('error parsing timestamp for upcoming tv shows');
|
||||
}
|
||||
}
|
||||
|
|
1
src/index.d.ts
vendored
1
src/index.d.ts
vendored
|
@ -1,4 +1,5 @@
|
|||
declare module '*.png' {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const value: any;
|
||||
export = value;
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ export interface CardOptions {
|
|||
showSeriesTimerChannel?: boolean;
|
||||
showSongCount?: boolean;
|
||||
width?: number;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
widths?: any;
|
||||
showChannelLogo?: boolean;
|
||||
showLogo?: boolean;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue