This commit is contained in:
thororen1234 2024-08-03 00:24:47 -04:00
parent 6dca8bca13
commit b8a4dff851
15 changed files with 26 additions and 33 deletions

View file

@ -7,7 +7,6 @@
// @ts-check
import stylistic from "@stylistic/eslint-plugin";
import pathAlias from "eslint-plugin-path-alias";
import header from "eslint-plugin-simple-header";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import unusedImports from "eslint-plugin-unused-imports";
@ -23,7 +22,6 @@ export default tseslint.config(
"@typescript-eslint": tseslint.plugin,
"simple-import-sort": simpleImportSort,
"unused-imports": unusedImports,
"path-alias": pathAlias,
},
settings: {
"import/resolver": {
@ -120,7 +118,6 @@ export default tseslint.config(
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"unused-imports/no-unused-imports": "error",
"path-alias/no-relative": "error"
}
}
);

View file

@ -20,7 +20,7 @@ import "../suppressExperimentalWarnings.js";
import "../checkNodeVersion.js";
import { exec, execSync } from "child_process";
import esbuild, { build, BuildOptions, context, Plugin } from "esbuild";
import esbuild, { build, BuildOptions, Plugin } from "esbuild";
import { constants as FsConstants, readFileSync } from "fs";
import { access, readdir, readFile } from "fs/promises";
import { minify as minifyHtml } from "html-minifier-terser";

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { classNameFactory } from "@api/Styles";
import ErrorBoundary from "@components/ErrorBoundary";
import { findComponentByCodeLazy } from "@webpack";
import { moment, React, useMemo } from "@webpack/common";

View file

