diff options
author | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2023-07-26 06:29:03 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-26 17:59:03 +0530 |
commit | 9b8f01716774a960073e944823ab727cc867a8f6 (patch) | |
tree | 732b83770baa78f5cf12776aaa33ce65bebfa418 /recipes/basecamp/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/basecamp/webview.js')
-rw-r--r-- | recipes/basecamp/webview.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/recipes/basecamp/webview.js b/recipes/basecamp/webview.js index 7d13751..2fe8f7b 100644 --- a/recipes/basecamp/webview.js +++ b/recipes/basecamp/webview.js | |||
@@ -1,9 +1,9 @@ | |||
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 | function show(element) { | 7 | function show(element) { |
8 | element.style.display = 'inherit'; | 8 | element.style.display = 'inherit'; |
9 | } | 9 | } |
@@ -16,16 +16,16 @@ module.exports = Ferdium => { | |||
16 | const modal = document.createElement('div'); | 16 | const modal = document.createElement('div'); |
17 | 17 | ||
18 | const waitFor = (condition, callback) => { | 18 | const waitFor = (condition, callback) => { |
19 | if (!condition()) { | 19 | if (condition()) { |
20 | window.setTimeout(waitFor.bind(null, condition, callback), 100); | ||
21 | } else { | ||
22 | callback(); | 20 | callback(); |
21 | } else { | ||
22 | window.setTimeout(waitFor.bind(null, condition, callback), 100); | ||
23 | } | 23 | } |
24 | }; | 24 | }; |
25 | function showModal(text) { | 25 | function showModal(text) { |
26 | show(modal); | 26 | show(modal); |
27 | 27 | ||
28 | let p = modal.querySelector('p'); | 28 | const p = modal.querySelector('p'); |
29 | 29 | ||
30 | if (p) { | 30 | if (p) { |
31 | p.textContent = text; | 31 | p.textContent = text; |
@@ -34,7 +34,7 @@ module.exports = Ferdium => { | |||
34 | 34 | ||
35 | function hideModal() { | 35 | function hideModal() { |
36 | hide(modal); | 36 | hide(modal); |
37 | let p = modal.querySelector('p'); | 37 | const p = modal.querySelector('p'); |
38 | 38 | ||
39 | if (p) { | 39 | if (p) { |
40 | p.textContent = ''; | 40 | p.textContent = ''; |
@@ -52,7 +52,7 @@ module.exports = Ferdium => { | |||
52 | modal.textContent = | 52 | modal.textContent = |
53 | '<div class="modal-content"><span class="close">×</span><p></p></div>'; | 53 | '<div class="modal-content"><span class="close">×</span><p></p></div>'; |
54 | 54 | ||
55 | let close = modal.querySelector('.close'); | 55 | const close = modal.querySelector('.close'); |
56 | if (close) { | 56 | if (close) { |
57 | close.addEventListener('click', hideModal); | 57 | close.addEventListener('click', hideModal); |
58 | } | 58 | } |