💄 Lint + Prettier

This commit is contained in:
ajnart
2023-01-06 01:11:02 +09:00
parent 6fb199105b
commit 2d320ff6e9
12 changed files with 27 additions and 25 deletions

View File

@@ -36,7 +36,9 @@ export const LoadConfigComponent = () => {
let newConfig: ConfigType = JSON.parse(fileText);
if (!newConfig.schemaVersion) {
console.warn('a legacy configuration schema was deteced and migrated to the current schema');
console.warn(
'a legacy configuration schema was deteced and migrated to the current schema'
);
const oldConfig = JSON.parse(fileText) as Config;
newConfig = migrateConfig(oldConfig);
}

View File

@@ -13,7 +13,7 @@ import {
Badge,
Tooltip,
} from '@mantine/core';
import { IconLock, TablerIcon } from '@tabler/icons';
import { TablerIcon } from '@tabler/icons';
import { useTranslation } from 'next-i18next';
import { useState } from 'react';
import { AppIntegrationPropertyAccessabilityType } from '../../../../../../../../types/app';

View File

@@ -20,7 +20,8 @@ export const initializeGridstack = (
) => {
if (!wrapperRef.current) return;
// calculates the currently available count of columns
const columnCount = areaType === 'sidebar' ? 1 : isLargerThanSm || typeof isLargerThanSm === 'undefined' ? 12 : 6;
const columnCount =
areaType === 'sidebar' ? 1 : isLargerThanSm || typeof isLargerThanSm === 'undefined' ? 12 : 6;
const minRow = areaType !== 'sidebar' ? 1 : Math.floor(wrapperRef.current.offsetHeight / 64);
// initialize gridstack
const newGrid = gridRef;

View File

@@ -1,5 +1,5 @@
import { ScrollArea, Space, Stack, Text } from '@mantine/core';
import { useElementSize, useViewportSize } from '@mantine/hooks';
import { useViewportSize } from '@mantine/hooks';
import { useConfigContext } from '../../../config/provider';
import ConfigChanger from '../../Config/ConfigChanger';
import ConfigActions from './Config/ConfigActions';

View File

@@ -1,9 +1,6 @@
import { Group, ActionIcon, Anchor, Text } from '@mantine/core';
import { IconBrandDiscord, IconBrandGithub } from '@tabler/icons';
import { Group, Anchor, Text } from '@mantine/core';
import { useTranslation } from 'next-i18next';
import { CURRENT_VERSION } from '../../../../data/constants';
export default function Credits() {
const { t } = useTranslation('settings/common');
@@ -22,8 +19,8 @@ export default function Credits() {
style={{ color: 'inherit', fontStyle: 'inherit', fontSize: 'inherit' }}
>
ajnart
</Anchor>
{' '}and you !
</Anchor>{' '}
and you !
</Text>
</Group>
);

View File

@@ -1,4 +1,4 @@
import { Button, ScrollArea, Stack } from '@mantine/core';
import { ScrollArea, Stack } from '@mantine/core';
import { useViewportSize } from '@mantine/hooks';
import { useTranslation } from 'next-i18next';
import { useConfigContext } from '../../../config/provider';

View File

@@ -1,4 +1,4 @@
import { Drawer, ScrollArea, Tabs, Title } from '@mantine/core';
import { Drawer, Tabs, Title } from '@mantine/core';
import { useTranslation } from 'next-i18next';
import { useConfigContext } from '../../config/provider';
import { useConfigStore } from '../../config/store';

View File

@@ -70,7 +70,7 @@ interface UseConfigStoreType {
addConfig: (
name: string,
config: ConfigType,
shouldSaveConfigToFileSystem: boolean,
shouldSaveConfigToFileSystem: boolean
) => Promise<void>;
updateConfig: (
name: string,

View File

@@ -1,7 +1,10 @@
import { useMutation, useQuery } from '@tanstack/react-query';
import axios from 'axios';
import { Results } from 'sabnzbd-api';
import { UsenetQueueRequestParams, UsenetQueueResponse } from '../../../pages/api/modules/usenet/queue';
import {
UsenetQueueRequestParams,
UsenetQueueResponse,
} from '../../../pages/api/modules/usenet/queue';
import {
UsenetHistoryRequestParams,
UsenetHistoryResponse,

View File

@@ -40,7 +40,8 @@ async function Post(req: NextApiRequest, res: NextApiResponse) {
);
await Promise.all(
delugeApp.map((app) => {
const password = app.integration?.properties.find((x) => x.field === 'password')?.value ?? undefined;
const password =
app.integration?.properties.find((x) => x.field === 'password')?.value ?? undefined;
const test = new Deluge({
baseUrl: app.url,
password,

View File

@@ -5,6 +5,4 @@ import { IWidgetDefinition } from './widgets';
// The options of IWidgetDefinition are so heavily typed that it even used 'true' as type
export const defineWidget = <TKey extends string, TOptions extends IWidgetDefinition<TKey>>(
options: TOptions
) => {
return options;
};
) => options;