From ac5113d524dd7d18f66a8dcfcc23fab1d8850c76 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 20:05:39 +0200 Subject: [PATCH] [Glitch] Update eslint (non-major) Port 37d984b8bf19f86a8a371a97d8a1a000022448b3 to glitch-soc Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Renaud Chaput Signed-off-by: Claire --- app/javascript/flavours/glitch/components/hashtag_bar.tsx | 2 +- app/javascript/flavours/glitch/packs/admin.tsx | 2 +- app/javascript/flavours/glitch/packs/public.tsx | 8 ++++---- app/javascript/flavours/glitch/uuid.ts | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/javascript/flavours/glitch/components/hashtag_bar.tsx b/app/javascript/flavours/glitch/components/hashtag_bar.tsx index 91fa922198..ed5de7d3a5 100644 --- a/app/javascript/flavours/glitch/components/hashtag_bar.tsx +++ b/app/javascript/flavours/glitch/components/hashtag_bar.tsx @@ -24,7 +24,7 @@ export type StatusLike = Record<{ function normalizeHashtag(hashtag: string) { return ( - hashtag && hashtag.startsWith('#') ? hashtag.slice(1) : hashtag + !!hashtag && hashtag.startsWith('#') ? hashtag.slice(1) : hashtag ).normalize('NFKC'); } diff --git a/app/javascript/flavours/glitch/packs/admin.tsx b/app/javascript/flavours/glitch/packs/admin.tsx index 57a017ff7d..5c1e43d1cf 100644 --- a/app/javascript/flavours/glitch/packs/admin.tsx +++ b/app/javascript/flavours/glitch/packs/admin.tsx @@ -363,6 +363,6 @@ ready(() => { document.querySelectorAll('[data-admin-component]').forEach((element) => { void mountReactComponent(element); }); -}).catch((reason) => { +}).catch((reason: unknown) => { throw reason; }); diff --git a/app/javascript/flavours/glitch/packs/public.tsx b/app/javascript/flavours/glitch/packs/public.tsx index 6087f7b7c1..d4002a7a3b 100644 --- a/app/javascript/flavours/glitch/packs/public.tsx +++ b/app/javascript/flavours/glitch/packs/public.tsx @@ -69,7 +69,7 @@ window.addEventListener('message', (e) => { }, '*', ); - }).catch((e) => { + }).catch((e: unknown) => { console.error('Error in setHeightMessage postMessage', e); }); }); @@ -206,7 +206,7 @@ function loaded() { return true; }) - .catch((error) => { + .catch((error: unknown) => { console.error(error); }); } @@ -448,7 +448,7 @@ Rails.delegate(document, '#registration_new_user,#new_user', 'submit', () => { }); function main() { - ready(loaded).catch((error) => { + ready(loaded).catch((error: unknown) => { console.error(error); }); } @@ -457,6 +457,6 @@ loadPolyfills() .then(loadLocale) .then(main) .then(loadKeyboardExtensions) - .catch((error) => { + .catch((error: unknown) => { console.error(error); }); diff --git a/app/javascript/flavours/glitch/uuid.ts b/app/javascript/flavours/glitch/uuid.ts index 4d0a8a8036..0b4d55beb6 100644 --- a/app/javascript/flavours/glitch/uuid.ts +++ b/app/javascript/flavours/glitch/uuid.ts @@ -4,5 +4,6 @@ export function uuid(a?: string): string { (a as unknown as number) ^ ((Math.random() * 16) >> ((a as unknown as number) / 4)) ).toString(16) - : ('' + 1e7 + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, uuid); + : // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + ('' + 1e7 + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, uuid); }