From bcb1427a792a407cd45eea85494ecca7b47ce168 Mon Sep 17 00:00:00 2001 From: Shintaro Jokagi Date: Thu, 15 May 2025 13:52:37 +1200 Subject: [PATCH] feat(lint): add biome formatter and linter, husky and lint-staged This commit adds the Biome formatter and linter to replace Prettier, including: - Add biome.json config file - Add pre-commit hook with Husky - Configure GitHub Action to run Biome checks - Apply Biome formatting rules to codebase - Remove Prettier dependencies --- .github/workflows/prbuildcheck.yml | 3 + .husky/pre-commit | 4 + biome.json | 25 ++ package-lock.json | 275 ++++++++++++------ package.json | 16 +- src/animations.ts | 8 +- src/components/BackButton.astro | 8 +- src/components/Button.astro | 16 +- src/components/Circles.astro | 6 +- src/components/Community.astro | 20 +- src/components/Features.astro | 28 +- src/components/Footer.astro | 18 +- src/components/Hero.astro | 34 +-- src/components/Logo.astro | 2 +- src/components/MobileMenu.astro | 8 +- src/components/ModsList.tsx | 101 ++++--- 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 | 80 +++-- src/components/download/release-data.astro | 48 +-- src/constants/i18n.ts | 6 +- src/constants/index.ts | 4 +- src/hooks/useModsSearch.ts | 155 +++++----- src/layouts/Layout.astro | 12 +- src/mods.ts | 48 +-- src/pages/404.astro | 2 +- src/pages/[...locale]/404.astro | 18 +- src/pages/[...locale]/about.astro | 4 +- src/pages/[...locale]/donate.astro | 16 +- src/pages/[...locale]/download.astro | 49 ++-- src/pages/[...locale]/feed.xml.ts | 122 ++++---- 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 | 20 +- .../[...locale]/release-notes/index.astro | 25 +- src/pages/[...locale]/welcome.astro | 12 +- src/pages/[...locale]/whatsnew.astro | 35 +-- src/release-notes.ts | 48 ++- src/release-notes/stable.json | 59 +--- src/release-notes/twilight.json | 2 +- src/utils/githubChecksums.ts | 38 ++- src/utils/i18n.ts | 126 ++++---- 50 files changed, 904 insertions(+), 793 deletions(-) create mode 100644 .husky/pre-commit create mode 100644 biome.json diff --git a/.github/workflows/prbuildcheck.yml b/.github/workflows/prbuildcheck.yml index f582c21..2d1f4de 100644 --- a/.github/workflows/prbuildcheck.yml +++ b/.github/workflows/prbuildcheck.yml @@ -21,5 +21,8 @@ jobs: - name: Install dependencies run: npm install --no-frozen-lockfile + - name: Run Biome check + run: npx biome check ./src + - name: Build project run: npm run build diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..d24fdfc --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npx lint-staged diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..f9ce8ee --- /dev/null +++ b/biome.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 2, + "lineWidth": 100 + }, + "files": { + "ignore": [ + "node_modules", + ".git", + "dist" + ] + } +} diff --git a/package-lock.json b/package-lock.json index 7764524..c40dd25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,14 +28,13 @@ "motion": "^11.13.5", "postcss": "^8.5.1", "preact": "^10.26.2", - "prettier": "^3.3.3", - "prettier-plugin-astro": "^0.14.1", - "prettier-plugin-tailwindcss": "^0.6.6", "sharp": "^0.33.5", "tailwindcss": "^3.4.15", "typescript": "^5.6.3" }, "devDependencies": { + "@biomejs/biome": "^1.9.4", + "husky": "^9.1.7", "wrangler": "^3.94.0" } }, @@ -843,6 +842,170 @@ "node": ">=6.9.0" } }, + "node_modules/@biomejs/biome": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz", + "integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==", + "dev": true, + "hasInstallScript": true, + "license": "MIT OR Apache-2.0", + "bin": { + "biome": "bin/biome" + }, + "engines": { + "node": ">=14.21.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/biome" + }, + "optionalDependencies": { + "@biomejs/cli-darwin-arm64": "1.9.4", + "@biomejs/cli-darwin-x64": "1.9.4", + "@biomejs/cli-linux-arm64": "1.9.4", + "@biomejs/cli-linux-arm64-musl": "1.9.4", + "@biomejs/cli-linux-x64": "1.9.4", + "@biomejs/cli-linux-x64-musl": "1.9.4", + "@biomejs/cli-win32-arm64": "1.9.4", + "@biomejs/cli-win32-x64": "1.9.4" + } + }, + "node_modules/@biomejs/cli-darwin-arm64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz", + "integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-darwin-x64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz", + "integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz", + "integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64-musl": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz", + "integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz", + "integrity": "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64-musl": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz", + "integrity": "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-arm64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz", + "integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-x64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz", + "integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, "node_modules/@capsizecss/unpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@capsizecss/unpack/-/unpack-2.4.0.tgz", @@ -4959,6 +5122,22 @@ "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "license": "BSD-2-Clause" }, + "node_modules/husky": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", + "dev": true, + "license": "MIT", + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/import-meta-resolve": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", @@ -6830,6 +7009,8 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.2.tgz", "integrity": "sha512-lc6npv5PH7hVqozBR7lkBNOGXV9vMwROAPlumdBkX0wTbbzPu/U1hk5yL8p2pt4Xoc+2mkT8t/sow2YrV/M5qg==", "license": "MIT", + "optional": true, + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -6845,6 +7026,8 @@ "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.14.1.tgz", "integrity": "sha512-RiBETaaP9veVstE4vUwSIcdATj6dKmXljouXc/DDNwBSPTp8FRkLGDSGFClKsAFeeg+13SB0Z1JZvbD76bigJw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@astrojs/compiler": "^2.9.1", "prettier": "^3.0.0", @@ -6854,84 +7037,6 @@ "node": "^14.15.0 || >=16.0.0" } }, - "node_modules/prettier-plugin-tailwindcss": { - "version": "0.6.11", - "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.6.11.tgz", - "integrity": "sha512-YxaYSIvZPAqhrrEpRtonnrXdghZg1irNg4qrjboCXrpybLWVs55cW2N3juhspVJiO0JBvYJT8SYsJpc8OQSnsA==", - "license": "MIT", - "engines": { - "node": ">=14.21.3" - }, - "peerDependencies": { - "@ianvs/prettier-plugin-sort-imports": "*", - "@prettier/plugin-pug": "*", - "@shopify/prettier-plugin-liquid": "*", - "@trivago/prettier-plugin-sort-imports": "*", - "@zackad/prettier-plugin-twig": "*", - "prettier": "^3.0", - "prettier-plugin-astro": "*", - "prettier-plugin-css-order": "*", - "prettier-plugin-import-sort": "*", - "prettier-plugin-jsdoc": "*", - "prettier-plugin-marko": "*", - "prettier-plugin-multiline-arrays": "*", - "prettier-plugin-organize-attributes": "*", - "prettier-plugin-organize-imports": "*", - "prettier-plugin-sort-imports": "*", - "prettier-plugin-style-order": "*", - "prettier-plugin-svelte": "*" - }, - "peerDependenciesMeta": { - "@ianvs/prettier-plugin-sort-imports": { - "optional": true - }, - "@prettier/plugin-pug": { - "optional": true - }, - "@shopify/prettier-plugin-liquid": { - "optional": true - }, - "@trivago/prettier-plugin-sort-imports": { - "optional": true - }, - "@zackad/prettier-plugin-twig": { - "optional": true - }, - "prettier-plugin-astro": { - "optional": true - }, - "prettier-plugin-css-order": { - "optional": true - }, - "prettier-plugin-import-sort": { - "optional": true - }, - "prettier-plugin-jsdoc": { - "optional": true - }, - "prettier-plugin-marko": { - "optional": true - }, - "prettier-plugin-multiline-arrays": { - "optional": true - }, - "prettier-plugin-organize-attributes": { - "optional": true - }, - "prettier-plugin-organize-imports": { - "optional": true - }, - "prettier-plugin-sort-imports": { - "optional": true - }, - "prettier-plugin-style-order": { - "optional": true - }, - "prettier-plugin-svelte": { - "optional": true - } - } - }, "node_modules/printable-characters": { "version": "1.0.42", "resolved": "https://registry.npmjs.org/printable-characters/-/printable-characters-1.0.42.tgz", @@ -7448,13 +7553,17 @@ "version": "0.0.15", "resolved": "https://registry.npmjs.org/s.color/-/s.color-0.0.15.tgz", "integrity": "sha512-AUNrbEUHeKY8XsYr/DYpl+qk5+aM+DChopnWOPEzn8YKzOhv4l2zH6LzZms3tOZP3wwdOyc0RmTciyi46HLIuA==", - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/sass-formatter": { "version": "0.7.9", "resolved": "https://registry.npmjs.org/sass-formatter/-/sass-formatter-0.7.9.tgz", "integrity": "sha512-CWZ8XiSim+fJVG0cFLStwDvft1VI7uvXdCNJYXhDvowiv+DsbD1nXLiQ4zrE5UBvj5DWZJ93cwN0NX5PMsr1Pw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "suf-log": "^2.5.3" } @@ -7855,6 +7964,8 @@ "resolved": "https://registry.npmjs.org/suf-log/-/suf-log-2.5.3.tgz", "integrity": "sha512-KvC8OPjzdNOe+xQ4XWJV2whQA0aM1kGVczMQ8+dStAO6KfEB140JEVQ9dE76ONZ0/Ylf67ni4tILPJB41U0eow==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "s.color": "0.0.15" } diff --git a/package.json b/package.json index cc6506e..0dabc06 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,10 @@ "build": "astro check && astro build", "preview": "astro preview --port 3000", "wrangler": "wrangler", - "astro": "astro" + "astro": "astro", + "lint": "biome lint ./src", + "format": "biome format ./src --write", + "prepare": "husky" }, "dependencies": { "@astrojs/check": "^0.9.4", @@ -31,14 +34,19 @@ "motion": "^11.13.5", "postcss": "^8.5.1", "preact": "^10.26.2", - "prettier": "^3.3.3", - "prettier-plugin-astro": "^0.14.1", - "prettier-plugin-tailwindcss": "^0.6.6", "sharp": "^0.33.5", "tailwindcss": "^3.4.15", "typescript": "^5.6.3" }, "devDependencies": { + "@biomejs/biome": "^1.9.4", + "husky": "^9.1.7", + "lint-staged": "^15.2.7", "wrangler": "^3.94.0" + }, + "lint-staged": { + "src/**/*.{ts,tsx,astro,js,jsx}": [ + "biome lint --apply" + ] } } diff --git a/src/animations.ts b/src/animations.ts index bedae27..0e11de6 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 2397d41..c0074d5 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 ( @@ -159,6 +157,7 @@ export default function ModsList({ allMods, locale }: ModsListProps) { > {mods.sort.lastCreated} {mods.sort.lastUpdated}

