Remove eslint rule deactivations (#290)

This commit is contained in:
schroda
2023-05-11 18:00:37 +02:00
committed by GitHub
parent d92dc83dda
commit bd91510227
13 changed files with 38 additions and 77 deletions

View File

@@ -77,15 +77,7 @@ const MangaCard = React.forwardRef<HTMLDivElement, IProps>((props: IProps, ref)
const { t } = useTranslation();
const {
manga: {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
id,
title,
thumbnailUrl,
downloadCount,
unreadCount: unread,
inLibrary,
},
manga: { id, title, thumbnailUrl, downloadCount, unreadCount: unread, inLibrary },
gridLayout,
dimensions,
inLibraryIndicator,

View File

@@ -64,9 +64,7 @@ const filterManga = (
return matchesSearch && matchesFilters;
});
const sortByUnread = (a: IMangaCard, b: IMangaCard): number =>
// eslint-disable-next-line implicit-arrow-linebreak
(a.unreadCount ?? 0) - (b.unreadCount ?? 0);
const sortByUnread = (a: IMangaCard, b: IMangaCard): number => (a.unreadCount ?? 0) - (b.unreadCount ?? 0);
const sortByTitle = (a: IMangaCard, b: IMangaCard): number => a.title.localeCompare(b.title);

View File

@@ -29,11 +29,9 @@ const defaultChapterOptions: ChapterListOptions = {
function chapterOptionsReducer(state: ChapterListOptions, actions: ChapterOptionsReducerAction): ChapterListOptions {
switch (actions.type) {
case 'filter':
// eslint-disable-next-line no-case-declarations
const active = state.unread !== false && state.downloaded !== false && state.bookmarked !== false;
return {
...state,
active,
active: state.unread !== false && state.downloaded !== false && state.bookmarked !== false,
[actions.filterType!]: actions.filterValue,
};
case 'sortBy':

View File

@@ -17,7 +17,6 @@ interface DownloadStateIndicatorProps {
download: IDownloadChapter;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const DOWNLOAD_STATE_TO_TRANSLATION_KEY_MAP: { [state in IDownloadChapter['state']]: TranslationKey } = {
Downloading: 'download.state.label.downloading',
Error: 'download.state.label.error',

View File

@@ -333,8 +333,6 @@ export default function ReaderNavBar(props: IProps) {
{Array(Math.max(0, chapter.chapterCount))
.fill(1)
.map((ignoreValue, index) => (
// eslint-disable-next-line max-len
// eslint-disable-next-line react/no-array-index-key
<MenuItem key={`Chapter#${index + 1}`} value={index + 1}>{`${t(
'chapter.title',
)} ${index + 1}`}</MenuItem>

View File

@@ -44,20 +44,17 @@ export default function DesktopSideBar({ navBarItems }: IProps) {
return (
<SideNavBarContainer>
{
// eslint-disable-next-line react/destructuring-assignment
navBarItems.map(({ path, title, IconComponent, SelectedIconComponent }: NavbarItem) => (
<Link to={path} style={{ color: 'inherit', textDecoration: 'none' }} key={path}>
<ListItem disableRipple button key={title}>
<ListItemIcon sx={{ minWidth: '0' }}>
<Tooltip placement="right" title={t(title)}>
{iconFor(path, IconComponent, SelectedIconComponent)}
</Tooltip>
</ListItemIcon>
</ListItem>
</Link>
))
}
{navBarItems.map(({ path, title, IconComponent, SelectedIconComponent }: NavbarItem) => (
<Link to={path} style={{ color: 'inherit', textDecoration: 'none' }} key={path}>
<ListItem disableRipple button key={title}>
<ListItemIcon sx={{ minWidth: '0' }}>
<Tooltip placement="right" title={t(title)}>
{iconFor(path, IconComponent, SelectedIconComponent)}
</Tooltip>
</ListItemIcon>
</ListItem>
</Link>
))}
</SideNavBarContainer>
);
}