Feature/use alias for imports (#352)

* Use alias "@" for imports

* Use alias "@" for imports - Fix imports

* Use alias "@" for imports - Prevent faulty "import/extensions" linting issue

For some reason the rule throws an error for alias imports

* Use alias "@" for imports - Update "no-relative-imports" eslint rule
This commit is contained in:
schroda
2023-06-05 01:42:39 +02:00
committed by GitHub
parent 1ec6d77598
commit 4b83ccc889
88 changed files with 337 additions and 331 deletions

View File

@@ -8,7 +8,7 @@
import React from 'react';
import { Box, styled } from '@mui/material';
import { IReaderSettings } from 'typings';
import { IReaderSettings } from '@/typings';
const Image = styled('img')({
marginBottom: 0,

View File

@@ -7,9 +7,9 @@
*/
import React, { useRef } from 'react';
import SpinnerImage from 'components/util/SpinnerImage';
import Box from '@mui/material/Box';
import { IReaderSettings } from 'typings';
import { IReaderSettings } from '@/typings';
import SpinnerImage from '@/components/util/SpinnerImage';
function imageStyle(settings: IReaderSettings): any {
const [dimensions, setDimensions] = React.useState({

View File

@@ -8,7 +8,7 @@
import React from 'react';
import { Box } from '@mui/material';
import { IReaderSettings } from 'typings';
import { IReaderSettings } from '@/typings';
interface IProps {
settings: IReaderSettings;

View File

@@ -11,8 +11,8 @@ import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction';
import Select from '@mui/material/Select';
import MenuItem from '@mui/material/MenuItem';
import React from 'react';
import { IReaderSettings } from 'typings';
import { useTranslation } from 'react-i18next';
import { IReaderSettings } from '@/typings';
interface IProps extends IReaderSettings {
setSettingValue: (key: keyof IReaderSettings, value: string | boolean) => void;

View File

@@ -8,10 +8,10 @@
import React, { useEffect, useRef } from 'react';
import { Box } from '@mui/material';
import Page from 'components/reader/Page';
import DoublePage from 'components/reader/DoublePage';
import { IReaderProps } from 'typings';
import { createRoot } from 'react-dom/client';
import { IReaderProps } from '@/typings';
import Page from '@/components/reader/Page';
import DoublePage from '@/components/reader/DoublePage';
const isSpreadPage = (image: HTMLImageElement): boolean => {
const aspectRatio = image.height / image.width;

View File

@@ -8,8 +8,8 @@
import React, { useEffect, useRef } from 'react';
import { Box } from '@mui/material';
import Page from 'components/reader/Page';
import { IReaderProps } from 'typings';
import { IReaderProps } from '@/typings';
import Page from '@/components/reader/Page';
const findCurrentPageIndex = (wrapper: HTMLDivElement): number => {
for (let i = 0; i < wrapper.children.length; i++) {

View File

@@ -8,8 +8,8 @@
import React, { useEffect, useRef } from 'react';
import { Box } from '@mui/material';
import Page from 'components/reader/Page';
import { IReaderProps } from 'typings';
import { IReaderProps } from '@/typings';
import Page from '@/components/reader/Page';
export default function PagedReader(props: IReaderProps) {
const { pages, settings, setCurPage, initialPage, curPage, nextChapter, prevChapter } = props;

View File

@@ -8,8 +8,8 @@
import React, { useCallback, useEffect, useRef } from 'react';
import { Box } from '@mui/material';
import Page from 'components/reader/Page';
import { IReaderProps } from 'typings';
import { IReaderProps } from '@/typings';
import Page from '@/components/reader/Page';
const findCurrentPageIndex = (wrapper: HTMLDivElement): number => {
for (let i = 0; i < wrapper.children.length; i++) {