From 31d9903251379addbb32c13bb27774567b5a5049 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Tue, 25 May 2021 13:24:56 +0430 Subject: [PATCH] got rid of all instances of diabling no-unused-vars --- webUI/react/src/components/CategorySelect.tsx | 1 - webUI/react/src/components/ChapterCard.tsx | 4 +--- webUI/react/src/components/LoadingPlaceholder.tsx | 1 - webUI/react/src/components/Toast.tsx | 8 +------- .../react/src/components/navbar/ReaderNavBar.tsx | 15 +++------------ webUI/react/src/components/reader/Page.tsx | 4 ---- .../components/reader/pager/HorizontalPager.tsx | 1 - webUI/react/src/screens/Manga.tsx | 4 +--- 8 files changed, 6 insertions(+), 32 deletions(-) diff --git a/webUI/react/src/components/CategorySelect.tsx b/webUI/react/src/components/CategorySelect.tsx index 166a858b..cb4dd31a 100644 --- a/webUI/react/src/components/CategorySelect.tsx +++ b/webUI/react/src/components/CategorySelect.tsx @@ -70,7 +70,6 @@ export default function CategorySelect(props: IProps) { setOpen(false); }; - // eslint-disable-next-line @typescript-eslint/no-unused-vars const handleChange = (event: React.ChangeEvent, categoryId: number) => { const { checked } = event.target as HTMLInputElement; diff --git a/webUI/react/src/components/ChapterCard.tsx b/webUI/react/src/components/ChapterCard.tsx index 05605628..f96cefb4 100644 --- a/webUI/react/src/components/ChapterCard.tsx +++ b/webUI/react/src/components/ChapterCard.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ /* * Copyright (C) Contributors to the Suwayomi project * @@ -13,7 +12,7 @@ import CardContent from '@material-ui/core/CardContent'; import IconButton from '@material-ui/core/IconButton'; import MoreVertIcon from '@material-ui/icons/MoreVert'; import Typography from '@material-ui/core/Typography'; -import { Link, useHistory } from 'react-router-dom'; +import { Link } from 'react-router-dom'; import Menu from '@material-ui/core/Menu'; import MenuItem from '@material-ui/core/MenuItem'; import BookmarkIcon from '@material-ui/icons/Bookmark'; @@ -52,7 +51,6 @@ interface IProps{ export default function ChapterCard(props: IProps) { const classes = useStyles(); - const history = useHistory(); const theme = useTheme(); const { chapter, triggerChaptersUpdate } = props; diff --git a/webUI/react/src/components/LoadingPlaceholder.tsx b/webUI/react/src/components/LoadingPlaceholder.tsx index 36c1dbcf..15a73085 100644 --- a/webUI/react/src/components/LoadingPlaceholder.tsx +++ b/webUI/react/src/components/LoadingPlaceholder.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable react/jsx-props-no-spreading */ /* eslint-disable react/require-default-props */ /* diff --git a/webUI/react/src/components/Toast.tsx b/webUI/react/src/components/Toast.tsx index 6d7dc644..ba0fa56a 100644 --- a/webUI/react/src/components/Toast.tsx +++ b/webUI/react/src/components/Toast.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ /* * Copyright (C) Contributors to the Suwayomi project * @@ -10,7 +9,7 @@ import ReactDOM from 'react-dom'; import React from 'react'; import Slide, { SlideProps } from '@material-ui/core/Slide'; import Snackbar from '@material-ui/core/Snackbar'; -import MuiAlert, { AlertProps, Color as Severity } from '@material-ui/lab/Alert'; +import MuiAlert, { Color as Severity } from '@material-ui/lab/Alert'; function removeToast(id: string) { const container = document.querySelector(`#${id}`)!!; @@ -23,11 +22,6 @@ function Transition(props: SlideProps) { return ; } -function Alert(props: AlertProps) { - // eslint-disable-next-line react/jsx-props-no-spreading - return ; -} - interface IToastProps{ message: string severity: Severity diff --git a/webUI/react/src/components/navbar/ReaderNavBar.tsx b/webUI/react/src/components/navbar/ReaderNavBar.tsx index 0c551bbe..8dc4393c 100644 --- a/webUI/react/src/components/navbar/ReaderNavBar.tsx +++ b/webUI/react/src/components/navbar/ReaderNavBar.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ /* * Copyright (C) Contributors to the Suwayomi project * @@ -12,7 +11,7 @@ import KeyboardArrowLeftIcon from '@material-ui/icons/KeyboardArrowLeft'; import KeyboardArrowRightIcon from '@material-ui/icons/KeyboardArrowRight'; import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown'; import KeyboardArrowUpIcon from '@material-ui/icons/KeyboardArrowUp'; -import { makeStyles, Theme, useTheme } from '@material-ui/core/styles'; +import { makeStyles } from '@material-ui/core/styles'; import React, { useContext, useEffect, useState } from 'react'; import Typography from '@material-ui/core/Typography'; import { useHistory, Link } from 'react-router-dom'; @@ -22,18 +21,15 @@ import Zoom from '@material-ui/core/Zoom'; import { Switch } from '@material-ui/core'; import List from '@material-ui/core/List'; import ListItem from '@material-ui/core/ListItem'; -import ListItemIcon from '@material-ui/core/ListItemIcon'; import MenuItem from '@material-ui/core/MenuItem'; import Select from '@material-ui/core/Select'; import ListItemText from '@material-ui/core/ListItemText'; import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction'; import Collapse from '@material-ui/core/Collapse'; import Button from '@material-ui/core/Button'; -import ClickAwayListener from '@material-ui/core/ClickAwayListener'; -import DarkTheme from '../../context/DarkTheme'; import NavBarContext from '../../context/NavbarContext'; -const useStyles = (settings: IReaderSettings) => makeStyles((theme: Theme) => ({ +const useStyles = (settings: IReaderSettings) => makeStyles({ // main container and root div need to change classes... AppMainContainer: { display: 'none', @@ -137,7 +133,7 @@ const useStyles = (settings: IReaderSettings) => makeStyles((theme: Theme) => ({ backgroundColor: 'black', }, }, -})); +}); export const defaultReaderSettings = () => ({ staticNav: false, @@ -157,7 +153,6 @@ interface IProps { export default function ReaderNavBar(props: IProps) { const { title } = useContext(NavBarContext); - const { darkTheme } = useContext(DarkTheme); const history = useHistory(); @@ -166,12 +161,10 @@ export default function ReaderNavBar(props: IProps) { } = props; const [drawerOpen, setDrawerOpen] = useState(false || settings.staticNav); - const [drawerVisible, setDrawerVisible] = useState(false || settings.staticNav); const [hideOpenButton, setHideOpenButton] = useState(false); const [prevScrollPos, setPrevScrollPos] = useState(0); const [settingsCollapseOpen, setSettingsCollapseOpen] = useState(true); - const theme = useTheme(); const classes = useStyles(settings)(); const setSettingValue = (key: string, value: any) => setSettings({ ...settings, [key]: value }); @@ -210,8 +203,6 @@ export default function ReaderNavBar(props: IProps) { appear={false} mountOnEnter unmountOnExit - onEntered={() => setDrawerVisible(true)} - onExited={() => setDrawerVisible(false)} >
diff --git a/webUI/react/src/components/reader/Page.tsx b/webUI/react/src/components/reader/Page.tsx index f934cc12..5aa11762 100644 --- a/webUI/react/src/components/reader/Page.tsx +++ b/webUI/react/src/components/reader/Page.tsx @@ -1,5 +1,3 @@ -/* eslint-disable react/no-unused-prop-types */ -/* eslint-disable @typescript-eslint/no-unused-vars */ /* * Copyright (C) Contributors to the Suwayomi project * @@ -10,7 +8,6 @@ import CircularProgress from '@material-ui/core/CircularProgress'; import { makeStyles } from '@material-ui/core/styles'; import React, { useEffect, useRef, useState } from 'react'; -import LazyLoad from 'react-lazyload'; const useStyles = (settings: IReaderSettings) => makeStyles({ loading: { @@ -98,7 +95,6 @@ const Page = React.forwardRef((props: IProps, ref: any) => { const { src, index, setCurPage, settings, } = props; - const classes = useStyles(settings)(); return (
diff --git a/webUI/react/src/components/reader/pager/HorizontalPager.tsx b/webUI/react/src/components/reader/pager/HorizontalPager.tsx index 49a0be09..81a29737 100644 --- a/webUI/react/src/components/reader/pager/HorizontalPager.tsx +++ b/webUI/react/src/components/reader/pager/HorizontalPager.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ /* * Copyright (C) Contributors to the Suwayomi project * diff --git a/webUI/react/src/screens/Manga.tsx b/webUI/react/src/screens/Manga.tsx index 93f86d9a..6b0759b5 100644 --- a/webUI/react/src/screens/Manga.tsx +++ b/webUI/react/src/screens/Manga.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ /* * Copyright (C) Contributors to the Suwayomi project * @@ -7,7 +6,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import React, { useEffect, useState, useContext } from 'react'; -import { makeStyles, Theme, useTheme } from '@material-ui/core/styles'; +import { makeStyles, Theme } from '@material-ui/core/styles'; import { useParams } from 'react-router-dom'; import { Virtuoso } from 'react-virtuoso'; import ChapterCard from '../components/ChapterCard'; @@ -44,7 +43,6 @@ const useStyles = makeStyles((theme: Theme) => ({ export default function Manga() { const classes = useStyles(); - const theme = useTheme(); const { setTitle } = useContext(NavbarContext); useEffect(() => { setTitle('Manga'); }, []); // delegate setting topbar action to MangaDetails