From 793954b0aa138a0cf04cd3589a20c23dcbd0b68d Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Fri, 17 May 2024 02:55:11 -0300 Subject: [PATCH] Fix prettier + eslint --- src/js/components/SurahIndex/Filter.tsx | 3 +-- src/js/loaders/SurahStreamLoader.ts | 8 ++++++-- src/js/main/redirect.ts | 7 ++++--- src/js/main/surah-index.tsx | 4 +--- src/js/main/surah-stream.tsx | 6 +++--- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/js/components/SurahIndex/Filter.tsx b/src/js/components/SurahIndex/Filter.tsx index 7871963..0dd9d0c 100644 --- a/src/js/components/SurahIndex/Filter.tsx +++ b/src/js/components/SurahIndex/Filter.tsx @@ -19,8 +19,7 @@ export function Filter({ locale, t, setIndex, surahs }: Props) { } else { const regexp = new RegExp(value, "i"); const newIndex = surahs.filter( - surah => - regexp.test(surah.name) || regexp.test(String(surah.id)), + surah => regexp.test(surah.name) || regexp.test(String(surah.id)), ); setIndex(newIndex); } diff --git a/src/js/loaders/SurahStreamLoader.ts b/src/js/loaders/SurahStreamLoader.ts index bc1bcff..eeef12d 100644 --- a/src/js/loaders/SurahStreamLoader.ts +++ b/src/js/loaders/SurahStreamLoader.ts @@ -13,8 +13,12 @@ import postman, { item } from "postman"; item.css("/css/main/surah-stream.css"), item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)"), item.font("Mada Regular", "url(/fonts/mada-regular.ttf"), - item.json(`/json/${locale}/${surahId}/info.json`, { className: "json surahinfo" }), - item.json(`/json/${locale}/${surahId}/surah.json`, { className: "json surah" }), + item.json(`/json/${locale}/${surahId}/info.json`, { + className: "json surahinfo", + }), + item.json(`/json/${locale}/${surahId}/surah.json`, { + className: "json surah", + }), item.progress((percent: number) => { progressBar.value = percent; progressNumber.innerText = `${percent.toFixed(0)}%`; diff --git a/src/js/main/redirect.ts b/src/js/main/redirect.ts index 1d50fa3..7d495f5 100644 --- a/src/js/main/redirect.ts +++ b/src/js/main/redirect.ts @@ -1,8 +1,9 @@ import { Quran, TLocale } from "Quran"; (function () { const defaultl = "en"; - const locale = navigator.languages - .map(s => s.slice(0, 2).toLowerCase()) - .find(s => Quran.locales.includes(s as TLocale)) || defaultl; + const locale = + navigator.languages + .map(s => s.slice(0, 2).toLowerCase()) + .find(s => Quran.locales.includes(s as TLocale)) || defaultl; location.replace(`/${locale}/`); })(); diff --git a/src/js/main/surah-index.tsx b/src/js/main/surah-index.tsx index 179323a..cbf6c1f 100644 --- a/src/js/main/surah-index.tsx +++ b/src/js/main/surah-index.tsx @@ -10,9 +10,7 @@ import { SurahIndex } from "~/components/SurahIndex"; const appVersion = root.getAttribute("data-app-version") as string; const t = T(require("@json/t.json")); const byLocale = require("@json/surahs"); - const surahs: Surah[] = byLocale[locale].map( - (e: TSurah) => new Surah(e), - ); + const surahs: Surah[] = byLocale[locale].map((e: TSurah) => new Surah(e)); ReactDOM.createRoot(root).render( = JSON.parse(node2.innerText)!; + const blob3: Array<[number, number]> = JSON.parse(node3.innerText)!; const surah = new Surah(blob1); for (let i = 0; i < blob2.length; i++) { const [id, body] = blob2[i] as [number, string];