🔧 chore(workflows): add screenshot to ESLint globals
Some checks failed
build-and-push / lint (push) Successful in 8s
build-and-push / sonar (push) Failing after 0s
build-and-push / docker (push) Has been skipped

- 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
This commit is contained in:
nocci 2026-01-08 15:43:30 +00:00
parent af90aa7c42
commit 370e3db206
2 changed files with 3 additions and 2 deletions

View file

@ -24,6 +24,7 @@ module.exports = {
'@stylistic/js', '@stylistic/js',
], ],
globals: { globals: {
screenshot: 'readonly',
cfg: 'readonly', cfg: 'readonly',
URL_CLAIM: 'readonly', URL_CLAIM: 'readonly',
COOKIES_PATH: 'readonly', COOKIES_PATH: 'readonly',

View file

@ -3,10 +3,10 @@ import { authenticator } from 'otplib';
import chalk from 'chalk'; import chalk from 'chalk';
import path from 'node:path'; import path from 'node:path';
import { existsSync, writeFileSync, appendFileSync } from 'node:fs'; 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'; 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_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; const URL_LOGIN = 'https://www.epicgames.com/id/login?lang=en-US&noHostRedirect=true&redirectUrl=' + URL_CLAIM;