From 017cb2a7f55fbe97a42b92a214a6bc56fb50c14a Mon Sep 17 00:00:00 2001 From: Shintaro Jokagi Date: Thu, 15 May 2025 14:19:39 +1200 Subject: [PATCH] chore(biome): update biome rules --- .prettierrc.mjs | 9 -- biome.json | 6 + src/animations.ts | 8 +- src/components/BackButton.astro | 8 +- src/components/Button.astro | 8 +- src/components/Circles.astro | 6 +- src/components/Community.astro | 20 +-- src/components/Features.astro | 30 ++-- src/components/Footer.astro | 18 +-- src/components/Hero.astro | 34 ++--- src/components/Logo.astro | 2 +- src/components/MobileMenu.astro | 8 +- src/components/ModsList.tsx | 90 +++++------ src/components/NavBar.astro | 24 +-- src/components/ReleaseNoteItem.astro | 36 ++--- src/components/SocialMediaStrip.astro | 18 +-- src/components/Sponsors.astro | 18 +-- src/components/ThemeSwitch.astro | 6 +- src/components/Title.astro | 2 +- src/components/Video.astro | 4 +- src/components/download/ButtonCard.astro | 10 +- .../download/PlatformDownload.astro | 38 ++--- src/components/download/release-data.astro | 48 +++--- src/constants/i18n.ts | 6 +- src/constants/index.ts | 4 +- src/hooks/useModsSearch.ts | 142 +++++++++--------- src/layouts/Layout.astro | 30 ++-- src/mods.ts | 48 +++--- src/pages/404.astro | 2 +- src/pages/[...locale]/404.astro | 18 +-- src/pages/[...locale]/about.astro | 14 +- src/pages/[...locale]/donate.astro | 16 +- src/pages/[...locale]/download.astro | 44 +++--- src/pages/[...locale]/feed.xml.ts | 100 ++++++------ src/pages/[...locale]/index.astro | 18 +-- src/pages/[...locale]/mods/[...slug].astro | 28 ++-- src/pages/[...locale]/mods/index.astro | 20 +-- src/pages/[...locale]/privacy-policy.astro | 12 +- .../[...locale]/release-notes/[...slug].astro | 18 +-- .../[...locale]/release-notes/index.astro | 22 +-- src/pages/[...locale]/welcome.astro | 12 +- src/pages/[...locale]/whatsnew.astro | 32 ++-- src/release-notes.ts | 44 +++--- src/utils/githubChecksums.ts | 28 ++-- src/utils/i18n.ts | 76 +++++----- 45 files changed, 589 insertions(+), 596 deletions(-) delete mode 100644 .prettierrc.mjs diff --git a/.prettierrc.mjs b/.prettierrc.mjs deleted file mode 100644 index 40bc9c8..0000000 --- a/.prettierrc.mjs +++ /dev/null @@ -1,9 +0,0 @@ -/** @type {import('prettier').Config} */ -export default { - printWidth: 80, - tabWidth: 2, - semi: false, - singleQuote: true, - endOfLine: 'lf', - plugins: ['prettier-plugin-astro', 'prettier-plugin-tailwindcss'], -} diff --git a/biome.json b/biome.json index f9ce8ee..b76e4ff 100644 --- a/biome.json +++ b/biome.json @@ -21,5 +21,11 @@ ".git", "dist" ] + }, + "javascript": { + "formatter": { + "quoteStyle": "single", + "semicolons": "asNeeded" + } } } diff --git a/src/animations.ts b/src/animations.ts index 0e11de6..bedae27 100644 --- a/src/animations.ts +++ b/src/animations.ts @@ -1,19 +1,19 @@ export function getTitleAnimation(delay = 0, duration = 0.3, once = true) { return { - initial: { opacity: 0.001, translateY: 20, filter: "blur(4px)" }, + initial: { opacity: 0.001, translateY: 20, filter: 'blur(4px)' }, whileInView: { opacity: 1, translateY: 0, - filter: "blur(0px)", + filter: 'blur(0px)', transition: { duration, delay }, }, viewport: { once: once }, - }; + } } export function getZoomInAnimation(delay = 0) { return { initial: { scale: 0.8, opacity: 0.001 }, whileInView: { scale: 1, opacity: 1, transition: { duration: 0.2, delay } }, - }; + } } diff --git a/src/components/BackButton.astro b/src/components/BackButton.astro index c0074d5..2397d41 100644 --- a/src/components/BackButton.astro +++ b/src/components/BackButton.astro @@ -1,14 +1,14 @@ --- -import { ArrowLeft } from "lucide-astro"; -import { getLocale, getUI } from "~/utils/i18n"; +import { ArrowLeft } from 'lucide-astro' +import { getLocale, getUI } from '~/utils/i18n' -const locale = getLocale(Astro); +const locale = getLocale(Astro) const { routes: { mods: { slug }, }, -} = getUI(locale); +} = getUI(locale) ---
- {mods.pagination.pagination.split("{input}").map((value, index) => { + {mods.pagination.pagination.split('{input}').map((value, index) => { if (index === 0) { return ( - ); + ) } return ( {value - .replace("{totalPages}", totalPages.toString()) - .replace("{totalItems}", totalItems.toString())} + .replace('{totalPages}', totalPages.toString()) + .replace('{totalItems}', totalItems.toString())} - ); + ) })}
- ); + ) } return ( @@ -234,5 +234,5 @@ export default function ModsList({ allMods, locale }: ModsListProps) { {renderPagination()} - ); + ) } diff --git a/src/components/NavBar.astro b/src/components/NavBar.astro index 9f3ab98..bb39314 100644 --- a/src/components/NavBar.astro +++ b/src/components/NavBar.astro @@ -1,21 +1,21 @@ --- -import { Astronav, Dropdown, DropdownItems, MenuItems } from "astro-navbar"; -import { ArrowRight, ChevronDown, Download, Menu } from "lucide-astro"; -import { motion } from "motion/react"; -import Button from "~/components/Button.astro"; -import { getLocale, getPath, getUI } from "~/utils/i18n"; -import { getTitleAnimation } from "../animations.ts"; -import Logo from "./Logo.astro"; -import MobileMenu from "./MobileMenu.astro"; -import ThemeSwitch from "./ThemeSwitch.astro"; +import { Astronav, Dropdown, DropdownItems, MenuItems } from 'astro-navbar' +import { ArrowRight, ChevronDown, Download, Menu } from 'lucide-astro' +import { motion } from 'motion/react' +import Button from '~/components/Button.astro' +import { getLocale, getPath, getUI } from '~/utils/i18n' +import { getTitleAnimation } from '../animations.ts' +import Logo from './Logo.astro' +import MobileMenu from './MobileMenu.astro' +import ThemeSwitch from './ThemeSwitch.astro' -const locale = getLocale(Astro); -const getLocalePath = getPath(locale); +const locale = getLocale(Astro) +const getLocalePath = getPath(locale) const { components: { nav: { brand, menu }, }, -} = getUI(locale); +} = getUI(locale) --- diff --git a/src/components/ReleaseNoteItem.astro b/src/components/ReleaseNoteItem.astro index eeae398..b88951e 100644 --- a/src/components/ReleaseNoteItem.astro +++ b/src/components/ReleaseNoteItem.astro @@ -1,41 +1,41 @@ --- -import { Accordion, AccordionItem } from "free-astro-components"; -import { Info } from "lucide-astro"; +import { Accordion, AccordionItem } from 'free-astro-components' +import { Info } from 'lucide-astro' -import { releaseNotes as releaseNotesData } from "~/release-notes"; -import { getLocale, getPath, getUI } from "~/utils/i18n"; +import { releaseNotes as releaseNotesData } from '~/release-notes' +import { getLocale, getPath, getUI } from '~/utils/i18n' import { type BreakingChange, type ReleaseNote, getReleaseNoteFirefoxVersion, -} from "../release-notes"; -export type Props = ReleaseNote; -const { isTwilight, ...props } = Astro.props; +} from '../release-notes' +export type Props = ReleaseNote +const { isTwilight, ...props } = Astro.props -const locale = getLocale(Astro); -const getLocalePath = getPath(locale); +const locale = getLocale(Astro) +const getLocalePath = getPath(locale) const { routes: { releaseNotes: { components: { releaseNoteItem }, }, }, -} = getUI(locale); +} = getUI(locale) -let date: Date | undefined; +let date: Date | undefined if (props.date) { - const [day, month, year] = props.date.split("/"); - date = new Date(Date.parse(`${year}-${month}-${day}`)); + const [day, month, year] = props.date.split('/') + date = new Date(Date.parse(`${year}-${month}-${day}`)) } -const ffVersion = getReleaseNoteFirefoxVersion(props); +const ffVersion = getReleaseNoteFirefoxVersion(props) const currentReleaseIndex = releaseNotesData.findIndex( (releaseNote: ReleaseNote) => releaseNote.version === props.version, -); -const prevReleaseNote = releaseNotesData[currentReleaseIndex + 1]; -let compareLink = ""; +) +const prevReleaseNote = releaseNotesData[currentReleaseIndex + 1] +let compareLink = '' if (prevReleaseNote && !isTwilight) { - compareLink = `https://github.com/zen-browser/desktop/compare/${prevReleaseNote.version}...${props.version}`; + compareLink = `https://github.com/zen-browser/desktop/compare/${prevReleaseNote.version}...${props.version}` } --- diff --git a/src/components/SocialMediaStrip.astro b/src/components/SocialMediaStrip.astro index ad1238e..ed22a5b 100644 --- a/src/components/SocialMediaStrip.astro +++ b/src/components/SocialMediaStrip.astro @@ -1,21 +1,21 @@ --- -const { gap = 4 } = Astro.props; +const { gap = 4 } = Astro.props -import { icon, library } from "@fortawesome/fontawesome-svg-core"; +import { icon, library } from '@fortawesome/fontawesome-svg-core' import { faBluesky, faGithub, faMastodon, faReddit, faXTwitter, -} from "@fortawesome/free-brands-svg-icons"; +} from '@fortawesome/free-brands-svg-icons' -library.add(faMastodon, faBluesky, faGithub, faXTwitter, faReddit); -const Mastodon = icon({ prefix: "fab", iconName: "mastodon" }); -const Bluesky = icon({ prefix: "fab", iconName: "bluesky" }); -const Github = icon({ prefix: "fab", iconName: "github" }); -const XTwitter = icon({ prefix: "fab", iconName: "x-twitter" }); -const Reddit = icon({ prefix: "fab", iconName: "reddit" }); +library.add(faMastodon, faBluesky, faGithub, faXTwitter, faReddit) +const Mastodon = icon({ prefix: 'fab', iconName: 'mastodon' }) +const Bluesky = icon({ prefix: 'fab', iconName: 'bluesky' }) +const Github = icon({ prefix: 'fab', iconName: 'github' }) +const XTwitter = icon({ prefix: 'fab', iconName: 'x-twitter' }) +const Reddit = icon({ prefix: 'fab', iconName: 'reddit' }) ---