Skip to content

Commit fcd0ee3

Browse files
committed
fix: issues with build
1 parent cdb8d89 commit fcd0ee3

File tree

17 files changed

+1356
-698
lines changed

17 files changed

+1356
-698
lines changed

.eslintrc.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
11
module.exports = {
22
env: {
33
node: true, // Add this line to specify the Node.js environment
4+
browser: true, // Add this line to specify the browser environment
45
},
56
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
67
extends: [
78
'eslint:recommended', // Use the recommended rules from ESLint
89
'plugin:@typescript-eslint/recommended', // Use the recommended rules from the @typescript-eslint/eslint-plugin
10+
'plugin:react/recommended', // Use the recommended rules from eslint-plugin-react
911
],
1012
parserOptions: {
1113
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
1214
sourceType: 'module', // Allows for the use of imports
15+
ecmaFeatures: {
16+
jsx: true, // Allows for the parsing of JSX
17+
},
18+
},
19+
plugins: [
20+
'react', // Add the react plugin
21+
],
22+
settings: {
23+
react: {
24+
version: 'detect', // Automatically detect the react version
25+
},
1326
},
1427
rules: {
15-
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
28+
'react/jsx-no-useless-fragment': 'warn', // Warns about unnecessary fragments
29+
'react/jsx-key': 'error', // Ensures that elements in lists have keys
30+
// Place to specify additional ESLint rules. Can be used to overwrite rules specified from the extended configs
1631
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
1732
},
1833
overrides: [

package-lock.json

Lines changed: 1293 additions & 667 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"build": "next build",
4343
"start": "next start",
4444
"serve": "serve -s ./dist",
45-
"docs": "ts-node ./docs/takeDocsPhotos.ts"
45+
"docs": "ts-node ./docs/takeDocsPhotos.ts",
46+
"lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'"
4647
},
4748
"eslintConfig": {
4849
"extends": [
@@ -65,6 +66,8 @@
6566
"devDependencies": {
6667
"@types/qbittorrent-api-v2": "^1.2.3",
6768
"@types/react-redux": "^7.1.34",
69+
"eslint": "^8.57.1",
70+
"eslint-plugin-react": "^7.37.4",
6871
"tailwindcss": "^3.3.5"
6972
},
7073
"overrides": {

src/components/dashboard/controls/settings/settings-menu/color-changer/color-changer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from "react";
12
import { useSettings } from "@/lib/hooks/useSettings";
23
import { ColorResult, SketchPicker } from "react-color";
34
import { useState } from "react";

src/components/dashboard/widgets/external-integrations/external-integration.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from "react";
12
import { useState } from "react";
23
import { JellyfinIntegration } from "./jellyfin-integration/jellyfin-integration";
34
import { IntegrationLoader } from "@/components/dashboard/widgets/skeletons";

src/components/dashboard/widgets/external-integrations/uptime-kuma-integration/uptime-kuma-integration.tsx

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,25 @@ export const UptimeKumaIntegration = ({
1515
url,
1616
}: UptimeKumaIntegrationProps) => {
1717
const Uptimes = () => {
18-
return Object.keys(data.uptime).map((key) => (
19-
<Tooltip title={key} placement="top" key={key}>
20-
<div
21-
className={clsx(classes.uptime, {
22-
[classes.up as string]:
23-
data.uptime[key as string]?.msg.includes("200"),
24-
[classes.down as string]:
25-
!data.uptime[key as string]?.msg.includes("200"),
26-
})}
27-
>
28-
<div className={classes.circle}></div>
29-
<Typography>{data.uptime[key as string]?.ping}ms</Typography>
30-
</div>
31-
</Tooltip>
32-
));
18+
return (
19+
<>
20+
{Object.keys(data.uptime).map((key) => (
21+
<Tooltip title={key} placement="top" key={key}>
22+
<div
23+
className={clsx(classes.uptime, {
24+
[classes.up as string]:
25+
data.uptime[key as string]?.msg.includes("200"),
26+
[classes.down as string]:
27+
!data.uptime[key as string]?.msg.includes("200"),
28+
})}
29+
>
30+
<div className={classes.circle}></div>
31+
<Typography>{data.uptime[key as string]?.ping}ms</Typography>
32+
</div>
33+
</Tooltip>
34+
))}
35+
</>
36+
);
3337
};
3438

3539
return (

src/components/dashboard/widgets/ram-overview/ram-overview.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from "react";
12
import { Typography } from "@mui/material";
23
import styles from "./ram-overview.module.css";
34
import MemoryIcon from "@mui/icons-material/Memory";

src/components/host/command-queue/command-queue.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,17 @@ export const CommandQueue = ({
120120
>
121121
<TableCell component="th" scope="row">
122122
{command.commands.map((com) => (
123-
<p className={classes.name}>{com.name}</p>
123+
<p key={com.name} className={classes.name}>
124+
{com.name}
125+
</p>
124126
))}
125127
</TableCell>
126128

127129
<TableCell component="th" scope="row">
128130
{command.commands.map((com) => (
129-
<p>{com.command}</p>
131+
<p key={com.command} className={classes.command}>
132+
{com.command}
133+
</p>
130134
))}
131135
</TableCell>
132136

src/components/shared/cursor-tooltip/cursor-tooltip.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from "react";
12
import { Tooltip } from "@mui/material";
23
import { useState } from "react";
34

src/lib/hooks/usePollingEffect.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { useEffect } from "react";
33
export const usePollingEffect = (
44
fn: () => void,
55
interval: number,
6+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
67
deps: any[],
7-
callOnMount: boolean = true,
8-
polling: boolean = true
8+
callOnMount = true,
9+
polling = true
910
) => {
1011
useEffect(() => {
1112
if (callOnMount) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export type QbittorrentData = {};
1+
export type QbittorrentData = object;

src/lib/services/external-integrations/sonarr/integration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { RadarrResponseType } from "../../../../pages/api/integrations/sonarr/sonarr.types";
1+
import { SonarrResponseType } from "../../../../pages/api/integrations/sonarr/sonarr.types";
22

3-
export const getShows = async (): Promise<RadarrResponseType> => {
3+
export const getShows = async (): Promise<SonarrResponseType> => {
44
const response = await fetch("/api/integrations/sonarr/shows", {
55
method: "GET",
66
});

src/pages/api/integrations/radarr/radarr.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type Movie = {};
1+
export type Movie = object;
22

33
export type MovieResponseType = {
44
movies: Movie[];

src/pages/api/integrations/sonarr/shows.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type { NextApiRequest, NextApiResponse } from "next";
2-
import { RadarrResponseType } from "./sonarr.types";
2+
import { SonarrResponseType } from "./sonarr.types";
33
import { cacheApi } from "@/lib/services/api";
44

55
export default async function handler(
66
_: NextApiRequest,
7-
res: NextApiResponse<RadarrResponseType>
7+
res: NextApiResponse<SonarrResponseType>
88
) {
9-
const response = await cacheApi.get<RadarrResponseType>(
9+
const response = await cacheApi.get<SonarrResponseType>(
1010
"/integrations/sonarr/shows"
1111
);
1212
res.status(200).json(response.data);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export type Show = {};
1+
export type Show = object;
22

3-
export type RadarrResponseType = {
3+
export type SonarrResponseType = {
44
shows: Show[];
55
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export type UptimeKumaResponseType = {};
1+
export type UptimeKumaResponseType = object;

src/pages/files.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22

3+
import React from "react";
34
import { useAppConfig } from "@/lib/hooks/use-app-config";
45

56
const IframeComponent = () => {

0 commit comments

Comments
 (0)