diff options
author | Vendicated <vendicated@riseup.net> | 2022-11-07 23:34:14 +0100 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-11-07 23:34:14 +0100 |
commit | f7d9be91407582fd85a70eef89c03a32e37c3c0f (patch) | |
tree | 6522f99d70491aa7f495c287a53fc02c736517ac /src | |
parent | 955573d31bd1be435b95ddcc24971b47daf02c0b (diff) | |
download | Vencord-f7d9be91407582fd85a70eef89c03a32e37c3c0f.tar.gz Vencord-f7d9be91407582fd85a70eef89c03a32e37c3c0f.tar.bz2 Vencord-f7d9be91407582fd85a70eef89c03a32e37c3c0f.zip |
lint: Disallow utils index imports
This keeps leading to issues due to circular imports.
Import from specific files instead, index just reexports
Diffstat (limited to 'src')
-rw-r--r-- | src/Vencord.ts | 11 | ||||
-rw-r--r-- | src/components/ErrorBoundary.tsx | 2 | ||||
-rw-r--r-- | src/components/Monaco.ts | 2 | ||||
-rw-r--r-- | src/components/PatchHelper.tsx | 2 | ||||
-rw-r--r-- | src/components/PluginSettings/PluginModal.tsx | 3 | ||||
-rw-r--r-- | src/components/PluginSettings/index.tsx | 5 | ||||
-rw-r--r-- | src/plugins/experiments.tsx | 2 | ||||
-rw-r--r-- | src/plugins/ignoreActivities.ts | 2 | ||||
-rw-r--r-- | src/plugins/messageActions.ts | 2 | ||||
-rw-r--r-- | src/plugins/nitroBypass.ts | 2 | ||||
-rw-r--r-- | src/plugins/petpet.ts | 2 | ||||
-rw-r--r-- | src/plugins/pronoundb/components/PronounsChatComponent.tsx | 2 | ||||
-rw-r--r-- | src/plugins/pronoundb/components/PronounsProfileWrapper.tsx | 4 | ||||
-rw-r--r-- | src/plugins/pronoundb/pronoundbUtils.ts (renamed from src/plugins/pronoundb/utils.ts) | 0 | ||||
-rw-r--r-- | src/plugins/sendify.ts | 2 | ||||
-rw-r--r-- | src/plugins/spotifyControls/PlayerComponent.tsx | 3 | ||||
-rw-r--r-- | src/plugins/spotifyControls/SpotifyStore.ts | 4 | ||||
-rw-r--r-- | src/plugins/startupTimings/StartupTimingPage.tsx | 4 | ||||
-rw-r--r-- | src/plugins/startupTimings/index.tsx | 2 |
19 files changed, 30 insertions, 26 deletions
diff --git a/src/Vencord.ts b/src/Vencord.ts index 041335f..464be2d 100644 --- a/src/Vencord.ts +++ b/src/Vencord.ts @@ -18,20 +18,19 @@ export * as Api from "./api"; export * as Plugins from "./plugins"; +// eslint-disable-next-line @typescript-eslint/no-restricted-imports export * as Util from "./utils"; export * as QuickCss from "./utils/quickCss"; export * as Updater from "./utils/updater"; export * as Webpack from "./webpack"; - -import { popNotice, showNotice } from "./api/Notices"; -import { PlainSettings, Settings } from "./api/settings"; -import { patches, PMLogger, startAllPlugins } from "./plugins"; - export { PlainSettings, Settings }; -import "./webpack/patchWebpack"; import "./utils/quickCss"; +import "./webpack/patchWebpack"; +import { popNotice, showNotice } from "./api/Notices"; +import { PlainSettings, Settings } from "./api/settings"; +import { patches, PMLogger, startAllPlugins } from "./plugins"; import { checkForUpdates, UpdateLogger } from "./utils/updater"; import { onceReady } from "./webpack"; import { Router } from "./webpack/common"; diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx index aa1e889..4c2725d 100644 --- a/src/components/ErrorBoundary.tsx +++ b/src/components/ErrorBoundary.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { LazyComponent } from "../utils"; import Logger from "../utils/logger"; +import { LazyComponent } from "../utils/misc"; import { Margins, React } from "../webpack/common"; import { ErrorCard } from "./ErrorCard"; diff --git a/src/components/Monaco.ts b/src/components/Monaco.ts index f40db77..16eff85 100644 --- a/src/components/Monaco.ts +++ b/src/components/Monaco.ts @@ -18,8 +18,8 @@ import monacoHtml from "~fileContent/monacoWin.html"; -import { IpcEvents } from "../utils"; import { debounce } from "../utils/debounce"; +import IpcEvents from "../utils/IpcEvents"; import { Queue } from "../utils/Queue"; import { find } from "../webpack/webpack"; diff --git a/src/components/PatchHelper.tsx b/src/components/PatchHelper.tsx index f32201a..82b804a 100644 --- a/src/components/PatchHelper.tsx +++ b/src/components/PatchHelper.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { makeCodeblock } from "../utils"; import { debounce } from "../utils/debounce"; +import { makeCodeblock } from "../utils/misc"; import { Button, Clipboard, Forms, Margins, Parser, React, Switch, TextInput } from "../webpack/common"; import { search } from "../webpack/webpack"; import { CheckedTextInput } from "./CheckedTextInput"; diff --git a/src/components/PluginSettings/PluginModal.tsx b/src/components/PluginSettings/PluginModal.tsx index 7dd609f..592b6cb 100644 --- a/src/components/PluginSettings/PluginModal.tsx +++ b/src/components/PluginSettings/PluginModal.tsx @@ -21,8 +21,9 @@ import { Constructor } from "type-fest"; import { generateId } from "../../api/Commands"; import { useSettings } from "../../api/settings"; -import { LazyComponent, lazyWebpack, proxyLazy } from "../../utils"; +import { LazyComponent, lazyWebpack } from "../../utils/misc"; import { ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from "../../utils/modal"; +import { proxyLazy } from "../../utils/proxyLazy"; import { OptionType, Plugin } from "../../utils/types"; import { filters, findByCode } from "../../webpack"; import { Button, FluxDispatcher, Forms, React, Text, Tooltip, UserStore, UserUtils } from "../../webpack/common"; diff --git a/src/components/PluginSettings/index.tsx b/src/components/PluginSettings/index.tsx index 40f09d6..fef8c30 100644 --- a/src/components/PluginSettings/index.tsx +++ b/src/components/PluginSettings/index.tsx @@ -21,9 +21,10 @@ import Plugins from "~plugins"; import { showNotice } from "../../api/Notices"; import { Settings, useSettings } from "../../api/settings"; import { startDependenciesRecursive, startPlugin, stopPlugin } from "../../plugins"; -import { Logger, Modals } from "../../utils"; import { ChangeList } from "../../utils/ChangeList"; +import Logger from "../../utils/logger"; import { classes, LazyComponent, lazyWebpack } from "../../utils/misc"; +import { openModalLazy } from "../../utils/modal"; import { Plugin } from "../../utils/types"; import { filters, findByCode } from "../../webpack"; import { Alerts, Button, Forms, Margins, Parser, React, Select, Switch, Text, TextInput, Toasts, Tooltip } from "../../webpack/common"; @@ -88,7 +89,7 @@ function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, onMouseLe } function openModal() { - Modals.openModalLazy(async () => { + openModalLazy(async () => { return modalProps => { return <PluginModal {...modalProps} plugin={plugin} onRestartNeeded={() => onRestartNeeded(plugin.name)} />; }; diff --git a/src/plugins/experiments.tsx b/src/plugins/experiments.tsx index b9df6f9..861bb05 100644 --- a/src/plugins/experiments.tsx +++ b/src/plugins/experiments.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { lazyWebpack } from "../utils"; import { Devs } from "../utils/constants"; +import { lazyWebpack } from "../utils/misc"; import definePlugin, { OptionType } from "../utils/types"; import { Settings } from "../Vencord"; import { filters } from "../webpack"; diff --git a/src/plugins/ignoreActivities.ts b/src/plugins/ignoreActivities.ts index 5c1ddcc..2084277 100644 --- a/src/plugins/ignoreActivities.ts +++ b/src/plugins/ignoreActivities.ts @@ -17,8 +17,8 @@ */ import { DataStore } from "../api"; -import { lazyWebpack } from "../utils"; import { Devs } from "../utils/constants"; +import { lazyWebpack } from "../utils/misc"; import definePlugin from "../utils/types"; import { filters } from "../webpack"; diff --git a/src/plugins/messageActions.ts b/src/plugins/messageActions.ts index 98c920e..bb2ad17 100644 --- a/src/plugins/messageActions.ts +++ b/src/plugins/messageActions.ts @@ -17,8 +17,8 @@ */ import { addClickListener, removeClickListener } from "../api/MessageEvents"; -import { lazyWebpack } from "../utils"; import { Devs } from "../utils/constants"; +import { lazyWebpack } from "../utils/misc"; import definePlugin from "../utils/types"; import { filters } from "../webpack"; import { UserStore } from "../webpack/common"; diff --git a/src/plugins/nitroBypass.ts b/src/plugins/nitroBypass.ts index f4bdc84..d2e1e10 100644 --- a/src/plugins/nitroBypass.ts +++ b/src/plugins/nitroBypass.ts @@ -17,9 +17,9 @@ */ import { addPreEditListener, addPreSendListener, removePreEditListener, removePreSendListener } from "../api/MessageEvents"; -import { lazyWebpack } from "../utils"; import { Devs } from "../utils/constants"; import { ApngDisposeOp, getGifEncoder, importApngJs } from "../utils/dependencies"; +import { lazyWebpack } from "../utils/misc"; import definePlugin, { OptionType } from "../utils/types"; import { Settings } from "../Vencord"; import { filters } from "../webpack"; diff --git a/src/plugins/petpet.ts b/src/plugins/petpet.ts index 961d47a..59b4e56 100644 --- a/src/plugins/petpet.ts +++ b/src/plugins/petpet.ts @@ -17,9 +17,9 @@ */ import { ApplicationCommandInputType, ApplicationCommandOptionType, Argument, CommandContext, findOption } from "../api/Commands"; -import { lazyWebpack, makeLazy } from "../utils"; import { Devs } from "../utils/constants"; import { getGifEncoder } from "../utils/dependencies"; +import { lazyWebpack, makeLazy } from "../utils/misc"; import definePlugin from "../utils/types"; import { filters } from "../webpack"; diff --git a/src/plugins/pronoundb/components/PronounsChatComponent.tsx b/src/plugins/pronoundb/components/PronounsChatComponent.tsx index 2d20461..78cee48 100644 --- a/src/plugins/pronoundb/components/PronounsChatComponent.tsx +++ b/src/plugins/pronoundb/components/PronounsChatComponent.tsx @@ -22,8 +22,8 @@ import { classes, lazyWebpack, useAwaiter } from "../../../utils/misc"; import { Settings } from "../../../Vencord"; import { filters } from "../../../webpack"; import { UserStore } from "../../../webpack/common"; +import { fetchPronouns, formatPronouns } from "../pronoundbUtils"; import { PronounMapping } from "../types"; -import { fetchPronouns, formatPronouns } from "../utils"; const styles: Record<string, string> = lazyWebpack(filters.byProps("timestampInline")); diff --git a/src/plugins/pronoundb/components/PronounsProfileWrapper.tsx b/src/plugins/pronoundb/components/PronounsProfileWrapper.tsx index 3f0022e..4d12dd5 100644 --- a/src/plugins/pronoundb/components/PronounsProfileWrapper.tsx +++ b/src/plugins/pronoundb/components/PronounsProfileWrapper.tsx @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { useAwaiter } from "../../../utils"; +import { useAwaiter } from "../../../utils/misc"; import { Settings } from "../../../Vencord"; import { UserStore } from "../../../webpack/common"; +import { fetchPronouns, formatPronouns } from "../pronoundbUtils"; import { PronounMapping, UserProfileProps } from "../types"; -import { fetchPronouns, formatPronouns } from "../utils"; export default function PronounsProfileWrapper(props: UserProfileProps, pronounsComponent: JSX.Element) { // Don't bother fetching bot or system users diff --git a/src/plugins/pronoundb/utils.ts b/src/plugins/pronoundb/pronoundbUtils.ts index 73ec7b6..73ec7b6 100644 --- a/src/plugins/pronoundb/utils.ts +++ b/src/plugins/pronoundb/pronoundbUtils.ts diff --git a/src/plugins/sendify.ts b/src/plugins/sendify.ts index 40836ad..b0fd52d 100644 --- a/src/plugins/sendify.ts +++ b/src/plugins/sendify.ts @@ -17,8 +17,8 @@ */ import { ApplicationCommandInputType, sendBotMessage } from "../api/Commands"; -import { lazyWebpack } from "../utils"; import { Devs } from "../utils/constants"; +import { lazyWebpack } from "../utils/misc"; import definePlugin from "../utils/types"; import { filters } from "../webpack"; import { FluxDispatcher } from "../webpack/common"; diff --git a/src/plugins/spotifyControls/PlayerComponent.tsx b/src/plugins/spotifyControls/PlayerComponent.tsx index 0e03121..15a7ef9 100644 --- a/src/plugins/spotifyControls/PlayerComponent.tsx +++ b/src/plugins/spotifyControls/PlayerComponent.tsx @@ -18,7 +18,8 @@ import ErrorBoundary from "../../components/ErrorBoundary"; import { Flex } from "../../components/Flex"; -import { classes, debounce, LazyComponent, lazyWebpack } from "../../utils"; +import { debounce } from "../../utils/debounce"; +import { classes, LazyComponent, lazyWebpack } from "../../utils/misc"; import { ContextMenu, FluxDispatcher, Forms, Menu, React, Tooltip } from "../../webpack/common"; import { filters, find } from "../../webpack/webpack"; import { SpotifyStore, Track } from "./SpotifyStore"; diff --git a/src/plugins/spotifyControls/SpotifyStore.ts b/src/plugins/spotifyControls/SpotifyStore.ts index d7d52bc..0dad503 100644 --- a/src/plugins/spotifyControls/SpotifyStore.ts +++ b/src/plugins/spotifyControls/SpotifyStore.ts @@ -18,7 +18,9 @@ import cssText from "~fileContent/styles.css"; -import { IpcEvents, lazyWebpack, proxyLazy } from "../../utils"; +import IpcEvents from "../../utils/IpcEvents"; +import { lazyWebpack } from "../../utils/misc"; +import { proxyLazy } from "../../utils/proxyLazy"; import { filters } from "../../webpack"; import { Flux, FluxDispatcher } from "../../webpack/common"; diff --git a/src/plugins/startupTimings/StartupTimingPage.tsx b/src/plugins/startupTimings/StartupTimingPage.tsx index f864138..7d8e86b 100644 --- a/src/plugins/startupTimings/StartupTimingPage.tsx +++ b/src/plugins/startupTimings/StartupTimingPage.tsx @@ -18,9 +18,9 @@ import ErrorBoundary from "../../components/ErrorBoundary"; import { Flex } from "../../components/Flex"; -import { lazyWebpack } from "../../utils"; -import { filters } from "../../webpack"; +import { lazyWebpack } from "../../utils/misc"; import { Forms, React } from "../../webpack/common"; +import { filters } from "../../webpack/webpack"; interface AppStartPerformance { prefix: string; diff --git a/src/plugins/startupTimings/index.tsx b/src/plugins/startupTimings/index.tsx index 3f121f7..d5493c1 100644 --- a/src/plugins/startupTimings/index.tsx +++ b/src/plugins/startupTimings/index.tsx @@ -17,8 +17,8 @@ */ -import { LazyComponent } from "../../utils"; import { Devs } from "../../utils/constants"; +import { LazyComponent } from "../../utils/misc"; import definePlugin from "../../utils/types"; export default definePlugin({ |