From 74c3930e0a5ed264f330bc32c27116ead1063c5d Mon Sep 17 00:00:00 2001 From: Ven Date: Thu, 6 Oct 2022 00:42:58 +0200 Subject: add eslint config (#53) * eslint * workflow * lint main --- src/webpack/common.tsx | 4 ++-- src/webpack/patchWebpack.ts | 6 +++--- src/webpack/webpack.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/webpack') diff --git a/src/webpack/common.tsx b/src/webpack/common.tsx index 82d812b..1a15489 100644 --- a/src/webpack/common.tsx +++ b/src/webpack/common.tsx @@ -1,8 +1,8 @@ -import { waitFor, filters, _resolveReady } from './webpack'; +import { waitFor, filters, _resolveReady } from "./webpack"; import type Components from "discord-types/components"; import type Stores from "discord-types/stores"; import type Other from "discord-types/other"; -import { lazyWebpack } from '../utils/misc'; +import { lazyWebpack } from "../utils/misc"; export const Margins = lazyWebpack(filters.byProps(["marginTop20"])); diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index 469b930..dd7b537 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -1,4 +1,4 @@ -import { WEBPACK_CHUNK } from '../utils/constants'; +import { WEBPACK_CHUNK } from "../utils/constants"; import Logger from "../utils/logger"; import { _initWebpack } from "."; @@ -8,7 +8,7 @@ const logger = new Logger("WebpackInterceptor", "#8caaee"); Object.defineProperty(window, WEBPACK_CHUNK, { get: () => webpackChunk, - set: (v) => { + set: v => { if (v?.push !== Array.prototype.push) { logger.info(`Patching ${WEBPACK_CHUNK}.push`); _initWebpack(v); @@ -141,7 +141,7 @@ function patchPush() { handlePush.original = window[WEBPACK_CHUNK].push; Object.defineProperty(window[WEBPACK_CHUNK], "push", { get: () => handlePush, - set: (v) => (handlePush.original = v), + set: v => (handlePush.original = v), configurable: true }); } diff --git a/src/webpack/webpack.ts b/src/webpack/webpack.ts index 15104bb..f1fea46 100644 --- a/src/webpack/webpack.ts +++ b/src/webpack/webpack.ts @@ -36,7 +36,7 @@ export type CallbackFn = (mod: any) => void; export function _initWebpack(instance: typeof window.webpackChunkdiscord_app) { if (cache !== void 0) throw "no."; - wreq = instance.push([[Symbol()], {}, (r) => r]); + wreq = instance.push([[Symbol()], {}, r => r]); cache = wreq.c; instance.pop(); } -- cgit