Skip to content

Commit d68ed8e

Browse files
Linter fixes and rule adjustments
1 parent 21a6bd1 commit d68ed8e

File tree

7 files changed

+18
-20
lines changed

7 files changed

+18
-20
lines changed

.eslintrc.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
{
2-
"extends": ["next/core-web-vitals", "next/typescript"]
2+
"extends": ["next/core-web-vitals", "next/typescript"],
3+
"rules": {
4+
"@typescript-eslint/no-unused-vars": "warn",
5+
"@typescript-eslint/no-explicit-any": "warn",
6+
"react-hooks/exhaustive-deps": "off"
7+
}
38
}

app/components/LauncherPage.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Container, Row, Col } from "react-bootstrap";
21
import NavBar from "./NavBar";
32

43
export default function LauncherPage({

app/components/LoginModal.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect, useRef } from "react";
1+
import { useState, useEffect } from "react";
22

33
import Modal from "react-bootstrap/Modal";
44
import Form from "react-bootstrap/Form";
@@ -106,6 +106,7 @@ function AnnouncementsPanel({ server }: { server?: ServerEntry }) {
106106
src={getUpsellImage(server)}
107107
className={!showUpsell ? "d-none" : ""}
108108
onLoad={() => setShowUpsell(true)}
109+
alt="Upsell"
109110
/>
110111
<div className="announcements">
111112
{error ? ERROR_TEXT : announcements.split('\n').map((line, index) => (
@@ -123,7 +124,7 @@ function RequirementsTooltip({
123124
}: {
124125
focusedControlId: string | null;
125126
controlId: string;
126-
children: any;
127+
children: React.ReactNode;
127128
}) {
128129
const target = document.getElementById(controlId);
129130
const show = !!(focusedControlId && focusedControlId === controlId);
@@ -285,7 +286,7 @@ export default function LoginModal({
285286
</Form.Group>
286287
<div className="text-center">
287288
<span>
288-
View this server's{" "}
289+
View this server{"'s "}
289290
<span
290291
role="button"
291292
className="text-decoration-underline"

app/components/ServerList.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ServerEntry, VersionEntry, Versions } from "@/app/types";
1+
import { ServerEntry, VersionEntry } from "@/app/types";
22
import { useEffect, useState } from "react";
33
import { invoke } from "@tauri-apps/api/core";
44

@@ -125,7 +125,7 @@ function VersionBadges({
125125
{endpointVersions.map((versionUuid) => {
126126
const version = findVersion(versions, versionUuid);
127127
if (!version) {
128-
return <span className="badge bg-danger me-1">unknown</span>;
128+
return <span key={versionUuid} className="badge bg-danger me-1">unknown</span>;
129129
}
130130
const label = version.name ?? version.uuid;
131131
return <span key={version.uuid} className="badge bg-success me-1">{label}</span>;

app/page.tsx

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import { startEasterEggs, stopEasterEggs } from "./easter-eggs";
3+
import { startEasterEggs } from "./easter-eggs";
44

55
import { invoke } from "@tauri-apps/api/core";
66
import { getVersion } from "@tauri-apps/api/app";
@@ -58,7 +58,6 @@ export default function Home() {
5858
const [versions, setVersions] = useState<VersionEntry[]>([]);
5959

6060
const [alerts, setAlerts] = useState<Alert[]>([]);
61-
const [notifications, setNotifications] = useState<Notification[]>([]);
6261
const [loadingTasks, setLoadingTasks] = useState<LoadingTask[]>([]);
6362

6463
const [showAddModal, setShowAddModal] = useState(false);
@@ -249,10 +248,6 @@ export default function Home() {
249248
}
250249
};
251250

252-
const stub = () => {
253-
alertInfo("hehe dong");
254-
};
255-
256251
const connectToServer = async (
257252
serverUuid: string,
258253
versionUuid: string,
@@ -342,7 +337,7 @@ export default function Home() {
342337
try {
343338
const loginSession: LoginSession = await invoke("get_session", { serverUuid: serverUuid });
344339
session = loginSession;
345-
} catch (e: unknown) {
340+
} catch {
346341
// If we can't get a session token for ANY REASON, we'll grab a new refresh token
347342
// by making the user log in again
348343
stopLoading("configure_endpoint");

app/settings/GameBuildsList.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const getMissingTooltip = (items: Record<string, VersionCacheProgressItem>) => {
6666
}
6767

6868
let tooltip = "Missing:\n";
69-
for (const [name, item] of missingItems) {
69+
for (const [name, _] of missingItems) {
7070
tooltip += `${name}\n`;
7171
}
7272
return tooltip;

app/util.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,10 @@ export function getHostnameFromLink(link: string) {
7575
let isDebugMode: boolean | undefined = undefined;
7676
export async function getDebugMode() {
7777
if (isDebugMode === undefined) {
78-
try {
79-
const debugOn: boolean = await invoke("is_debug_mode");
80-
isDebugMode = debugOn;
81-
} catch (e) {}
78+
const debugOn: boolean = await invoke("is_debug_mode");
79+
isDebugMode = debugOn;
8280
}
83-
return isDebugMode ?? false;
81+
return isDebugMode;
8482
}
8583

8684
export function deepEqual(a: any, b: any) {

0 commit comments

Comments
 (0)