From c3da99eeeedd11b00d612a1ea7934353e9c812c3 Mon Sep 17 00:00:00 2001 From: Rie Takahashi Date: Mon, 24 Oct 2022 18:43:06 +0100 Subject: [PATCH] linting and stuff --- src/components/PluginSettings/PluginModal.tsx | 5 +++-- .../components/SettingBooleanComponent.tsx | 4 +++- .../components/SettingNumericComponent.tsx | 4 +++- .../components/SettingSelectComponent.tsx | 2 +- .../components/SettingSliderComponent.tsx | 4 +++- .../components/SettingTextComponent.tsx | 4 +++- src/components/PluginSettings/index.tsx | 1 + src/components/Settings.tsx | 18 ++++++++++-------- src/components/Updater.tsx | 4 +++- src/plugins/experiments.tsx | 6 ++++-- .../components/PronounsAboutComponent.tsx | 4 +++- src/webpack/components/Forms.tsx | 18 ++++++++++++++++++ src/webpack/components/Select.tsx | 18 ++++++++++++++++++ src/webpack/components/Toasts.tsx | 18 ++++++++++++++++++ src/webpack/components/index.ts | 19 ++++++++++++++++++- 15 files changed, 109 insertions(+), 20 deletions(-) diff --git a/src/components/PluginSettings/PluginModal.tsx b/src/components/PluginSettings/PluginModal.tsx index 908876f8..f8dcdeaf 100644 --- a/src/components/PluginSettings/PluginModal.tsx +++ b/src/components/PluginSettings/PluginModal.tsx @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +import { Forms } from "@components"; import { User } from "discord-types/general"; import { Constructor } from "type-fest"; @@ -25,7 +26,7 @@ import { lazyWebpack, proxyLazy } from "../../utils"; import { ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from "../../utils/modal"; import { OptionType, Plugin } from "../../utils/types"; import { filters } from "../../webpack"; -import { Button, FluxDispatcher, Forms, React, Text, Tooltip, UserStore, UserUtils } from "../../webpack/common"; +import { Button, FluxDispatcher, React, Text, Tooltip, UserStore, UserUtils } from "../../webpack/common"; import ErrorBoundary from "../ErrorBoundary"; import { Flex } from "../Flex"; import { @@ -33,7 +34,7 @@ import { SettingInputComponent, SettingNumericComponent, SettingSelectComponent, - SettingSliderComponent, + SettingSliderComponent } from "./components"; const UserSummaryItem = lazyWebpack(filters.byCode("defaultRenderUser", "showDefaultAvatarsForNullUsers")); diff --git a/src/components/PluginSettings/components/SettingBooleanComponent.tsx b/src/components/PluginSettings/components/SettingBooleanComponent.tsx index 99c1eae8..a54a81e1 100644 --- a/src/components/PluginSettings/components/SettingBooleanComponent.tsx +++ b/src/components/PluginSettings/components/SettingBooleanComponent.tsx @@ -16,8 +16,10 @@ * along with this program. If not, see . */ +import { Forms } from "@components"; + import { PluginOptionBoolean } from "../../../utils/types"; -import { Forms, React, Select } from "../../../webpack/common"; +import { React, Select } from "../../../webpack/common"; import { ISettingElementProps } from "."; export function SettingBooleanComponent({ option, pluginSettings, id, onChange, onError }: ISettingElementProps) { diff --git a/src/components/PluginSettings/components/SettingNumericComponent.tsx b/src/components/PluginSettings/components/SettingNumericComponent.tsx index 01e72dc7..eb6e2476 100644 --- a/src/components/PluginSettings/components/SettingNumericComponent.tsx +++ b/src/components/PluginSettings/components/SettingNumericComponent.tsx @@ -16,8 +16,10 @@ * along with this program. If not, see . */ +import { Forms } from "@components"; + import { OptionType, PluginOptionNumber } from "../../../utils/types"; -import { Forms, React, TextInput } from "../../../webpack/common"; +import { React, TextInput } from "../../../webpack/common"; import { ISettingElementProps } from "."; const MAX_SAFE_NUMBER = BigInt(Number.MAX_SAFE_INTEGER); diff --git a/src/components/PluginSettings/components/SettingSelectComponent.tsx b/src/components/PluginSettings/components/SettingSelectComponent.tsx index 430e62a1..d0943c20 100644 --- a/src/components/PluginSettings/components/SettingSelectComponent.tsx +++ b/src/components/PluginSettings/components/SettingSelectComponent.tsx @@ -19,9 +19,9 @@ import { FormSection, FormText, FormTitle } from "@components/Forms"; import Select from "@components/Select"; -import { ISettingElementProps } from "."; import { PluginOptionSelect } from "../../../utils/types"; import { React } from "../../../webpack/common"; +import { ISettingElementProps } from "."; export function SettingSelectComponent({ option, pluginSettings, onChange, onError, id }: ISettingElementProps) { const def = pluginSettings[id] ?? option.options?.find(o => o.default)?.value; diff --git a/src/components/PluginSettings/components/SettingSliderComponent.tsx b/src/components/PluginSettings/components/SettingSliderComponent.tsx index ff1c491d..cb2d1fd8 100644 --- a/src/components/PluginSettings/components/SettingSliderComponent.tsx +++ b/src/components/PluginSettings/components/SettingSliderComponent.tsx @@ -16,8 +16,10 @@ * along with this program. If not, see . */ +import { Forms } from "@components"; + import { PluginOptionSlider } from "../../../utils/types"; -import { Forms, React, Slider } from "../../../webpack/common"; +import { React, Slider } from "../../../webpack/common"; import { ISettingElementProps } from "."; export function makeRange(start: number, end: number, step = 1) { diff --git a/src/components/PluginSettings/components/SettingTextComponent.tsx b/src/components/PluginSettings/components/SettingTextComponent.tsx index 216a2a17..8f7fadb7 100644 --- a/src/components/PluginSettings/components/SettingTextComponent.tsx +++ b/src/components/PluginSettings/components/SettingTextComponent.tsx @@ -16,8 +16,10 @@ * along with this program. If not, see . */ +import { Forms } from "@components"; + import { PluginOptionString } from "../../../utils/types"; -import { Forms, React, TextInput } from "../../../webpack/common"; +import { React, TextInput } from "../../../webpack/common"; import { ISettingElementProps } from "."; export function SettingInputComponent({ option, pluginSettings, id, onChange, onError }: ISettingElementProps) { diff --git a/src/components/PluginSettings/index.tsx b/src/components/PluginSettings/index.tsx index 1a05c9ea..bf318cc0 100644 --- a/src/components/PluginSettings/index.tsx +++ b/src/components/PluginSettings/index.tsx @@ -17,6 +17,7 @@ */ import { FormDivider, FormSection, FormText, FormTitle } from "@components/Forms"; + import Plugins from "~plugins"; import { showNotice } from "../../api/Notices"; diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index e720c6fb..a3e57001 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -16,11 +16,13 @@ * along with this program. If not, see . */ +import { FormDivider, FormSection, FormText, FormTitle } from "@components/Forms"; + import { useSettings } from "../api/settings"; import { ChangeList } from "../utils/ChangeList"; import IpcEvents from "../utils/IpcEvents"; import { useAwaiter } from "../utils/misc"; -import { Alerts, Button, Forms, Margins, Parser, React, Switch } from "../webpack/common"; +import { Alerts, Button, Margins, Parser, React, Switch } from "../webpack/common"; import ErrorBoundary from "./ErrorBoundary"; import { Flex } from "./Flex"; import { launchMonacoEditor } from "./Monaco"; @@ -51,14 +53,14 @@ export default ErrorBoundary.wrap(function Settings() { }, []); return ( - - + + Settings - + - + Settings Directory: {settingsDir} - + {!IS_WEB &&