diff options
author | 2023-07-26 06:29:03 -0600 | |
---|---|---|
committer | 2023-07-26 17:59:03 +0530 | |
commit | 9b8f01716774a960073e944823ab727cc867a8f6 (patch) | |
tree | 732b83770baa78f5cf12776aaa33ce65bebfa418 /recipes/kiwiirc/webview.js | |
parent | Add Excalidraw recipe (#393) (diff) | |
download | ferdium-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/webview.js')
-rw-r--r-- | recipes/kiwiirc/webview.js | 27 |
1 files changed, 16 insertions, 11 deletions
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 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.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); |