aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/lint.yml2
-rw-r--r--package.json54
-rw-r--r--src/Vencord.ts2
-rw-r--r--src/api/MessageEvents.ts2
-rw-r--r--src/components/Settings.tsx2
-rw-r--r--src/globals.d.ts2
-rw-r--r--src/plugins/randomiseFileNames.ts2
-rw-r--r--src/utils/ChangeList.ts2
-rw-r--r--src/utils/misc.tsx2
-rw-r--r--src/utils/quickCss.ts3
-rw-r--r--tsconfig.json8
11 files changed, 45 insertions, 36 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 3a303ff..5e8dc04 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -24,4 +24,4 @@ jobs:
run: pnpm install --frozen-lockfile
- name: Lint & Test if it compiles
- run: pnpm lint && pnpm build
+ run: pnpm test
diff --git a/package.json b/package.json
index 5b5719f..71da6fc 100644
--- a/package.json
+++ b/package.json
@@ -1,28 +1,30 @@
{
- "devDependencies": {
- "@types/node": "^18.7.13",
- "@types/react": "^18.0.17",
- "@types/yazl": "^2.4.2",
- "@typescript-eslint/parser": "^5.39.0",
- "electron": "^20.1.0",
- "esbuild": "^0.15.5",
- "eslint": "^8.24.0",
- "typescript": "^4.8.4",
- "yazl": "^2.5.1"
- },
- "dependencies": {
- "console-menu": "^0.1.0",
- "discord-types": "^1.3.26",
- "electron-devtools-installer": "^3.2.0"
- },
- "scripts": {
- "buildWeb": "node buildWeb.mjs",
- "build": "node build.mjs",
- "watch": "node build.mjs --watch",
- "inject": "node scripts/patcher/install.js",
- "uninject": "node scripts/patcher/uninstall.js",
- "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
- "lint:fix": "pnpm lint --fix"
- },
- "packageManager": "pnpm@7.12.2"
+ "scripts": {
+ "build": "node build.mjs",
+ "buildWeb": "node buildWeb.mjs",
+ "inject": "node scripts/patcher/install.js",
+ "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
+ "lint:fix": "pnpm lint --fix",
+ "test": "pnpm lint && pnpm build && pnpm testTsc",
+ "testTsc": "tsc --noEmit",
+ "uninject": "node scripts/patcher/uninstall.js",
+ "watch": "node build.mjs --watch"
+ },
+ "dependencies": {
+ "console-menu": "^0.1.0",
+ "electron-devtools-installer": "^3.2.0"
+ },
+ "devDependencies": {
+ "@types/node": "^18.7.13",
+ "@types/react": "^18.0.17",
+ "@types/yazl": "^2.4.2",
+ "@typescript-eslint/parser": "^5.39.0",
+ "discord-types": "^1.3.26",
+ "electron": "^20.1.0",
+ "esbuild": "^0.15.5",
+ "eslint": "^8.24.0",
+ "typescript": "^4.8.4",
+ "yazl": "^2.5.1"
+ },
+ "packageManager": "pnpm@7.12.2"
}
diff --git a/src/Vencord.ts b/src/Vencord.ts
index 5a0bb71..578e69d 100644
--- a/src/Vencord.ts
+++ b/src/Vencord.ts
@@ -22,7 +22,7 @@ Object.defineProperty(window, "IS_WEB", {
enumerable: true
});
-export let Components;
+export let Components: any;
async function init() {
await onceReady;
diff --git a/src/api/MessageEvents.ts b/src/api/MessageEvents.ts
index 0b3be65..047a015 100644
--- a/src/api/MessageEvents.ts
+++ b/src/api/MessageEvents.ts
@@ -67,7 +67,7 @@ type ClickListener = (message: Message, channel: Channel, event: MouseEvent) =>
const listeners = new Set<ClickListener>();
-export function _handleClick(message, channel, event) {
+export function _handleClick(message: Message, channel: Channel, event: MouseEvent) {
for (const listener of listeners) {
try {
listener(message, channel, event);
diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx
index 56c97cb..7756902 100644
--- a/src/components/Settings.tsx
+++ b/src/components/Settings.tsx
@@ -127,7 +127,7 @@ export default ErrorBoundary.wrap(function Settings() {
disabled={p.required || dependency}
key={p.name}
value={settings.plugins[p.name].enabled || p.required || dependency}
- onChange={v => {
+ onChange={(v: boolean) => {
settings.plugins[p.name].enabled = v;
let needsRestart = Boolean(p.patches?.length);
if (v) {
diff --git a/src/globals.d.ts b/src/globals.d.ts
index 8c5ee10..4320e1c 100644
--- a/src/globals.d.ts
+++ b/src/globals.d.ts
@@ -12,7 +12,7 @@ declare global {
push(chunk: any): any;
pop(): any;
};
- [k: PropertyKey]: any;
+ [k: string]: any;
}
}
diff --git a/src/plugins/randomiseFileNames.ts b/src/plugins/randomiseFileNames.ts
index 02166bf..30603af 100644
--- a/src/plugins/randomiseFileNames.ts
+++ b/src/plugins/randomiseFileNames.ts
@@ -16,7 +16,7 @@ export default definePlugin({
},
],
- rand(file) {
+ rand(file: string) {
const chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
const rand = Array.from(
diff --git a/src/utils/ChangeList.ts b/src/utils/ChangeList.ts
index d8f7449..a0da8f2 100644
--- a/src/utils/ChangeList.ts
+++ b/src/utils/ChangeList.ts
@@ -1,5 +1,5 @@
export class ChangeList<T>{
- private set = new Set<T>;
+ private set = new Set<T>();
public get changeCount() {
return this.set.size;
diff --git a/src/utils/misc.tsx b/src/utils/misc.tsx
index a7d781a..7a733ed 100644
--- a/src/utils/misc.tsx
+++ b/src/utils/misc.tsx
@@ -28,7 +28,7 @@ export function lazyWebpack<T = any>(filter: FilterFn): T {
construct: (_, args, newTarget) => Reflect.construct(getMod(), args, newTarget),
deleteProperty: (_, prop) => delete getMod()[prop],
defineProperty: (_, property, attributes) => !!Object.defineProperty(getMod(), property, attributes)
- }) as T;
+ }) as any as T;
}
/**
diff --git a/src/utils/quickCss.ts b/src/utils/quickCss.ts
index eea44df..785dd71 100644
--- a/src/utils/quickCss.ts
+++ b/src/utils/quickCss.ts
@@ -12,7 +12,8 @@ export async function toggle(isEnabled: boolean) {
VencordNative.ipc.on(IpcEvents.QUICK_CSS_UPDATE, (_, css: string) => style.innerText = css);
style.innerText = await VencordNative.ipc.invoke(IpcEvents.GET_QUICK_CSS);
}
- } else style.disabled = !isEnabled;
+ } else // @ts-ignore yes typescript, property 'disabled' does exist on type 'HTMLStyleElement' u should try reading the docs some time
+ style.disabled = !isEnabled;
}
document.addEventListener("DOMContentLoaded", () => {
diff --git a/tsconfig.json b/tsconfig.json
index 620512a..5d87ced 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -2,7 +2,13 @@
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
- "lib": ["DOM", "esnext", "esnext.array", "esnext.asynciterable", "esnext.symbol"],
+ "lib": [
+ "DOM",
+ "esnext",
+ "esnext.array",
+ "esnext.asynciterable",
+ "esnext.symbol"
+ ],
"module": "commonjs",
"moduleResolution": "node",
"strict": true,