fix: lint errors (finally)
This commit is contained in:
parent
7951d0083a
commit
4671357963
15 changed files with 26 additions and 31 deletions
|
|
@ -5,7 +5,6 @@ import { after } from "@vendetta/patcher";
|
|||
import { Forms } from "@vendetta/ui/components";
|
||||
import { findInReactTree } from "@vendetta/utils";
|
||||
import { findByProps } from "@vendetta/metro";
|
||||
import { logger } from "@vendetta";
|
||||
import Settings from "./settings/settings";
|
||||
|
||||
const { FormSection, FormRow } = Forms;
|
||||
|
|
@ -27,6 +26,7 @@ const SettingsOverviewScreen = bunny?.metro?.findByNameLazy(
|
|||
false,
|
||||
);
|
||||
|
||||
/* eslint-disable react/prop-types */
|
||||
function Section({ tabs }) {
|
||||
const navigation = NavigationNative.useNavigation();
|
||||
|
||||
|
|
@ -46,6 +46,7 @@ function Section({ tabs }) {
|
|||
},
|
||||
});
|
||||
}
|
||||
/* eslint-enable react/prop-types */
|
||||
|
||||
function patchPanelUI(tabs, patches) {
|
||||
try {
|
||||
|
|
@ -91,7 +92,7 @@ function patchPanelUI(tabs, patches) {
|
|||
true,
|
||||
),
|
||||
);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// we don't need to care about this error
|
||||
}
|
||||
}
|
||||
|
|
@ -137,7 +138,7 @@ function patchTabsUI(tabs, patches) {
|
|||
...rendererConfigValue,
|
||||
...row,
|
||||
}),
|
||||
set: (v) => (rendererConfigValue = v),
|
||||
set(v) { rendererConfigValue = v; },
|
||||
});
|
||||
|
||||
const firstRender = Symbol("pinToSettings meow meow");
|
||||
|
|
@ -145,7 +146,7 @@ function patchTabsUI(tabs, patches) {
|
|||
try {
|
||||
if (!createListModule) return;
|
||||
patches.push(
|
||||
after("createList", createListModule, function (args, ret) {
|
||||
after("createList", createListModule, function (args) {
|
||||
if (!args[0][firstRender]) {
|
||||
args[0][firstRender] = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ export const friendInviteRevokeCommand = {
|
|||
type: 1,
|
||||
applicationId: "-1",
|
||||
inputType: 1,
|
||||
execute: async (_, ctx) => {
|
||||
execute: async () => {
|
||||
try {
|
||||
const invitesBefore = await inviteModule.getAllFriendInvites();
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ const maxMessageLength = (() => {
|
|||
?.premiumType === 2
|
||||
? 4000
|
||||
: 2000;
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return 2000; // fallback
|
||||
}
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ function getCurrentUTCDateTime() {
|
|||
const seconds = String(utc.getSeconds()).padStart(2, "0");
|
||||
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
|
@ -74,7 +74,7 @@ function getDiscordInfo() {
|
|||
function generateSystemInfo() {
|
||||
try {
|
||||
const { cpuCoreCount, cpuPerc, memUsage } = getHardwareInfo();
|
||||
const discordInfo = getDiscordInfo();
|
||||
void getDiscordInfo();
|
||||
const _debugInfo =
|
||||
(typeof getDebugInfo === "function" ? (getDebugInfo() as any) : {}) || {};
|
||||
const { vendetta, discord, react, hermes, os, device } = _debugInfo;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { plugin } from "@vendetta";
|
||||
import { FluxDispatcher } from "@vendetta/metro/common";
|
||||
import { Forms } from "@vendetta/ui/components";
|
||||
|
||||
import { LFMSettings } from "../../defs";
|
||||
import Constants from "./constants";
|
||||
|
|
@ -10,8 +9,6 @@ import { UserStore } from "./modules";
|
|||
// Import Settings component directly
|
||||
import Settings from "./ui/pages/Settings";
|
||||
|
||||
const { FormText } = Forms;
|
||||
|
||||
export const pluginState = {
|
||||
pluginStopped: false,
|
||||
lastActivity: undefined,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { clipboard } from "@vendetta/metro/common";
|
||||
import { getAssetIDByName } from "@vendetta/ui/assets";
|
||||
import { Forms, General } from "@vendetta/ui/components";
|
||||
import { General } from "@vendetta/ui/components";
|
||||
import { showToast } from "@vendetta/ui/toasts";
|
||||
import { changelog, currentVersion } from "../changelog";
|
||||
import { React } from "@vendetta/metro/common";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { React } from "@vendetta/metro/common";
|
||||
import { Codeblock, Forms } from "@vendetta/ui/components";
|
||||
import { ScrollView, Text } from "react-native";
|
||||
import { ScrollView } from "react-native";
|
||||
import { useEffect } from "react";
|
||||
import {
|
||||
useDebugInfo,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { plugin } from "@vendetta";
|
|||
import { getAssetIDByName } from "@vendetta/ui/assets";
|
||||
import { showToast } from "@vendetta/ui/toasts";
|
||||
import { React } from "@vendetta/metro/common";
|
||||
import { View, Linking } from "react-native";
|
||||
import { Linking } from "react-native";
|
||||
import { changelog, currentVersion } from "../../changelog";
|
||||
import { findByProps } from "@vendetta/metro";
|
||||
|
||||
|
|
@ -14,9 +14,8 @@ const { TableRowGroup, TableSwitchRow, Stack, TableRow } = findByProps(
|
|||
"TableRow",
|
||||
);
|
||||
const { TextInput } = findByProps("TextInput");
|
||||
const { FormText } = findByProps("FormText");
|
||||
|
||||
import { currentSettings, pluginState } from "../..";
|
||||
import { pluginState } from "../..";
|
||||
import Constants from "../../constants";
|
||||
import { initialize } from "../../manager";
|
||||
import { lastfmClient } from "../../utils/lastfm";
|
||||
|
|
@ -26,7 +25,7 @@ const set = (k: string, v: any) => (plugin.storage[k] = v);
|
|||
|
||||
// Define the Settings component
|
||||
export default function Settings() {
|
||||
const [_, forceUpdate] = React.useReducer((x) => ~x, 0);
|
||||
const [, forceUpdate] = React.useReducer((x) => ~x, 0);
|
||||
const update = () => forceUpdate();
|
||||
|
||||
const [loading, setLoading] = React.useState(false);
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ export function useDebugInfo(): string {
|
|||
const runtimeInfo = {
|
||||
...debugInfo,
|
||||
timestamp: new Date().toISOString(),
|
||||
reactVersion: require("react").version,
|
||||
reactVersion: "unknown",
|
||||
hasReanimatedError: !!debugInfo.lastReanimatedError,
|
||||
totalErrors: debugInfo.componentMountErrors?.length || 0,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ export abstract class BaseService implements ServiceClient {
|
|||
|
||||
protected async makeRequest(
|
||||
url: string,
|
||||
// eslint-disable-next-line no-undef
|
||||
options: RequestInit = {},
|
||||
): Promise<any> {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ const SettingsOverviewScreen = bunny?.metro?.findByNameLazy(
|
|||
false,
|
||||
);
|
||||
|
||||
/* eslint-disable react/prop-types */
|
||||
function Section({ tabs }) {
|
||||
const navigation = NavigationNative.useNavigation();
|
||||
|
||||
|
|
@ -46,6 +47,7 @@ function Section({ tabs }) {
|
|||
},
|
||||
});
|
||||
}
|
||||
/* eslint-enable react/prop-types */
|
||||
|
||||
function patchPanelUI(tabs, patches) {
|
||||
try {
|
||||
|
|
@ -135,7 +137,7 @@ function patchTabsUI(tabs, patches) {
|
|||
...rendererConfigValue,
|
||||
...row,
|
||||
}),
|
||||
set: (v) => (rendererConfigValue = v),
|
||||
set(v) { rendererConfigValue = v; },
|
||||
});
|
||||
|
||||
const firstRender = Symbol("pinToSettings meow meow");
|
||||
|
|
@ -143,7 +145,7 @@ function patchTabsUI(tabs, patches) {
|
|||
try {
|
||||
if (!createListModule) return;
|
||||
patches.push(
|
||||
after("createList", createListModule, function (args, ret) {
|
||||
after("createList", createListModule, function (args) {
|
||||
if (!args[0][firstRender]) {
|
||||
args[0][firstRender] = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export default function LastFmSettingsPage() {
|
|||
} else {
|
||||
showToast("❌ Last.fm connection failed", getAssetIDByName("XIcon"));
|
||||
}
|
||||
} catch (error) {
|
||||
} catch {
|
||||
showToast("❌ Connection error", getAssetIDByName("XIcon"));
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export default function LibreFmSettingsPage() {
|
|||
} else {
|
||||
showToast("❌ Libre.fm connection failed", getAssetIDByName("XIcon"));
|
||||
}
|
||||
} catch (error) {
|
||||
} catch {
|
||||
showToast("❌ Connection error", getAssetIDByName("XIcon"));
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export default function ListenBrainzSettingsPage() {
|
|||
getAssetIDByName("XIcon"),
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
} catch {
|
||||
showToast("❌ Connection error", getAssetIDByName("XIcon"));
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ export default function RPCPreview() {
|
|||
const [previewTrack, setPreviewTrack] = React.useState<any>(null);
|
||||
const [isLoading, setIsLoading] = React.useState(true);
|
||||
const [currentProgress, setCurrentProgress] = React.useState(0);
|
||||
const [usingFallback, setUsingFallback] = React.useState(false);
|
||||
|
||||
// Fallback preview data
|
||||
const fallbackTrack = {
|
||||
|
|
@ -65,7 +64,6 @@ export default function RPCPreview() {
|
|||
if (!getStorage("username") || !getStorage("apiKey")) {
|
||||
// Use fallback if no credentials
|
||||
setPreviewTrack(fallbackTrack);
|
||||
setUsingFallback(true);
|
||||
setIsLoading(false);
|
||||
return;
|
||||
}
|
||||
|
|
@ -95,7 +93,7 @@ export default function RPCPreview() {
|
|||
if (trackInfo.track && trackInfo.track.duration) {
|
||||
duration = Math.floor(trackInfo.track.duration / 1000);
|
||||
}
|
||||
} catch (error) {
|
||||
} catch {
|
||||
console.log("Could not fetch track duration, using default");
|
||||
}
|
||||
|
||||
|
|
@ -115,17 +113,14 @@ export default function RPCPreview() {
|
|||
? Math.floor(Date.now() / 1000) - 60
|
||||
: null,
|
||||
});
|
||||
setUsingFallback(false);
|
||||
} else {
|
||||
// No tracks found, use fallback
|
||||
setPreviewTrack(fallbackTrack);
|
||||
setUsingFallback(true);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch preview data, using fallback:", error);
|
||||
} catch {
|
||||
console.error("Failed to fetch preview data, using fallback:");
|
||||
// Use fallback on error
|
||||
setPreviewTrack(fallbackTrack);
|
||||
setUsingFallback(true);
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue