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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
727 changes: 196 additions & 531 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 @@ -19,8 +19,8 @@
"@types/react": "18.3.11",
"@types/react-dom": "18.3.1",
"@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.3",
"autoprefixer": "10.4.20",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { PlayerEvent } from '../constants/playerEvent';
import type { ManagedPlayerStopInfo, MovedItem, PlayerError, PlayerErrorCode, PlayerStopInfo, RemovedItems } from '../types/callbacks';
import type { MediaSegmentDto } from '@jellyfin/sdk/lib/generated-client/models/media-segment-dto';

// 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 +41,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: Plugin | undefined;

Expand Down
1 change: 1 addition & 0 deletions src/components/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const AppHeader: FC<AppHeaderParams> = ({
}) => {
useEffect(() => {
// Initialize the UI components after first render
// eslint-disable-next-line @typescript-eslint/no-floating-promises
import('../scripts/libraryMenu');
Comment on lines +12 to 13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// eslint-disable-next-line @typescript-eslint/no-floating-promises
import('../scripts/libraryMenu');
void import('../scripts/libraryMenu');

}, []);

Expand Down
1 change: 1 addition & 0 deletions src/components/Backdrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const styles = layoutManager.experimental ? {
const Backdrop = () => {
useEffect(() => {
// Initialize the UI components after first render
// eslint-disable-next-line @typescript-eslint/no-floating-promises
import('../scripts/autoBackdrops');
Comment on lines +16 to 17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// eslint-disable-next-line @typescript-eslint/no-floating-promises
import('../scripts/autoBackdrops');
void import('../scripts/autoBackdrops');

}, []);

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