From 9b8f01716774a960073e944823ab727cc867a8f6 Mon Sep 17 00:00:00 2001 From: MCMXC <16797721+mcmxcdev@users.noreply.github.com> Date: Wed, 26 Jul 2023 06:29:03 -0600 Subject: chore: improve lint setup (#397) - update eslint config to closely mirror the ones from ferdium-app - add .eslintignore - opt in to eslint `reportUnusedDisableDirectives` config option - remove `trailingComma: all` from `prettier` config which is default in `prettier` v3 - autofix or disable a lot of lint issues throughout codebase - add `volta` configuration to `package.json` to autoload correct `node` and `pnpm` versions - upgrade all `eslint` and `prettier` related dependencies to latest - update lint:fix npm script - reformat touched files with prettier - bumped up minor version for all recipes that have changes - introduced injection of 'service.css' where it was missing in many recipes --------- Co-authored-by: Vijay A --- recipes/steamchat/index.js | 13 ++++++++----- recipes/steamchat/package.json | 2 +- recipes/steamchat/webview.js | 28 +++++++++++++++++++++------- 3 files changed, 30 insertions(+), 13 deletions(-) (limited to 'recipes/steamchat') diff --git a/recipes/steamchat/index.js b/recipes/steamchat/index.js index 7edfda5..3b3a28a 100644 --- a/recipes/steamchat/index.js +++ b/recipes/steamchat/index.js @@ -1,5 +1,8 @@ -module.exports = (Ferdium) => class SteamChat extends Ferdium { - overrideUserAgent() { - return window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(); - } -}; +module.exports = Ferdium => + class SteamChat extends Ferdium { + overrideUserAgent() { + return window.navigator.userAgent + .replaceAll(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '') + .trim(); + } + }; diff --git a/recipes/steamchat/package.json b/recipes/steamchat/package.json index 9123671..2f37026 100644 --- a/recipes/steamchat/package.json +++ b/recipes/steamchat/package.json @@ -1,7 +1,7 @@ { "id": "steamchat", "name": "SteamChat", - "version": "1.4.3", + "version": "1.5.0", "license": "MIT", "config": { "serviceURL": "https://steamcommunity.com/chat", diff --git a/recipes/steamchat/webview.js b/recipes/steamchat/webview.js index 9cb6d64..3385423 100644 --- a/recipes/steamchat/webview.js +++ b/recipes/steamchat/webview.js @@ -1,3 +1,9 @@ +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} + +const _path = _interopRequireDefault(require('path')); + module.exports = (Ferdium, settings) => { const getMessages = () => { // get new msg count @@ -30,13 +36,19 @@ module.exports = (Ferdium, settings) => { Ferdium.loop(getMessages); + Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); + // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences - document.addEventListener('click', event => { - const link = event.target.closest('a[href^="http"]'); - const button = event.target.closest('button[title^="http"]'); + document.addEventListener( + 'click', + event => { + const link = event.target.closest('a[href^="http"]'); + const button = event.target.closest('button[title^="http"]'); - if (link || button) { - const url = link ? link.getAttribute('href') : button.getAttribute('title'); + if (link || button) { + const url = link + ? link.getAttribute('href') + : button.getAttribute('title'); event.preventDefault(); event.stopPropagation(); @@ -46,6 +58,8 @@ module.exports = (Ferdium, settings) => { } else { Ferdium.openNewWindow(url); } - } - }, true); + } + }, + true, + ); }; -- cgit v1.2.3-70-g09d2