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); }