Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to typescript-eslint v8 #6372

Merged
merged 9 commits into from
Jan 13, 2025
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ module.exports = {
'prefer-const': ['error', { 'destructuring': 'all' }],
'prefer-promise-reject-errors': ['warn', { 'allowEmptyReject': true }],
'@typescript-eslint/prefer-for-of': ['error'],
'@typescript-eslint/prefer-optional-chain': ['error'],
'radix': ['error'],
'yoda': 'error',

Expand Down
535 changes: 252 additions & 283 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"@types/react-dom": "18.3.1",
"@types/react-lazy-load-image-component": "1.6.4",
"@types/sortablejs": "1.15.8",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"@typescript-eslint/eslint-plugin": "8.17.0",
"@typescript-eslint/parser": "8.17.0",
"@uupaa/dynamic-import-polyfill": "1.0.2",
"@vitest/coverage-v8": "2.1.8",
"autoprefixer": "10.4.20",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
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';
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
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const AppHeader: FC<AppHeaderParams> = ({
}) => {
useEffect(() => {
// Initialize the UI components after first render
import('../scripts/libraryMenu');
void import('../scripts/libraryMenu');
}, []);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Backdrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion src/components/alphaPicker/AlphaPickerComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/components/cardbuilder/Card/cardHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -521,7 +521,7 @@ function getPremiereDate(PremiereDate: string | null | undefined) {
datetime.parseISO8601Date(PremiereDate),
{ weekday: 'long', month: 'long', day: 'numeric' }
);
} catch (err) {
} catch {
return '';
}
} else {
Expand Down
10 changes: 5 additions & 5 deletions src/components/mediainfo/usePrimaryMediaInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function addOriginalAirDateInfo(
itemType !== ItemKind.Episode
);
addMiscInfo({ text: datetime.toLocaleDateString(date) });
} catch (e) {
} catch {
console.error('error parsing date:', itemPremiereDate);
}
}
Expand Down Expand Up @@ -212,7 +212,7 @@ function addProgramTextInfo(
datetime.toLocaleDateString(date)
);
addMiscInfo({ text: text });
} catch (e) {
} catch {
console.error('error parsing date:', program.PremiereDate);
}
}
Expand All @@ -238,7 +238,7 @@ function addStartDateInfo(
if (itemType !== ItemKind.Recording) {
addMiscInfo({ text: datetime.getDisplayTime(date) });
}
} catch (e) {
} catch {
console.error('error parsing date:', itemStartDate);
}
}
Expand Down Expand Up @@ -291,7 +291,7 @@ function addproductionYearWithEndDate(
if (endYear !== itemProductionYear) {
productionYear += `-${endYear}`;
}
} catch (e) {
} catch {
console.error('error parsing date:', itemEndDate);
}
}
Expand Down Expand Up @@ -324,7 +324,7 @@ function addYearInfo(
{ useGrouping: false }
);
addMiscInfo({ text: text });
} catch (e) {
} catch {
console.error('error parsing date:', itemPremiereDate);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/mediainfo/useSecondaryMediaInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function addProgramTime(
programTimeText += ` - ${datetime.getDisplayTime(date)}`;
}
addMiscInfo({ text: programTimeText });
} catch (e) {
} catch {
console.error('error parsing date:', itemStartDate);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useFetchItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ function groupsUpcomingEpisodes(items: ItemDto[]) {
month: 'short',
day: 'numeric'
});
} catch (err) {
} catch {
console.error('error parsing timestamp for upcoming tv shows');
}
}
Expand Down
1 change: 1 addition & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
declare module '*.png' {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const value: any;
export = value;
}
1 change: 1 addition & 0 deletions src/types/cardOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading