aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/pleroma/index.js
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/pleroma/index.js
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/pleroma/index.js')
-rw-r--r--recipes/pleroma/index.js36
1 files changed, 19 insertions, 17 deletions
diff --git a/recipes/pleroma/index.js b/recipes/pleroma/index.js
index 67a0e19..2050059 100644
--- a/recipes/pleroma/index.js
+++ b/recipes/pleroma/index.js
@@ -1,19 +1,21 @@
1module.exports = Ferdium => class Pleroma extends Ferdium { 1module.exports = Ferdium =>
2 async validateUrl(url) { 2 class Pleroma extends Ferdium {
3 try { 3 async validateUrl(url) {
4 const resp = await window.fetch(`${url}/api/v1/instance`, { 4 try {
5 Accept: 'application/json', 5 const resp = await window.fetch(`${url}/api/v1/instance`, {
6 }); 6 Accept: 'application/json',
7 const data = await resp.json(); 7 });
8 const version = data.version; 8 const data = await resp.json();
9 return typeof (version) === 'string' && version.includes('Pleroma'); 9 const version = data.version;
10 } catch (error) { 10 return typeof version === 'string' && version.includes('Pleroma');
11 console.log('Pleroma server validation error', error); 11 } catch (error) {
12 // eslint-disable-next-line no-console
13 console.log('Pleroma server validation error', error);
14 }
15 return false;
12 } 16 }
13 return false;
14 }
15 17
16 buildUrl(url) { 18 buildUrl(url) {
17 return `${url}/main/friends`; 19 return `${url}/main/friends`;
18 } 20 }
19}; 21 };