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

Fix/vite tsconfig setup #404

Merged
merged 2 commits into from
Aug 14, 2023
Merged
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
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ module.exports = {
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],

// just why
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
'react/jsx-no-bind': 'off',
'react/jsx-props-no-spreading': 'off',
'react/require-default-props': 'off',
Expand Down
2 changes: 1 addition & 1 deletion src/components/ExtensionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useState } from 'react';
import { useState } from 'react';
import Card from '@mui/material/Card';
import CardContent from '@mui/material/CardContent';
import Button from '@mui/material/Button';
Expand Down
1 change: 0 additions & 1 deletion src/components/MangaCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React from 'react';
import Card from '@mui/material/Card';
import CardActionArea from '@mui/material/CardActionArea';
import Typography from '@mui/material/Typography';
Expand Down
4 changes: 2 additions & 2 deletions src/components/atoms/SortRadioInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

import ArrowDownward from '@mui/icons-material/ArrowDownward';
import ArrowUpward from '@mui/icons-material/ArrowUpward';
import React from 'react';
import { memo } from 'react';
import RadioInput, { RadioInputProps } from '@/components/atoms/RadioInput';

interface IProps extends RadioInputProps {
sortDescending?: boolean | null | undefined;
}

const SortRadioInput = React.memo(({ sortDescending, ...rest }: IProps) => (
const SortRadioInput = memo(({ sortDescending, ...rest }: IProps) => (
<RadioInput
checkedIcon={sortDescending ? <ArrowDownward color="primary" /> : <ArrowUpward color="primary" />}
{...rest}
Expand Down
2 changes: 1 addition & 1 deletion src/components/library/UpdateChecker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import IconButton from '@mui/material/IconButton';
import RefreshIcon from '@mui/icons-material/Refresh';
import CircularProgress from '@mui/material/CircularProgress';
Expand Down
1 change: 0 additions & 1 deletion src/components/manga/ResumeFAB.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React from 'react';
import { Link } from 'react-router-dom';
import { PlayArrow } from '@mui/icons-material';
import { useTranslation } from 'react-i18next';
Expand Down
2 changes: 1 addition & 1 deletion src/components/navbar/ReaderNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import KeyboardArrowLeftIcon from '@mui/icons-material/KeyboardArrowLeft';
import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import Typography from '@mui/material/Typography';
import { useLocation, useNavigate } from 'react-router-dom';
import Slide from '@mui/material/Slide';
Expand Down
1 change: 0 additions & 1 deletion src/components/navbar/navigation/DesktopSideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React from 'react';
import { ListItemIcon, Tooltip, styled, ListItemButton } from '@mui/material';
import { Link, useLocation } from 'react-router-dom';
import { useTheme } from '@mui/material/styles';
Expand Down
1 change: 0 additions & 1 deletion src/components/navbar/navigation/MobileBottomBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React from 'react';
import { styled, Box, ListItemButton } from '@mui/material';
import { Link as RRDLink, useLocation } from 'react-router-dom';
import { useTheme } from '@mui/material/styles';
Expand Down
4 changes: 2 additions & 2 deletions src/components/reader/DoublePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React from 'react';
import { forwardRef } from 'react';
import { Box, styled } from '@mui/material';
import { IReaderSettings } from '@/typings';

Expand All @@ -26,7 +26,7 @@ interface IProps {
settings: IReaderSettings;
}

const DoublePage = React.forwardRef((props: IProps, ref: any) => {
const DoublePage = forwardRef((props: IProps, ref: any) => {
const { image1src, image2src, index, settings } = props;

return (
Expand Down
8 changes: 4 additions & 4 deletions src/components/reader/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useRef } from 'react';
import { useState, useEffect, forwardRef, useRef } from 'react';
import Box from '@mui/material/Box';
import { IReaderSettings } from '@/typings';
import SpinnerImage from '@/components/util/SpinnerImage';

function imageStyle(settings: IReaderSettings): any {
const [dimensions, setDimensions] = React.useState({
const [dimensions, setDimensions] = useState({
height: window.innerHeight,
width: window.innerWidth,
});
React.useEffect(() => {
useEffect(() => {
function handleResize() {
setDimensions({
height: window.innerHeight,
Expand Down Expand Up @@ -65,7 +65,7 @@ interface IProps {
settings: IReaderSettings;
}

const Page = React.forwardRef((props: IProps, ref: any) => {
const Page = forwardRef((props: IProps, ref: any) => {
const { src, index, onImageLoad, settings } = props;

const imgRef = useRef<HTMLImageElement>(null);
Expand Down
1 change: 0 additions & 1 deletion src/components/reader/PageNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React from 'react';
import { Box } from '@mui/material';
import { IReaderSettings } from '@/typings';

Expand Down
1 change: 0 additions & 1 deletion src/components/reader/ReaderSettingsOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { List, ListItem, ListItemText, Switch } from '@mui/material';
import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction';
import Select from '@mui/material/Select';
import MenuItem from '@mui/material/MenuItem';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { IReaderSettings } from '@/typings';

Expand Down
2 changes: 1 addition & 1 deletion src/components/reader/pager/DoublePagedPager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useEffect, useRef } from 'react';
import { useEffect, useRef } from 'react';
import { Box } from '@mui/material';
import { createRoot } from 'react-dom/client';
import { IReaderProps } from '@/typings';
Expand Down
2 changes: 1 addition & 1 deletion src/components/reader/pager/HorizontalPager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useEffect, useRef } from 'react';
import { useEffect, useRef } from 'react';
import { Box } from '@mui/material';
import { IReaderProps } from '@/typings';
import Page from '@/components/reader/Page';
Expand Down
2 changes: 1 addition & 1 deletion src/components/reader/pager/PagedPager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useEffect, useRef } from 'react';
import { useEffect, useRef } from 'react';
import { Box } from '@mui/material';
import { IReaderProps } from '@/typings';
import Page from '@/components/reader/Page';
Expand Down
2 changes: 1 addition & 1 deletion src/components/reader/pager/VerticalPager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useCallback, useEffect, useRef } from 'react';
import { useCallback, useEffect, useRef } from 'react';
import { Box } from '@mui/material';
import { IReaderProps } from '@/typings';
import Page from '@/components/reader/Page';
Expand Down
1 change: 0 additions & 1 deletion src/components/source/SourceMangaGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React from 'react';
import { useTranslation } from 'react-i18next';
import { IMangaCard } from '@/typings';
import MangaGrid, { IMangaGridProps } from '@/components/MangaGrid';
Expand Down
4 changes: 2 additions & 2 deletions src/components/source/SourceOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import FilterListIcon from '@mui/icons-material/FilterList';
import { Button, Stack, Box } from '@mui/material';
import React from 'react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ISourceFilters, IState } from '@/typings';
import OptionsPanel from '@/components/molecules/OptionsPanel';
Expand Down Expand Up @@ -143,7 +143,7 @@ export default function SourceOptions({
update,
}: IFilters1) {
const { t } = useTranslation();
const [FilterOptions, setFilterOptions] = React.useState(false);
const [FilterOptions, setFilterOptions] = useState(false);

function handleReset() {
resetFilterValue(0);
Expand Down
2 changes: 1 addition & 1 deletion src/components/sourceConfiguration/EditTextPreference.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useState } from 'react';
import { useState } from 'react';
import ListItemText from '@mui/material/ListItemText';
import Dialog from '@mui/material/Dialog';
import DialogTitle from '@mui/material/DialogTitle';
Expand Down
4 changes: 2 additions & 2 deletions src/components/sourceConfiguration/TwoStatePreference.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useState, useEffect } from 'react';
import { createElement, useState, useEffect } from 'react';
import ListItem from '@mui/material/ListItem';
import ListItemText from '@mui/material/ListItemText';
import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction';
Expand All @@ -33,7 +33,7 @@ function TwoSatePreference(props: TwoStatePreferenceProps) {
<ListItem>
<ListItemText primary={title} secondary={summary} />
<ListItemSecondaryAction>
{React.createElement(getTwoStateType(type), {
{createElement(getTwoStateType(type), {
edge: 'end',
checked: internalCurrentValue,
onChange: () => {
Expand Down
1 change: 0 additions & 1 deletion src/components/util/CustomExtensionOutlinedIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React from 'react';
import createSvgIcon from '@mui/material/utils/createSvgIcon';

const d =
Expand Down
2 changes: 1 addition & 1 deletion src/components/util/EmptyView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// adopted from: https://github.com/tachiyomiorg/tachiyomi/blob/master/app/src/main/java/eu/kanade/tachiyomi/widget/EmptyView.kt

import React, { useMemo } from 'react';
import { useMemo } from 'react';
import Typography from '@mui/material/Typography';
import { useTheme } from '@mui/material/styles';
import { Box, useMediaQuery } from '@mui/material';
Expand Down
1 change: 0 additions & 1 deletion src/components/util/ListItemLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React from 'react';
import { Link } from 'react-router-dom';
import { ListItemButton, ListItemButtonProps } from '@mui/material';

Expand Down
6 changes: 3 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React from 'react';
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import App from '@/App';
import '@/index.css';
Expand All @@ -16,7 +16,7 @@ import '@fontsource/roboto';
const container = document.getElementById('root');
const root = createRoot(container!);
root.render(
<React.StrictMode>
<StrictMode>
<App />
</React.StrictMode>,
</StrictMode>,
);
2 changes: 1 addition & 1 deletion src/lib/StrictModeDroppable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { Droppable, DroppableProps } from 'react-beautiful-dnd';

// issue: https://github.com/atlassian/react-beautiful-dnd/issues/2399
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Browse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useState } from 'react';
import { useState } from 'react';
import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';
import { useTranslation } from 'react-i18next';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Extensions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
import { useContext, useEffect, useMemo, useRef, useState } from 'react';
import { fromEvent } from 'file-selector';
import IconButton from '@mui/material/IconButton';
import AddIcon from '@mui/icons-material/Add';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Reader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import CircularProgress from '@mui/material/CircularProgress';
import React, { useCallback, useContext, useEffect, useState } from 'react';
import { useCallback, useContext, useEffect, useState } from 'react';
import { useLocation, useNavigate, useParams } from 'react-router-dom';
import { Box } from '@mui/material';
import { useTranslation } from 'react-i18next';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useContext, useEffect, useState } from 'react';
import { useContext, useEffect, useState } from 'react';
import AutoStoriesIcon from '@mui/icons-material/AutoStories';
import List from '@mui/material/List';
import ListAltIcon from '@mui/icons-material/ListAlt';
Expand Down
4 changes: 2 additions & 2 deletions src/screens/SourceConfigure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useContext, useEffect } from 'react';
import { createElement, useContext, useEffect } from 'react';
import { useParams } from 'react-router-dom';
import List from '@mui/material/List';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -71,7 +71,7 @@ export default function SourceConfigure() {

// TypeScript is dumb in detecting extra props
// @ts-ignore
return React.createElement(getPrefComponent(it.type), props);
return createElement(getPrefComponent(it.type), props);
})}
</List>
);
Expand Down
2 changes: 1 addition & 1 deletion src/screens/SourceMangas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
import { useCallback, useContext, useEffect, useMemo, useState } from 'react';
import { useParams, useNavigate, useLocation } from 'react-router-dom';
import IconButton from '@mui/material/IconButton';
import SettingsIcon from '@mui/icons-material/Settings';
Expand Down
6 changes: 3 additions & 3 deletions src/screens/Sources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useContext, useEffect } from 'react';
import { Fragment, useContext, useEffect } from 'react';
import { IconButton } from '@mui/material';
import TravelExploreIcon from '@mui/icons-material/TravelExplore';
import { useNavigate } from 'react-router-dom';
Expand Down Expand Up @@ -103,7 +103,7 @@ export default function Sources() {
.map(
([lang, list]) =>
shownLangs.indexOf(lang) !== -1 && (
<React.Fragment key={lang}>
<Fragment key={lang}>
<h1 key={lang} style={{ marginLeft: 25 }}>
{translateExtensionLanguage(lang)}
</h1>
Expand All @@ -112,7 +112,7 @@ export default function Sources() {
.map((source) => (
<SourceCard key={source.id} source={source} />
))}
</React.Fragment>
</Fragment>
),
)}
</>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/settings/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useContext, useEffect } from 'react';
import { useContext, useEffect } from 'react';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemText from '@mui/material/ListItemText';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/settings/Backup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import React, { useContext, useEffect } from 'react';
import { useContext, useEffect } from 'react';
import List from '@mui/material/List';
import ListItemText from '@mui/material/ListItemText';
import { fromEvent } from 'file-selector';
Expand Down
Loading