Skip to content

Commit

Permalink
Merge pull request ajnart#1046 from ajnart/parse-format
Browse files Browse the repository at this point in the history
πŸ§‘β€πŸ’» Migrate `package.json` prettier and eslint
  • Loading branch information
ajnart authored Jun 13, 2023
2 parents a67ad5a + 86b7168 commit 8e26c65
Show file tree
Hide file tree
Showing 13 changed files with 561 additions and 1,403 deletions.
8 changes: 0 additions & 8 deletions .editorconfig

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

43 changes: 0 additions & 43 deletions .eslintrc.js

This file was deleted.

9 changes: 0 additions & 9 deletions .prettierrc

This file was deleted.

44 changes: 0 additions & 44 deletions checkly.config.ts

This file was deleted.

101 changes: 85 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,27 +82,24 @@
},
"devDependencies": {
"@next/bundle-analyzer": "^13.0.0",
"@next/eslint-plugin-next": "^13.0.0",
"@next/eslint-plugin-next": "^13.4.5",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/dockerode": "^3.3.9",
"@types/node": "18.16.18",
"@types/prismjs": "^1.26.0",
"@types/react": "17.0.61",
"@types/react": "^18.2.11",
"@types/uuid": "^9.0.0",
"@types/video.js": "^7.3.51",
"@typescript-eslint/eslint-plugin": "^5.30.7",
"@typescript-eslint/eslint-plugin": "^5.50.0",
"@typescript-eslint/parser": "^5.30.7",
"@vitest/coverage-c8": "^0.32.0",
"@vitest/ui": "^0.32.0",
"checkly": "latest",
"eslint": "^8.20.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-mantine": "^2.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-react": "^7.30.1",
"eslint": "^8.0.1",
"eslint-config-next": "^13.4.5",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "latest",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-testing-library": "^5.5.1",
"eslint-plugin-unused-imports": "^2.0.0",
Expand All @@ -113,16 +110,12 @@
"sass": "^1.56.1",
"ts-node": "latest",
"turbo": "latest",
"typescript": "^5.0.4",
"typescript": "^5.1.0",
"video.js": "^8.0.3",
"vite-tsconfig-paths": "^4.2.0",
"vitest": "^0.32.0",
"vitest-fetch-mock": "^0.2.2"
},
"resolutions": {
"@types/react": "17.0.61",
"@types/react-dom": "17.0.20"
},
"packageManager": "[email protected]",
"nextBundleAnalysis": {
"budget": null,
Expand All @@ -148,5 +141,81 @@
"pin": {
"automerge": true
}
},
"prettier": {
"printWidth": 100,
"tabWidth": 2,
"parser": "typescript",
"singleQuote": true,
"trailingComma": "es5",
"useTabs": false,
"endOfLine": "lf",
"importOrder": [
"^@core/(.*)$",
"^@server/(.*)$",
"^@ui/(.*)$",
"^[./]"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
},
"eslintConfig": {
"ignoreDuringBuilds": true,
"extends": [
"next",
"eslint:recommended",
"plugin:@next/next/recommended",
"plugin:react-hooks/recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:vitest/recommended"
],
"plugins": [
"testing-library",
"unused-imports",
"react",
"vitest"
],
"overrides": [
{
"files": [
"**/?(*.)+(spec|test).[jt]s?(x)"
],
"extends": [
"plugin:testing-library/react"
]
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"import/no-cycle": "off",
"react/react-in-jsx-scope": "off",
"react/no-children-prop": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-unused-imports": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-shadow": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"no-continue": "off",
"linebreak-style": 0,
"import/extensions": "off",
"vitest/max-nested-describe": [
"error",
{
"max": 3
}
],
"testing-library/no-node-access": [
"error",
{
"allowContainerFirstChild": true
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useDisclosure } from '@mantine/hooks';
import { IconChevronDown, IconGripVertical } from '@tabler/icons-react';
import { Reorder, useDragControls } from 'framer-motion';
import { FC, useEffect, useRef } from 'react';

import { IDraggableEditableListInputValue } from '../../../../../widgets/widgets';

interface DraggableListProps {
Expand Down Expand Up @@ -47,6 +48,7 @@ export const DraggableList = ({ items, value, onChange, options }: DraggableList
const ListItem: FC<{
item: any;
label: string | JSX.Element;
children: JSX.Element;
}> = ({ item, label, children }) => {
const [opened, handlers] = useDisclosure(false);
const { classes, cx } = useStyles();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const StaticDraggableList: FC<StaticDraggableListParams> = (props) => {
const ListItem: FC<{
item: IDraggableListInputValue['defaultValue'][number];
label: string;
children?: ReactNode;
}> = (props) => {
const { classes, cx } = useStyles();
const controls = useDragControls();
Expand Down
5 changes: 3 additions & 2 deletions src/components/layout/header/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ import {
ActionIcon,
Autocomplete,
Box,
createStyles,
Divider,
Kbd,
Menu,
Popover,
ScrollArea,
Tooltip,
createStyles,
} from '@mantine/core';
import { useDebouncedValue, useHotkeys } from '@mantine/hooks';
import { showNotification } from '@mantine/notifications';
import { IconBrandYoutube, IconDownload, IconMovie, IconSearch } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import React, { forwardRef, useEffect, useRef, useState } from 'react';
import { api } from '~/utils/api';

import { useConfigContext } from '../../../config/provider';
import { OverseerrMediaDisplay } from '../../../modules/common';
import { IModule } from '../../../modules/ModuleTypes';
import { OverseerrMediaDisplay } from '../../../modules/common';
import { ConfigType } from '../../../types/config';
import { searchUrls } from '../../Settings/Common/SearchEngine/SearchEngineSelector';
import Tip from '../Tip';
Expand Down
10 changes: 3 additions & 7 deletions src/modules/ModuleTypes.d.ts β†’ src/modules/ModuleTypes.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
// This interface is to be used in all the modules of the project
// Each module should have its own interface and call the following function:
// TODO: Add a function to register a module

import { Icon } from '@tabler/icons-react';

// Note: Maybe use context to keep track of the modules
// TODO: Remove this old component and the entire file
export interface IModule {
export type IModule = {
id: string;
title: string;
icon: Icon;
component: React.ComponentType;
options?: Option;
padding?: PaddingOptions = {
right: 15,
top: 15,
};
}
padding?: PaddingOptions;
};

interface PaddingOptions {
top: number;
Expand Down
1 change: 1 addition & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function App(
}>
) {
const { Component, pageProps } = props;

const [primaryColor, setPrimaryColor] = useState<MantineTheme['primaryColor']>('red');
const [secondaryColor, setSecondaryColor] = useState<MantineTheme['primaryColor']>('orange');
const [primaryShade, setPrimaryShade] = useState<MantineTheme['primaryShade']>(6);
Expand Down
3 changes: 2 additions & 1 deletion src/widgets/useNet/UsenetQueueList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import dayjs from 'dayjs';
import duration from 'dayjs/plugin/duration';
import { useTranslation } from 'next-i18next';
import { FunctionComponent, useState } from 'react';

import { useGetUsenetDownloads } from '../../hooks/widgets/dashDot/api';
import { humanFileSize } from '../../tools/humanFileSize';

Expand Down Expand Up @@ -69,7 +70,7 @@ export const UsenetQueueList: FunctionComponent<UsenetQueueListProps> = ({ appId
>
{t('queue.error.message')}
<Code mt="sm" block>
{error.data}
{error.message}
</Code>
</Alert>
</Group>
Expand Down
Loading

0 comments on commit 8e26c65

Please sign in to comment.