chore: add ESLint with security plugin, fix code quality warnings

- Install eslint, typescript-eslint, eslint-plugin-security
- Add eslint.config.mjs with project-tuned rules
- Fix redundant catch assignment in cutVideo
- Fix let→const for promise dedup patterns
- No security bugs found — all regex warnings are false positives (anchored patterns)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
xRangerDE
2026-03-22 14:55:35 +01:00
co-authored by Claude Opus 4.6
parent d9bdf744fd
commit 18940d0640
4 changed files with 1169 additions and 13 deletions
+3 -7
View File
@@ -1095,8 +1095,7 @@ function withInFlightDedup<T>(
return existing;
}
let requestPromise: Promise<T>;
requestPromise = factory().finally(() => {
const requestPromise: Promise<T> = factory().finally(() => {
if (store.get(key) === requestPromise) {
store.delete(key);
}
@@ -1412,8 +1411,7 @@ function requestTwitchLogin(): Promise<boolean> {
return twitchLoginInFlight;
}
let loginPromise: Promise<boolean>;
loginPromise = twitchLogin().finally(() => {
const loginPromise: Promise<boolean> = twitchLogin().finally(() => {
if (twitchLoginInFlight === loginPromise) {
twitchLoginInFlight = null;
}
@@ -1883,9 +1881,7 @@ async function cutVideo(
let inputBytes = 0;
try {
inputBytes = fs.statSync(inputFile).size;
} catch {
inputBytes = 0;
}
} catch { }
const cutRequiredBytes = Math.max(96 * 1024 * 1024, Math.ceil(inputBytes * 0.75));
const cutDiskCheck = ensureDiskSpace(path.dirname(outputFile), cutRequiredBytes, 'Video-Cut');