From 370e3db206daae0b8acc3765b0cbca4229861434 Mon Sep 17 00:00:00 2001 From: nocci Date: Thu, 8 Jan 2026 15:43:30 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore(workflows):=20add=20screen?= =?UTF-8?q?shot=20to=20ESLint=20globals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add screenshot as a readonly global variable to ESLint configuration ♻️ refactor(epic-games): improve path resolution for screenshots - replace resolve with path.resolve for better path management --- .forgejo/workflows/.eslintrc.cjs | 1 + epic-games.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/.eslintrc.cjs b/.forgejo/workflows/.eslintrc.cjs index bd72d81..bd4f055 100644 --- a/.forgejo/workflows/.eslintrc.cjs +++ b/.forgejo/workflows/.eslintrc.cjs @@ -24,6 +24,7 @@ module.exports = { '@stylistic/js', ], globals: { + screenshot: 'readonly', cfg: 'readonly', URL_CLAIM: 'readonly', COOKIES_PATH: 'readonly', diff --git a/epic-games.js b/epic-games.js index a22a873..beb3cd7 100644 --- a/epic-games.js +++ b/epic-games.js @@ -3,10 +3,10 @@ import { authenticator } from 'otplib'; import chalk from 'chalk'; import path from 'node:path'; import { existsSync, writeFileSync, appendFileSync } from 'node:fs'; -import { resolve, jsonDb, datetime, stealth, filenamify, prompt, notify, html_game_list, handleSIGINT } from './src/util.js'; +import { jsonDb, datetime, stealth, filenamify, prompt, notify, html_game_list, handleSIGINT } from './src/util.js'; import { cfg } from './src/config.js'; -const screenshot = (...a) => resolve(cfg.dir.screenshots, 'epic-games', ...a); +const screenshot = (...a) => path.resolve(cfg.dir.screenshots, 'epic-games', ...a); const URL_CLAIM = 'https://store.epicgames.com/en-US/free-games'; const URL_LOGIN = 'https://www.epicgames.com/id/login?lang=en-US&noHostRedirect=true&redirectUrl=' + URL_CLAIM;