- {mod.name}{' '} - - by @{mod.author} - + {mod.name} by @{mod.author}

{mod.description}

@@ -237,5 +234,5 @@ export default function ModsList({ allMods, locale }: ModsListProps) { {renderPagination()} - ) + ); } diff --git a/src/components/NavBar.astro b/src/components/NavBar.astro index bb39314..9f3ab98 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 d4de504..eeae398 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 +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 ed22a5b..ad1238e 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" }); ---
    diff --git a/src/components/Sponsors.astro b/src/components/Sponsors.astro index cbc6297..da8817a 100644 --- a/src/components/Sponsors.astro +++ b/src/components/Sponsors.astro @@ -1,21 +1,21 @@ --- -import { motion } from 'motion/react' -import { getTitleAnimation } from '~/animations' -import Description from '~/components/Description.astro' -import { getLocale, getUI } from '~/utils/i18n' +import { motion } from "motion/react"; +import { getTitleAnimation } from "~/animations"; +import Description from "~/components/Description.astro"; +import { getLocale, getUI } from "~/utils/i18n"; -const locale = getLocale(Astro) +const locale = getLocale(Astro); -import tutaLogo from '~/assets/tuta-logo.png' +import tutaLogo from "~/assets/tuta-logo.png"; -import Image from 'astro/components/Image.astro' -const { showSponsors = true } = Astro.props +import Image from "astro/components/Image.astro"; +const { showSponsors = true } = Astro.props; const { routes: { index: { sponsors }, }, -} = getUI(locale) +} = getUI(locale); ---
    diff --git a/src/components/ThemeSwitch.astro b/src/components/ThemeSwitch.astro index 39b4025..a294e98 100644 --- a/src/components/ThemeSwitch.astro +++ b/src/components/ThemeSwitch.astro @@ -1,10 +1,10 @@ --- interface Props { - label?: string - className?: string + label?: string; + className?: string; } -const { label, className = '' } = Astro.props +const { label, className = "" } = Astro.props; ---