aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-10-22 18:18:41 +0200
committerVendicated <vendicated@riseup.net>2022-10-22 18:18:41 +0200
commit61fd38d6d9170a9583c62366a2d4afa40507ce01 (patch)
tree50132ae08fb39b453bca0dbeeae311e12b2528ed
parenta7dbd73547104540218d4699fcf643fca727d2fc (diff)
downloadVencord-61fd38d6d9170a9583c62366a2d4afa40507ce01.tar.gz
Vencord-61fd38d6d9170a9583c62366a2d4afa40507ce01.tar.bz2
Vencord-61fd38d6d9170a9583c62366a2d4afa40507ce01.zip
style: Sort imports
-rw-r--r--.eslintrc.json7
-rw-r--r--src/Vencord.ts13
-rw-r--r--src/VencordNative.ts3
-rw-r--r--src/api/Commands/commandHelpers.ts5
-rw-r--r--src/api/Commands/index.ts4
-rw-r--r--src/api/MessageEvents.ts3
-rw-r--r--src/api/index.ts6
-rw-r--r--src/api/settings.ts3
-rw-r--r--src/components/Monaco.ts5
-rw-r--r--src/components/PluginSettings/components/SettingBooleanComponent.tsx2
-rw-r--r--src/components/PluginSettings/components/SettingNumericComponent.tsx2
-rw-r--r--src/components/PluginSettings/components/SettingSelectComponent.tsx2
-rw-r--r--src/components/PluginSettings/components/SettingSliderComponent.tsx2
-rw-r--r--src/components/PluginSettings/components/SettingTextComponent.tsx2
-rw-r--r--src/components/PluginSettings/components/index.ts2
-rw-r--r--src/components/Updater.tsx9
-rw-r--r--src/components/index.ts2
-rw-r--r--src/ipcMain/constants.ts2
-rw-r--r--src/ipcMain/extensions.ts9
-rw-r--r--src/ipcMain/index.ts9
-rw-r--r--src/ipcMain/updater.ts9
-rw-r--r--src/patchWin32Updater.ts4
-rw-r--r--src/patcher.ts3
-rw-r--r--src/plugins/STFU.ts2
-rw-r--r--src/plugins/anonymiseFileNames.ts2
-rw-r--r--src/plugins/apiCommands.ts2
-rw-r--r--src/plugins/banger.ts2
-rw-r--r--src/plugins/betterUploadButton.ts2
-rw-r--r--src/plugins/clearURLs/index.ts6
-rw-r--r--src/plugins/fxTwitter.ts2
-rw-r--r--src/plugins/interactionKeybinds.ts9
-rw-r--r--src/plugins/moreCommands.ts4
-rw-r--r--src/plugins/muteNewGuild.ts2
-rw-r--r--src/plugins/nitroBypass.ts8
-rw-r--r--src/plugins/noCanaryMessageLinks.ts2
-rw-r--r--src/plugins/noF1.ts2
-rw-r--r--src/plugins/noRPC.ts2
-rw-r--r--src/plugins/noTrack.ts2
-rw-r--r--src/plugins/petpet.ts4
-rw-r--r--src/plugins/pronoundb/components/PronounsChatComponent.tsx7
-rw-r--r--src/plugins/pronoundb/components/PronounsProfileWrapper.tsx4
-rw-r--r--src/plugins/pronoundb/utils.ts3
-rw-r--r--src/plugins/sendify.ts11
-rw-r--r--src/plugins/silentTyping.ts2
-rw-r--r--src/plugins/unindent.ts4
-rw-r--r--src/plugins/unminifyErrors.ts2
-rw-r--r--src/plugins/uwuify.ts2
-rw-r--r--src/plugins/vcDoubleClick.ts2
-rw-r--r--src/plugins/viewIcons.tsx2
-rw-r--r--src/plugins/webhookTags.ts2
-rw-r--r--src/preload.ts7
-rw-r--r--src/utils/discord.ts3
-rw-r--r--src/utils/index.ts10
-rw-r--r--src/utils/updater.ts3
-rw-r--r--src/webpack/common.tsx9
-rw-r--r--src/webpack/index.ts2
-rw-r--r--src/webpack/webpack.ts1
57 files changed, 128 insertions, 109 deletions
diff --git a/.eslintrc.json b/.eslintrc.json
index 7de658b..43e4cef 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -2,7 +2,7 @@
"root": true,
"parser": "@typescript-eslint/parser",
"ignorePatterns": ["dist", "browser"],
- "plugins": ["header"],
+ "plugins": ["header", "simple-import-sort"],
"rules": {
// Since it's only been a month and Vencord has already been stolen
// by random skids who rebranded it to "AlphaCord" and erased all license
@@ -83,6 +83,9 @@
"no-useless-backreference": "error",
"use-isnan": "error",
"prefer-const": "error",
- "prefer-spread": "error"
+ "prefer-spread": "error",
+
+ "simple-import-sort/imports": "error",
+ "simple-import-sort/exports": "error"
}
}
diff --git a/src/Vencord.ts b/src/Vencord.ts
index 80cd405..83cd13a 100644
--- a/src/Vencord.ts
+++ b/src/Vencord.ts
@@ -16,21 +16,22 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-export * as Plugins from "./plugins";
-export * as Webpack from "./webpack";
export * as Api from "./api";
-export * as Updater from "./utils/updater";
-export * as QuickCss from "./utils/quickCss";
+export * as Plugins from "./plugins";
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 { Settings, PlainSettings } from "./api/settings";
+import { PlainSettings,Settings } from "./api/settings";
import { startAllPlugins } from "./plugins";
-export { Settings, PlainSettings };
+export { PlainSettings,Settings };
import "./webpack/patchWebpack";
import "./utils/quickCss";
+
import { checkForUpdates, UpdateLogger } from "./utils/updater";
import { onceReady } from "./webpack";
import { Router } from "./webpack/common";
diff --git a/src/VencordNative.ts b/src/VencordNative.ts
index a3ad095..c984870 100644
--- a/src/VencordNative.ts
+++ b/src/VencordNative.ts
@@ -16,9 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import IPC_EVENTS from "./utils/IpcEvents";
import { IpcRenderer, ipcRenderer } from "electron";
+import IPC_EVENTS from "./utils/IpcEvents";
+
function assertEventAllowed(event: string) {
if (!(event in IPC_EVENTS)) throw new Error(`Event ${event} not allowed.`);
}
diff --git a/src/api/Commands/commandHelpers.ts b/src/api/Commands/commandHelpers.ts
index d8b27df..90b89ed 100644
--- a/src/api/Commands/commandHelpers.ts
+++ b/src/api/Commands/commandHelpers.ts
@@ -16,10 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import { filters, waitFor } from "../../webpack";
-import type { PartialDeep } from "type-fest";
import { Message } from "discord-types/general";
+import type { PartialDeep } from "type-fest";
+
import { lazyWebpack, mergeDefaults } from "../../utils/misc";
+import { filters, waitFor } from "../../webpack";
import { Argument } from "./types";
const createBotMessage = lazyWebpack(filters.byCode('username:"Clyde"'));
diff --git a/src/api/Commands/index.ts b/src/api/Commands/index.ts
index 8384b4a..c7034ab 100644
--- a/src/api/Commands/index.ts
+++ b/src/api/Commands/index.ts
@@ -18,10 +18,10 @@
import { makeCodeblock } from "../../utils/misc";
import { generateId, sendBotMessage } from "./commandHelpers";
-import { ApplicationCommandInputType, ApplicationCommandType, Argument, Command, CommandContext, Option, CommandReturnValue } from "./types";
+import { ApplicationCommandInputType, ApplicationCommandType, Argument, Command, CommandContext, CommandReturnValue,Option } from "./types";
-export * from "./types";
export * from "./commandHelpers";
+export * from "./types";
export let BUILT_IN: Command[];
export const commands = {} as Record<string, Command>;
diff --git a/src/api/MessageEvents.ts b/src/api/MessageEvents.ts
index 25e302b..90e8c73 100644
--- a/src/api/MessageEvents.ts
+++ b/src/api/MessageEvents.ts
@@ -16,7 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import type { Message, Channel } from "discord-types/general";
+import type { Channel,Message } from "discord-types/general";
+
import Logger from "../utils/logger";
const MessageEventsLogger = new Logger("MessageEvents", "#e5c890");
diff --git a/src/api/index.ts b/src/api/index.ts
index 37f0620..73dafc9 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -16,11 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import * as $MessageEventsAPI from "./MessageEvents";
-import * as $Notices from "./Notices";
import * as $Commands from "./Commands";
import * as $DataStore from "./DataStore";
import * as $MessageAccessories from "./MessageAccessories";
+import * as $MessageEventsAPI from "./MessageEvents";
+import * as $Notices from "./Notices";
/**
* An API allowing you to listen to Message Clicks or run your own logic
@@ -58,4 +58,4 @@ const DataStore = $DataStore;
*/
const MessageAccessories = $MessageAccessories;
-export { DataStore, MessageAccessories, MessageEvents, Notices, Commands };
+export { Commands,DataStore, MessageAccessories, MessageEvents, Notices };
diff --git a/src/api/settings.ts b/src/api/settings.ts
index f80f96b..0fdbe13 100644
--- a/src/api/settings.ts
+++ b/src/api/settings.ts
@@ -17,10 +17,11 @@
*/
import plugins from "plugins";
+
import IpcEvents from "../utils/IpcEvents";
-import { React } from "../webpack/common";
import { mergeDefaults } from "../utils/misc";
import { OptionType } from "../utils/types";
+import { React } from "../webpack/common";
export interface Settings {
notifyAboutUpdates: boolean;
diff --git a/src/components/Monaco.ts b/src/components/Monaco.ts
index 6b01891..33f5545 100644
--- a/src/components/Monaco.ts
+++ b/src/components/Monaco.ts
@@ -16,11 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+import monacoHtml from "@fileContent/monacoWin.html";
+
import { IpcEvents } from "../utils";
import { debounce } from "../utils/debounce";
-import { find } from "../webpack/webpack";
-import monacoHtml from "@fileContent/monacoWin.html";
import { Queue } from "../utils/Queue";
+import { find } from "../webpack/webpack";
const queue = new Queue();
const setCss = debounce((css: string) => {
diff --git a/src/components/PluginSettings/components/SettingBooleanComponent.tsx b/src/components/PluginSettings/components/SettingBooleanComponent.tsx
index da5827b..99c1eae 100644
--- a/src/components/PluginSettings/components/SettingBooleanComponent.tsx
+++ b/src/components/PluginSettings/components/SettingBooleanComponent.tsx
@@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import { ISettingElementProps } from ".";
import { PluginOptionBoolean } from "../../../utils/types";
import { Forms, React, Select } from "../../../webpack/common";
+import { ISettingElementProps } from ".";
export function SettingBooleanComponent({ option, pluginSettings, id, onChange, onError }: ISettingElementProps<PluginOptionBoolean>) {
const def = pluginSettings[id] ?? option.default;
diff --git a/src/components/PluginSettings/components/SettingNumericComponent.tsx b/src/components/PluginSettings/components/SettingNumericComponent.tsx
index e154f67..01e72dc 100644
--- a/src/components/PluginSettings/components/SettingNumericComponent.tsx
+++ b/src/components/PluginSettings/components/SettingNumericComponent.tsx
@@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import { ISettingElementProps } from ".";
import { OptionType, PluginOptionNumber } from "../../../utils/types";
import { Forms, 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 3889c8e..ce35675 100644
--- a/src/components/PluginSettings/components/SettingSelectComponent.tsx
+++ b/src/components/PluginSettings/components/SettingSelectComponent.tsx
@@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import { ISettingElementProps } from ".";
import { PluginOptionSelect } from "../../../utils/types";
import { Forms, React, Select } from "../../../webpack/common";
+import { ISettingElementProps } from ".";
export function SettingSelectComponent({ option, pluginSettings, onChange, onError, id }: ISettingElementProps<PluginOptionSelect>) {
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 3910e8b..ff1c491 100644
--- a/src/components/PluginSettings/components/SettingSliderComponent.tsx
+++ b/src/components/PluginSettings/components/SettingSliderComponent.tsx
@@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import { ISettingElementProps } from ".";
import { PluginOptionSlider } from "../../../utils/types";
import { Forms, React, Slider } from "../../../webpack/common";
+import { ISettingElementProps } from ".";
export function makeRange(start: number, end: number, step = 1) {
const ranges: number[] = [];
diff --git a/src/components/PluginSettings/components/SettingTextComponent.tsx b/src/components/PluginSettings/components/SettingTextComponent.tsx
index 97bbd99..216a2a1 100644
--- a/src/components/PluginSettings/components/SettingTextComponent.tsx
+++ b/src/components/PluginSettings/components/SettingTextComponent.tsx
@@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import { ISettingElementProps } from ".";
import { PluginOptionString } from "../../../utils/types";
import { Forms, React, TextInput } from "../../../webpack/common";
+import { ISettingElementProps } from ".";
export function SettingInputComponent({ option, pluginSettings, id, onChange, onError }: ISettingElementProps<PluginOptionString>) {
const [state, setState] = React.useState(pluginSettings[id] ?? option.default ?? null);
diff --git a/src/components/PluginSettings/components/index.ts b/src/components/PluginSettings/components/index.ts
index 6da4140..1712987 100644
--- a/src/components/PluginSettings/components/index.ts
+++ b/src/components/PluginSettings/components/index.ts
@@ -32,5 +32,5 @@ export interface ISettingElementProps<T extends PluginOptionBase> {
export * from "./SettingBooleanComponent";
export * from "./SettingNumericComponent";
export * from "./SettingSelectComponent";
-export * from "./SettingTextComponent";
export * from "./SettingSliderComponent";
+export * from "./SettingTextComponent";
diff --git a/src/components/Updater.tsx b/src/components/Updater.tsx
index f4dedd7..21ae6a3 100644
--- a/src/components/Updater.tsx
+++ b/src/components/Updater.tsx
@@ -17,13 +17,14 @@
*/
import gitHash from "git-hash";
-import { changes, checkForUpdates, getRepo, rebuild, update, UpdateLogger, updateError, isOutdated, isNewer } from "../utils/updater";
-import { React, Forms, Button, Margins, Alerts, Card, Parser, Toasts } from "../webpack/common";
-import { Flex } from "./Flex";
+
import { classes, useAwaiter } from "../utils/misc";
-import { Link } from "./Link";
+import { changes, checkForUpdates, getRepo, isNewer,isOutdated, rebuild, update, updateError, UpdateLogger } from "../utils/updater";
+import { Alerts, Button, Card, Forms, Margins, Parser, React, Toasts } from "../webpack/common";
import ErrorBoundary from "./ErrorBoundary";
import { ErrorCard } from "./ErrorCard";
+import { Flex } from "./Flex";
+import { Link } from "./Link";
function withDispatcher(dispatcher: React.Dispatch<React.SetStateAction<boolean>>, action: () => any) {
return async () => {
diff --git a/src/components/index.ts b/src/components/index.ts
index 30dcea2..6f7ffba 100644
--- a/src/components/index.ts
+++ b/src/components/index.ts
@@ -16,6 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-export { default as Settings } from "./Settings";
export { default as PluginSettings } from "./PluginSettings";
+export { default as Settings } from "./Settings";
export { default as Updater } from "./Updater";
diff --git a/src/ipcMain/constants.ts b/src/ipcMain/constants.ts
index 18726fc..7133757 100644
--- a/src/ipcMain/constants.ts
+++ b/src/ipcMain/constants.ts
@@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import { join } from "path";
import { app } from "electron";
+import { join } from "path";
export const DATA_DIR = process.env.VENCORD_USER_DATA_DIR ?? (
process.env.DISCORD_USER_DATA_DIR
diff --git a/src/ipcMain/extensions.ts b/src/ipcMain/extensions.ts
index 9bebdaf..d676f22 100644
--- a/src/ipcMain/extensions.ts
+++ b/src/ipcMain/extensions.ts
@@ -16,13 +16,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import https from "https";
-import { mkdir, rm, writeFile, access } from "fs/promises";
+import { session } from "electron";
+import { unzip } from "fflate";
import { constants as fsConstants } from "fs";
+import { access,mkdir, rm, writeFile } from "fs/promises";
+import https from "https";
import { join } from "path";
+
import { DATA_DIR } from "./constants";
-import { unzip } from "fflate";
-import { session } from "electron";
import { crxToZip } from "./crxToZip";
const extensionCacheDir = join(DATA_DIR, "ExtensionCache");
diff --git a/src/ipcMain/index.ts b/src/ipcMain/index.ts
index d815142..958728a 100644
--- a/src/ipcMain/index.ts
+++ b/src/ipcMain/index.ts
@@ -16,17 +16,18 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+import "./updater";
+
+import monacoHtml from "@fileContent/../components/monacoWin.html;base64";
import { app, BrowserWindow, desktopCapturer, ipcMain, shell } from "electron";
import { mkdirSync, readFileSync, watch } from "fs";
import { open, readFile, writeFile } from "fs/promises";
import { join } from "path";
+
import { debounce } from "../utils/debounce";
import IpcEvents from "../utils/IpcEvents";
-import monacoHtml from "@fileContent/../components/monacoWin.html;base64";
-
-import "./updater";
import { Queue } from "../utils/Queue";
-import { QUICKCSS_PATH, ALLOWED_PROTOCOLS, SETTINGS_DIR, SETTINGS_FILE } from "./constants";
+import { ALLOWED_PROTOCOLS, QUICKCSS_PATH, SETTINGS_DIR, SETTINGS_FILE } from "./constants";
diff --git a/src/ipcMain/updater.ts b/src/ipcMain/updater.ts
index a1da8a7..6987916 100644
--- a/src/ipcMain/updater.ts
+++ b/src/ipcMain/updater.ts
@@ -16,13 +16,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+import { execFile as cpExecFile } from "child_process";
+import { createHash } from "crypto";
import { ipcMain } from "electron";
+import { createReadStream } from "fs";
+import { join } from "path";
import { promisify } from "util";
+
import IpcEvents from "../utils/IpcEvents";
-import { execFile as cpExecFile } from "child_process";
-import { join } from "path";
-import { createReadStream } from "fs";
-import { createHash } from "crypto";
const VENCORD_SRC_DIR = join(__dirname, "..");
diff --git a/src/patchWin32Updater.ts b/src/patchWin32Updater.ts
index 2044615..e853ebf 100644
--- a/src/patchWin32Updater.ts
+++ b/src/patchWin32Updater.ts
@@ -17,8 +17,8 @@
*/
import { app, autoUpdater } from "electron";
-import { dirname, basename, join } from "path";
-import { readdirSync, existsSync, mkdirSync, writeFileSync } from "fs";
+import { existsSync, mkdirSync, readdirSync, writeFileSync } from "fs";
+import { basename, dirname, join } from "path";
const { setAppUserModelId } = app;
diff --git a/src/patcher.ts b/src/patcher.ts
index 14f0812..542fba5 100644
--- a/src/patcher.ts
+++ b/src/patcher.ts
@@ -17,11 +17,12 @@
*/
import electron, { app, BrowserWindowConstructorOptions } from "electron";
+import { readFileSync } from "fs";
import { dirname, join } from "path";
+
import { initIpc } from "./ipcMain";
import { installExt } from "./ipcMain/extensions";
import { readSettings } from "./ipcMain/index";
-import { readFileSync } from "fs";
console.log("[Vencord] Starting up...");
diff --git a/src/plugins/STFU.ts b/src/plugins/STFU.ts
index cfc207a..66392c8 100644
--- a/src/plugins/STFU.ts
+++ b/src/plugins/STFU.ts
@@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import definePlugin from "../utils/types";
import { Devs } from "../utils/constants";
+import definePlugin from "../utils/types";
export default definePlugin({
name: "STFU",
diff --git a/src/plugins/anonymiseFileNames.ts b/src/plugins/anonymiseFileNames.ts
index e689a6d..5bae10a 100644
--- a/src/plugins/anonymiseFileNames.ts
+++ b/src/plugins/anonymiseFileNames.ts
@@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import definePlugin, { O