diff --git a/src/components/MangaCard.tsx b/src/components/MangaCard.tsx index c82aa7646b..5018c19107 100644 --- a/src/components/MangaCard.tsx +++ b/src/components/MangaCard.tsx @@ -77,15 +77,7 @@ const MangaCard = React.forwardRef((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, diff --git a/src/components/library/LibraryMangaGrid.tsx b/src/components/library/LibraryMangaGrid.tsx index f315d809b0..12d4042ec1 100644 --- a/src/components/library/LibraryMangaGrid.tsx +++ b/src/components/library/LibraryMangaGrid.tsx @@ -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); diff --git a/src/components/manga/util.tsx b/src/components/manga/util.tsx index 6c68726e99..c71ba6cbb7 100644 --- a/src/components/manga/util.tsx +++ b/src/components/manga/util.tsx @@ -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': diff --git a/src/components/molecules/DownloadStateIndicator.tsx b/src/components/molecules/DownloadStateIndicator.tsx index 4231cfbf59..6fe3cb82f6 100644 --- a/src/components/molecules/DownloadStateIndicator.tsx +++ b/src/components/molecules/DownloadStateIndicator.tsx @@ -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', diff --git a/src/components/navbar/ReaderNavBar.tsx b/src/components/navbar/ReaderNavBar.tsx index 2fb81f9c5a..50fcb0b7bc 100644 --- a/src/components/navbar/ReaderNavBar.tsx +++ b/src/components/navbar/ReaderNavBar.tsx @@ -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 {`${t( 'chapter.title', )} ${index + 1}`} diff --git a/src/components/navbar/navigation/DesktopSideBar.tsx b/src/components/navbar/navigation/DesktopSideBar.tsx index 0628272cbb..c187e77c91 100644 --- a/src/components/navbar/navigation/DesktopSideBar.tsx +++ b/src/components/navbar/navigation/DesktopSideBar.tsx @@ -44,20 +44,17 @@ export default function DesktopSideBar({ navBarItems }: IProps) { return ( - { - // eslint-disable-next-line react/destructuring-assignment - navBarItems.map(({ path, title, IconComponent, SelectedIconComponent }: NavbarItem) => ( - - - - - {iconFor(path, IconComponent, SelectedIconComponent)} - - - - - )) - } + {navBarItems.map(({ path, title, IconComponent, SelectedIconComponent }: NavbarItem) => ( + + + + + {iconFor(path, IconComponent, SelectedIconComponent)} + + + + + ))} ); } diff --git a/src/screens/DownloadQueue.tsx b/src/screens/DownloadQueue.tsx index 7d09b37bf1..ce52853edc 100644 --- a/src/screens/DownloadQueue.tsx +++ b/src/screens/DownloadQueue.tsx @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/no-shadow */ -/* eslint-disable react/destructuring-assignment */ /* * Copyright (C) Contributors to the Suwayomi project * @@ -16,7 +14,7 @@ import IconButton from '@mui/material/IconButton'; import NavbarContext from 'components/context/NavbarContext'; import EmptyView from 'components/util/EmptyView'; import React, { useContext, useEffect } from 'react'; -import { DragDropContext, Draggable, Droppable, DropResult } from 'react-beautiful-dnd'; +import { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd'; import client from 'util/client'; import Typography from '@mui/material/Typography'; @@ -55,8 +53,7 @@ const DownloadQueue: React.FC = () => { setAction(null); }, [t]); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const onDragEnd = (result: DropResult) => {}; + const onDragEnd = () => {}; if (queue.length === 0) { return ; @@ -84,19 +81,19 @@ const DownloadQueue: React.FC = () => { - {(provided) => ( - + {(droppableProvided) => ( + {queue.map((item, index) => ( - {(provided, snapshot) => ( + {(draggableProvided, snapshot) => ( { )} ))} - {provided.placeholder} + {droppableProvided.placeholder} )} diff --git a/src/screens/SearchAll.tsx b/src/screens/SearchAll.tsx index af59da134f..12d5cc501e 100644 --- a/src/screens/SearchAll.tsx +++ b/src/screens/SearchAll.tsx @@ -109,7 +109,6 @@ const SearchAll: React.FC = () => { } setFetched({}); setMangas({}); - // eslint-disable-next-line max-len doIT( sources .filter(({ lang }) => shownLangs.indexOf(lang) !== -1) @@ -167,7 +166,6 @@ const SearchAll: React.FC = () => { if (query) { return ( <> - {/* eslint-disable-next-line max-len */} {sources .filter(({ lang }) => shownLangs.indexOf(lang) !== -1) .filter((source) => showNsfw || !source.isNsfw) diff --git a/src/screens/Sources.tsx b/src/screens/Sources.tsx index ed93f0f8a5..425bfdc6c8 100644 --- a/src/screens/Sources.tsx +++ b/src/screens/Sources.tsx @@ -97,7 +97,6 @@ export default function Sources() { return ( <> - {/* eslint-disable-next-line max-len */} {Object.entries(groupByLang(sources ?? [])) .sort((a, b) => langSortCmp(a[0], b[0])) .map( diff --git a/src/screens/settings/Categories.tsx b/src/screens/settings/Categories.tsx index 23ca9e458a..4268875cf9 100644 --- a/src/screens/settings/Categories.tsx +++ b/src/screens/settings/Categories.tsx @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/no-shadow */ -/* eslint-disable react/destructuring-assignment */ /* * Copyright (C) Contributors to the Suwayomi project * @@ -140,21 +138,21 @@ export default function Categories() { <> - {(provided) => ( - + {(droppableProvided) => ( + {categories.map((item, index) => ( - {(provided, snapshot) => ( + {(draggableProvided, snapshot) => ( @@ -180,7 +178,7 @@ export default function Categories() { )} ))} - {provided.placeholder} + {droppableProvided.placeholder} )} diff --git a/src/screens/settings/DefaultReaderSettings.tsx b/src/screens/settings/DefaultReaderSettings.tsx index d3dedc3d8b..8ba9709988 100644 --- a/src/screens/settings/DefaultReaderSettings.tsx +++ b/src/screens/settings/DefaultReaderSettings.tsx @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/no-shadow */ -/* eslint-disable react/destructuring-assignment */ /* * Copyright (C) Contributors to the Suwayomi project * diff --git a/src/util/localStorage.tsx b/src/util/localStorage.tsx index 9233e41bcb..478e20e816 100644 --- a/src/util/localStorage.tsx +++ b/src/util/localStorage.tsx @@ -6,28 +6,18 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ function getItem(key: string, defaultValue: T): T { - try { - const item = window.localStorage.getItem(key); + const item = window.localStorage.getItem(key); - if (item !== null) { - return JSON.parse(item); - } - - window.localStorage.setItem(key, JSON.stringify(defaultValue)); - - /* eslint-disable no-empty */ - } finally { + if (item !== null) { + return JSON.parse(item); } + + window.localStorage.setItem(key, JSON.stringify(defaultValue)); return defaultValue; } function setItem(key: string, value: T): void { - try { - window.localStorage.setItem(key, JSON.stringify(value)); - - // eslint-disable-next-line no-empty - } finally { - } + window.localStorage.setItem(key, JSON.stringify(value)); } export default { getItem, setItem }; diff --git a/src/util/useLocalStorage.tsx b/src/util/useLocalStorage.tsx index 1f8e55b998..3b952af2e9 100644 --- a/src/util/useLocalStorage.tsx +++ b/src/util/useLocalStorage.tsx @@ -8,7 +8,6 @@ import React, { useState, Dispatch, SetStateAction, useReducer, Reducer, useCallback } from 'react'; import storage from 'util/localStorage'; -// eslint-disable-next-line max-len export default function useLocalStorage(key: string, defaultValue: T | (() => T)): [T, Dispatch>] { const initialState = defaultValue instanceof Function ? defaultValue() : defaultValue; const [storedValue, setStoredValue] = useState(storage.getItem(key, initialState));