aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/kiwiirc
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/kiwiirc
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/kiwiirc')
-rw-r--r--recipes/kiwiirc/package.json2
-rw-r--r--recipes/kiwiirc/webview.js27
2 files changed, 17 insertions, 12 deletions
diff --git a/recipes/kiwiirc/package.json b/recipes/kiwiirc/package.json
index 9c0b7b7..1e1adfd 100644
--- a/recipes/kiwiirc/package.json
+++ b/recipes/kiwiirc/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "kiwiirc", 2 "id": "kiwiirc",
3 "name": "KiwiIRC", 3 "name": "KiwiIRC",
4 "version": "1.0.0", 4 "version": "1.1.0",
5 "license": "MIT", 5 "license": "MIT",
6 "config": { 6 "config": {
7 "serviceURL": "https://kiwiirc.com/nextclient/", 7 "serviceURL": "https://kiwiirc.com/nextclient/",
diff --git a/recipes/kiwiirc/webview.js b/recipes/kiwiirc/webview.js
index 0c362f0..ef6c930 100644
--- a/recipes/kiwiirc/webview.js
+++ b/recipes/kiwiirc/webview.js
@@ -1,28 +1,33 @@
1const _path = _interopRequireDefault(require('path'));
2
3function _interopRequireDefault(obj) { 1function _interopRequireDefault(obj) {
4 return obj && obj.__esModule ? obj : { default: obj }; 2 return obj && obj.__esModule ? obj : { default: obj };
5} 3}
6 4
5const _path = _interopRequireDefault(require('path'));
6
7module.exports = Ferdium => { 7module.exports = Ferdium => {
8 const getMessages = function getMessages() { 8 const getMessages = function getMessages() {
9 // eslint-disable-next-line no-undef 9 // eslint-disable-next-line no-undef
10 const unreadChannelsCount = kiwi.state.networks.reduce((count, network) => { 10 const unreadChannelsCount = kiwi.state.networks.reduce((count, network) => {
11 // eslint-disable-next-line no-param-reassign
11 return (count += network.buffers.filter(buffer => { 12 return (count += network.buffers.filter(buffer => {
12 return !buffer.name.startsWith('*') && buffer.flags.unread !== 0; 13 return !buffer.name.startsWith('*') && buffer.flags.unread !== 0;
13 }).length); 14 }).length);
14 }, 0); 15 }, 0);
15 16
16 // eslint-disable-next-line no-undef 17 // eslint-disable-next-line no-undef
17 const mentionedChannelsCount = kiwi.state.networks.reduce((count, network) => { 18 const mentionedChannelsCount = kiwi.state.networks.reduce(
18 return (count += network.buffers.filter(buffer => { 19 (count, network) => {
19 return ( 20 // eslint-disable-next-line no-param-reassign
20 !buffer.name.startsWith('*') && 21 return (count += network.buffers.filter(buffer => {
21 buffer.flags.unread !== 0 && 22 return (
22 buffer.flags.highlight 23 !buffer.name.startsWith('*') &&
23 ); 24 buffer.flags.unread !== 0 &&
24 }).length); 25 buffer.flags.highlight
25 }, 0); 26 );
27 }).length);
28 },
29 0,
30 );
26 31
27 // set Ferdium badges 32 // set Ferdium badges
28 Ferdium.setBadge(mentionedChannelsCount, unreadChannelsCount); 33 Ferdium.setBadge(mentionedChannelsCount, unreadChannelsCount);