@ -4,8 +4,6 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
/* eslint-disable arrow-parens */
import * as DataStore from "@api/DataStore";
import { Flex } from "@components/Flex";
import { DeleteIcon, PlusIcon } from "@components/Icons";
@ -107,12 +105,12 @@ export default function ({
id: "all",
sources: [...colorwayData, ...customColorwayData]
},
...colorwayData.map((source) => ({
...colorwayData.map(source => ({
name: source.source,
id: source.source.toLowerCase().replaceAll(" ", "-"),
sources: [source]
})),
...customColorwayData.map((source) => ({
...customColorwayData.map(source => ({
name: source.source,
id: source.source.toLowerCase().replaceAll(" ", "-"),
sources: [source]
@ -147,7 +145,7 @@ export default function ({
const onlineSources: { name: string, url: string; }[] = await DataStore.get("colorwaySourceFiles") as { name: string, url: string; }[];
const responses: Response[] = await Promise.all(
onlineSources.map((source) =>
onlineSources.map(source =>
fetch(source.url, force ? { cache: "no-store" } : {})
)
);
@ -309,7 +307,7 @@ export default function ({
style={{ marginLeft: "8px" }}
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
onClick={() => openModal((props) => <CreatorModal
onClick={() => openModal(props => <CreatorModal
modalProps={props}
loadUIProps={loadUI}
/>)}
@ -350,7 +348,7 @@ export default function ({
id="colorway-opencolorstealer"
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
onClick={() => openModal((props) => <ColorPickerModal modalProps={props} />)}
onClick={() => openModal(props => <ColorPickerModal modalProps={props} />)}
>
<PalleteIcon width={20} height={20} style={{ padding: "6px", boxSizing: "content-box" }} />
</Button>}
@ -469,7 +467,7 @@ export default function ({
{(showLabelsInSelectorGridView || viewMode === "list") && <Text className={"colorwayLabel" + ((showLabelsInSelectorGridView && viewMode === "grid") ? " labelInGrid" : "")}>Auto</Text>}
<div
className="colorwayInfoIconContainer"
onClick={async (e) => {
onClick={async e => {
e.stopPropagation();
const activeAutoPreset = await DataStore.get("activeAutoPreset");
openModal((props: ModalProps) => <AutoColorwaySelector autoColorwayId={activeAutoPreset} modalProps={props} onChange={autoPresetId => {
@ -591,7 +589,7 @@ export default function ({
{activeColorwayObject.id === color.name && activeColorwayObject.source === color.source && <circle cx="12" cy="12" r="5" className="radioIconForeground-3wH3aU" fill="currentColor" />}
</svg>}
<div className="discordColorwayPreviewColorContainer">
{!color.isGradient ? colors.map((colorItm) => <div
{!color.isGradient ? colors.map(colorItm => <div
className="discordColorwayPreviewColor"
style={{
backgroundColor: color[colorItm],
@ -609,9 +607,9 @@ export default function ({
{(showLabelsInSelectorGridView || viewMode === "list") && <Text className={"colorwayLabel" + ((showLabelsInSelectorGridView && viewMode === "grid") ? " labelInGrid" : "")}>{color.name}</Text>}
{settings.selectorType === "normal" && <div
className="colorwayInfoIconContainer"
onClick={(e) => {
onClick={e => {
e.stopPropagation();
openModal((props) => <ColorwayInfoModal
openModal(props => <ColorwayInfoModal
modalProps={props}
colorway={color}
loadUIProps={loadUI}
@ -733,7 +731,7 @@ export default function ({
{activeColorwayObject.id === color.name && activeColorwayObject.source === color.source && <circle cx="12" cy="12" r="5" className="radioIconForeground-3wH3aU" fill="currentColor" />}
</svg>}
<div className="discordColorwayPreviewColorContainer">
{!color.isGradient ? colors.map((colorItm) => <div
{!color.isGradient ? colors.map(colorItm => <div
className="discordColorwayPreviewColor"
style={{
backgroundColor: color[colorItm],

View file

@ -26,8 +26,8 @@ const badVerbsReplacements = ["love", "eat", "deconstruct", "marry", "fart", "te
const badNounsReplacements = ["pasta", "kebab", "cake", "potato", "woman", "computer", "java", "hamburger", "monster truck", "osu!", "Ukrainian ball in search of gas game", "Anime", "Anime girl", "good", "keyboard", "NVIDIA RTX 3090 Graphics Card", "storm", "queen", "single", "umbrella", "mosque", "physics", "bath", "virus", "bathroom", "mom", "owner", "airport", "Avast Antivirus Free"];
function replaceBadNouns(content) {
// eslint-disable-next-line quotes
const regex = new RegExp('\\b(' + badNouns.join('|') + ')\\b', 'gi');
const regex = new RegExp("\\b(" + badNouns.join("|") + ")\\b", "gi");
return content.replace(regex, function (match) {
const randomIndex = Math.floor(Math.random() * badNounsReplacements.length);
@ -36,8 +36,8 @@ function replaceBadNouns(content) {
}
function replaceBadVerbs(content) {
// eslint-disable-next-line quotes
const regex = new RegExp('\\b(' + badVerbs.join('|') + ')\\b', 'gi');
const regex = new RegExp("\\b(" + badVerbs.join("|") + ")\\b", "gi");
return content.replace(regex, function (match) {
const randomIndex = Math.floor(Math.random() * badVerbsReplacements.length);

View file

@ -28,7 +28,7 @@ export default new (class NoteHandler {
},
flags: message.flags,
// Moment has a toString() function, this doesn't convert to '[object Object]'.
// eslint-disable-next-line @typescript-eslint/no-base-to-string
timestamp: message.timestamp.toString(),
attachments: message.attachments as Discord.Attachment[],
embeds: message.embeds,

View file

@ -1,5 +1,5 @@
/* eslint-disable simple-header/header */
/* eslint-disable indent */
/*
* Vencord, a modification for Discord's desktop app
* Copyright (c) 2023 your mom lol

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
/* eslint-disable indent */
import "./styles.css";
import { generateId } from "@api/Commands";

View file

@ -165,11 +165,11 @@ const overrideObject = (obj, propertyName, overrideValue) => {
}
let overriden = false;
for (const key in obj) {
// eslint-disable-next-line no-prototype-builtins
if (obj.hasOwnProperty(key) && key === propertyName) {
obj[key] = overrideValue;
overriden = true;
// eslint-disable-next-line no-prototype-builtins
} else if (obj.hasOwnProperty(key) && typeof obj[key] === "object") {
if (overrideObject(obj[key], propertyName, overrideValue)) {
overriden = true;

View file

@ -17,8 +17,7 @@
*/
import { LazyComponent } from "@utils/react";
import { FilterFn, filters, lazyWebpackSearchHistory, waitFor } from "../webpack";
import { FilterFn, filters, lazyWebpackSearchHistory, waitFor } from "@webpack";
export function waitForComponent<T extends React.ComponentType<any> = React.ComponentType<any> & Record<string, any>>(name: string, filter: FilterFn | string | string[]): T {
if (IS_REPORTER) lazyWebpackSearchHistory.push(["waitForComponent", Array.isArray(filter) ? filter : [filter]]);

View file

@ -16,7 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { filters, mapMangledModuleLazy, waitFor } from "../webpack";
import { filters, mapMangledModuleLazy, waitFor } from "@webpack";
import type * as t from "./types/menu";
export let Menu = {} as t.Menu;

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { findByPropsLazy, waitFor } from "../webpack";
import { findByPropsLazy, waitFor } from "@webpack";
export let React: typeof import("react");
export let useState: typeof React.useState;

View file

@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { findByCodeLazy, findByPropsLazy } from "@webpack";
import type * as Stores from "discord-types/stores";
import { findByCodeLazy, findByPropsLazy } from "../webpack";
import { waitForStore } from "./internal";
import * as t from "./types/stores";

View file

@ -17,9 +17,9 @@
*/
import { canonicalizeMatch } from "@utils/patches";
import { _resolveReady, filters, findByCodeLazy, findByPropsLazy, findLazy, mapMangledModuleLazy, waitFor } from "@webpack";
import type { Channel } from "discord-types/general";
import { _resolveReady, filters, findByCodeLazy, findByPropsLazy, findLazy, mapMangledModuleLazy, waitFor } from "../webpack";
import type * as t from "./types/utils";
export let FluxDispatcher: t.FluxDispatcher;

View file

@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { patches } from "@plugins";
import { WEBPACK_CHUNK } from "@utils/constants";
import { Logger } from "@utils/Logger";
import { canonicalizeReplacement } from "@utils/patches";
@ -23,7 +24,6 @@ import { PatchReplacement } from "@utils/types";
import { WebpackInstance } from "discord-types/other";
import { traceFunction } from "../debug/Tracer";
import { patches } from "../plugins";
import { _initWebpack, beforeInitListeners, factoryListeners, moduleListeners, subscriptions, wreq } from ".";
const logger = new Logger("WebpackInterceptor", "#8caaee");