aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/freshrss
diff options
context:
space:
mode:
authorLibravatar MCMXC <16797721+mcmxcdev@users.noreply.github.com>2023-07-26 06:29:03 -0600
committerLibravatar GitHub <noreply@github.com>2023-07-26 17:59:03 +0530
commit9b8f01716774a960073e944823ab727cc867a8f6 (patch)
tree732b83770baa78f5cf12776aaa33ce65bebfa418 /recipes/freshrss
parentAdd Excalidraw recipe (#393) (diff)
downloadferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.tar.gz
ferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.tar.zst
ferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.zip
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 <vraravam@users.noreply.github.com>
Diffstat (limited to 'recipes/freshrss')
-rw-r--r--recipes/freshrss/README.md3
-rw-r--r--recipes/freshrss/index.js2
-rw-r--r--recipes/freshrss/package.json2
-rw-r--r--recipes/freshrss/webview.js18
4 files changed, 13 insertions, 12 deletions
diff --git a/recipes/freshrss/README.md b/recipes/freshrss/README.md
deleted file mode 100644
index 3f50e87..0000000
--- a/recipes/freshrss/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
1# FreshRSS for Ferdium
2
3Unofficial Ferdium recipe for [FeshRSS](https://freshrss.org/)
diff --git a/recipes/freshrss/index.js b/recipes/freshrss/index.js
index ede7c6d..6e9d311 100644
--- a/recipes/freshrss/index.js
+++ b/recipes/freshrss/index.js
@@ -1,5 +1,3 @@
1"use strict";
2
3// just pass through ferdium 1// just pass through ferdium
4 2
5module.exports = Ferdium => Ferdium; 3module.exports = Ferdium => Ferdium;
diff --git a/recipes/freshrss/package.json b/recipes/freshrss/package.json
index b0396d3..c893180 100644
--- a/recipes/freshrss/package.json
+++ b/recipes/freshrss/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "freshrss", 2 "id": "freshrss",
3 "name": "FreshRSS", 3 "name": "FreshRSS",
4 "version": "1.1.0", 4 "version": "1.2.0",
5 "license": "MIT", 5 "license": "MIT",
6 "config": { 6 "config": {
7 "hasCustomUrl": true 7 "hasCustomUrl": true
diff --git a/recipes/freshrss/webview.js b/recipes/freshrss/webview.js
index cdc6e55..9740b08 100644
--- a/recipes/freshrss/webview.js
+++ b/recipes/freshrss/webview.js
@@ -1,18 +1,22 @@
1"use strict"; 1function _interopRequireDefault(obj) {
2 return obj && obj.__esModule ? obj : { default: obj };
3}
4
5const _path = _interopRequireDefault(require('path'));
2 6
3module.exports = Ferdium => { 7module.exports = Ferdium => {
4 const getMessages = function getMessages() { 8 const getMessages = function getMessages() {
5 // Initialize empty vars 9 // Initialize empty vars
6 var unread = 0; 10 let unread = 0;
7 var match = []; 11 let match = [];
8 // Define RegExp to replace occasionally &nbsp 12 // Define RegExp to replace occasionally &nbsp
9 var re = new RegExp(String.fromCodePoint(160), "g"); 13 const re = new RegExp(String.fromCodePoint(160), 'g');
10 // Get value of <title> tag where in case of new feed elements the number of elements appear 14 // Get value of <title> tag where in case of new feed elements the number of elements appear
11 const titleValue = document.querySelector('title').text.replace(re, ""); 15 const titleValue = document.querySelector('title').text.replaceAll(re, '');
12 // Extract the number from the tag 16 // Extract the number from the tag
13 match = titleValue.match(/[\d\s]+/); 17 match = titleValue.match(/[\d\s]+/);
14 // Some logic to handle the match groups 18 // Some logic to handle the match groups
15 unread = match != null && match.length > 0 ? match[0] : 0; 19 unread = match !== null && match.length > 0 ? match[0] : 0;
16 // Set unread msgs badge 20 // Set unread msgs badge
17 Ferdium.setBadge(Number.parseInt(unread, 10)); 21 Ferdium.setBadge(Number.parseInt(unread, 10));
18 }; 22 };
@@ -22,4 +26,6 @@ module.exports = Ferdium => {
22 }; 26 };
23 27
24 Ferdium.loop(loopFunc); 28 Ferdium.loop(loopFunc);
29
30 Ferdium.injectCSS(_path.default.join(__dirname, 'service.css'));
25}; 31};