chore(biome): update line width biome config

This commit is contained in:
Shintaro Jokagi 2025-05-15 16:22:26 +12:00
parent 375285feb6
commit 088cc2a8f6
No known key found for this signature in database
GPG key ID: 0DDF8FA44C9A0DA8
9 changed files with 31 additions and 90 deletions

View file

@ -16,7 +16,7 @@
"enabled": true, "enabled": true,
"indentStyle": "space", "indentStyle": "space",
"indentWidth": 2, "indentWidth": 2,
"lineWidth": 100, "lineWidth": 128,
"useEditorconfig": true "useEditorconfig": true
}, },
"files": { "files": {

View file

@ -91,9 +91,7 @@ export default function ModsList({ allMods, locale }: ModsListProps) {
<button <button
type="button" type="button"
onClick={() => navigatePage(page - 1)} onClick={() => navigatePage(page - 1)}
className={`px-3 py-2 ${ className={`px-3 py-2 ${page === 1 ? 'pointer-events-none text-gray-400' : 'text-dark hover:text-gray-600'}`}
page === 1 ? 'pointer-events-none text-gray-400' : 'text-dark hover:text-gray-600'
}`}
> >
&lt; &lt;
</button> </button>
@ -112,9 +110,7 @@ export default function ModsList({ allMods, locale }: ModsListProps) {
} }
return ( return (
<span key={value} className="text-sm"> <span key={value} className="text-sm">
{value {value.replace('{totalPages}', totalPages.toString()).replace('{totalItems}', totalItems.toString())}
.replace('{totalPages}', totalPages.toString())
.replace('{totalItems}', totalItems.toString())}
</span> </span>
) )
})} })}
@ -122,11 +118,7 @@ export default function ModsList({ allMods, locale }: ModsListProps) {
<button <button
type="button" type="button"
onClick={() => navigatePage(page + 1)} onClick={() => navigatePage(page + 1)}
className={`px-3 py-2 ${ className={`px-3 py-2 ${page === totalPages ? 'pointer-events-none text-gray-400' : 'text-dark hover:text-gray-600'}`}
page === totalPages
? 'pointer-events-none text-gray-400'
: 'text-dark hover:text-gray-600'
}`}
> >
&gt; &gt;
</button> </button>

View file

@ -4,11 +4,7 @@ import { Info } from 'lucide-astro'
import { releaseNotes as releaseNotesData } from '~/release-notes' import { releaseNotes as releaseNotesData } from '~/release-notes'
import { getLocale, getPath, getUI } from '~/utils/i18n' import { getLocale, getPath, getUI } from '~/utils/i18n'
import { import { type BreakingChange, type ReleaseNote, getReleaseNoteFirefoxVersion } from '../release-notes'
type BreakingChange,
type ReleaseNote,
getReleaseNoteFirefoxVersion,
} from '../release-notes'
export type Props = ReleaseNote export type Props = ReleaseNote
const { isTwilight, ...props } = Astro.props const { isTwilight, ...props } = Astro.props
@ -29,9 +25,7 @@ if (props.date) {
} }
const ffVersion = getReleaseNoteFirefoxVersion(props) const ffVersion = getReleaseNoteFirefoxVersion(props)
const currentReleaseIndex = releaseNotesData.findIndex( const currentReleaseIndex = releaseNotesData.findIndex((releaseNote: ReleaseNote) => releaseNote.version === props.version)
(releaseNote: ReleaseNote) => releaseNote.version === props.version,
)
const prevReleaseNote = releaseNotesData[currentReleaseIndex + 1] const prevReleaseNote = releaseNotesData[currentReleaseIndex + 1]
let compareLink = '' let compareLink = ''
if (prevReleaseNote && !isTwilight) { if (prevReleaseNote && !isTwilight) {

View file

@ -2,13 +2,7 @@
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 { import { faBluesky, faGithub, faMastodon, faReddit, faXTwitter } from '@fortawesome/free-brands-svg-icons'
faBluesky,
faGithub,
faMastodon,
faReddit,
faXTwitter,
} from '@fortawesome/free-brands-svg-icons'
library.add(faMastodon, faBluesky, faGithub, faXTwitter, faReddit) library.add(faMastodon, faBluesky, faGithub, faXTwitter, faReddit)
const Mastodon = icon({ prefix: 'fab', iconName: 'mastodon' }) const Mastodon = icon({ prefix: 'fab', iconName: 'mastodon' })

View file

@ -57,7 +57,7 @@ import DownloadCard from './ButtonCard.astro'
/> />
</div> </div>
</div>} </div>}
{releases.x86_64 && 'tarball' in releases.x86_64 && <div> {releases.x86_64 && Object.hasOwn(releases.x86_64, 'tarball') && <div>
<h4 class="mb-3 text-lg font-medium">Tarball</h4> <h4 class="mb-3 text-lg font-medium">Tarball</h4>
<div class="grid grid-cols-1 gap-3 sm:grid-cols-2"> <div class="grid grid-cols-1 gap-3 sm:grid-cols-2">
<DownloadCard <DownloadCard
@ -85,7 +85,7 @@ import DownloadCard from './ButtonCard.astro'
checksum={releases.universal.checksum} checksum={releases.universal.checksum}
/> />
)} )}
{releases.x86_64 && 'tarball' in releases.x86_64 && releases.x86_64.tarball && releases.x86_64.tarball.label && ( {releases.x86_64 && Object.hasOwn(releases.x86_64, 'tarball') && releases.x86_64.tarball && releases.x86_64.tarball.label && (
<DownloadCard <DownloadCard
label={releases.x86_64.tarball.label} label={releases.x86_64.tarball.label}
href={releases.x86_64.tarball.link} href={releases.x86_64.tarball.link}

View file

@ -70,9 +70,7 @@ export function useModsSearch(mods: ZenTheme[]) {
searchParams.delete('limit') searchParams.delete('limit')
} }
const newUrl = `${window.location.pathname}${ const newUrl = `${window.location.pathname}${searchParams.toString() ? `?${searchParams.toString()}` : ''}`
searchParams.toString() ? `?${searchParams.toString()}` : ''
}`
if (state.page > 1) { if (state.page > 1) {
window.history.pushState({}, '', newUrl) window.history.pushState({}, '', newUrl)
@ -128,8 +126,7 @@ export function useModsSearch(mods: ZenTheme[]) {
const toggleCreatedSort = () => { const toggleCreatedSort = () => {
setState((prev) => ({ setState((prev) => ({
...prev, ...prev,
createdSort: createdSort: prev.createdSort === 'default' ? 'asc' : prev.createdSort === 'asc' ? 'desc' : 'default',
prev.createdSort === 'default' ? 'asc' : prev.createdSort === 'asc' ? 'desc' : 'default',
page: 1, // Reset page when sort changes page: 1, // Reset page when sort changes
})) }))
} }
@ -137,8 +134,7 @@ export function useModsSearch(mods: ZenTheme[]) {
const toggleUpdatedSort = () => { const toggleUpdatedSort = () => {
setState((prev) => ({ setState((prev) => ({
...prev, ...prev,
updatedSort: updatedSort: prev.updatedSort === 'default' ? 'asc' : prev.updatedSort === 'asc' ? 'desc' : 'default',
prev.updatedSort === 'default' ? 'asc' : prev.updatedSort === 'asc' ? 'desc' : 'default',
page: 1, // Reset page when sort changes page: 1, // Reset page when sort changes
})) }))
} }

View file

@ -12,8 +12,7 @@ const RSS_ENTRY_LIMIT = 20
*/ */
export function GET(context: { url: URL }) { export function GET(context: { url: URL }) {
// Just in case the release notes array is empty for whatever reason. // Just in case the release notes array is empty for whatever reason.
const latestDate = const latestDate = releaseNotes.length > 0 ? formatRssDate(releaseNotes[0].date as string) : new Date()
releaseNotes.length > 0 ? formatRssDate(releaseNotes[0].date as string) : new Date()
const rssData: RSSOptions = { const rssData: RSSOptions = {
title: 'Zen Browser Release Notes', title: 'Zen Browser Release Notes',
@ -87,10 +86,7 @@ function formatReleaseNote(releaseNote: ReleaseNote) {
content += `<p>${releaseNote.extra.replace(/(\n)/g, '<br />')}</p>` content += `<p>${releaseNote.extra.replace(/(\n)/g, '<br />')}</p>`
} }
content += addReleaseNoteSection( content += addReleaseNoteSection('⚠️ Breaking changes', releaseNote.breakingChanges?.map(breakingChangeToReleaseNote))
'⚠️ Breaking changes',
releaseNote.breakingChanges?.map(breakingChangeToReleaseNote),
)
content += addReleaseNoteSection('✓ Fixes', releaseNote.fixes?.map(fixToReleaseNote)) content += addReleaseNoteSection('✓ Fixes', releaseNote.fixes?.map(fixToReleaseNote))
content += addReleaseNoteSection('🖌 Theme Changes', releaseNote.themeChanges) content += addReleaseNoteSection('🖌 Theme Changes', releaseNote.themeChanges)
content += addReleaseNoteSection('⭐ Features', releaseNote.features) content += addReleaseNoteSection('⭐ Features', releaseNote.features)
@ -130,9 +126,7 @@ function fixToReleaseNote(fix?: Exclude<ReleaseNote['fixes'], undefined>[number]
return note return note
} }
function breakingChangeToReleaseNote( function breakingChangeToReleaseNote(breakingChange?: Exclude<ReleaseNote['breakingChanges'], undefined>[number]) {
breakingChange?: Exclude<ReleaseNote['breakingChanges'], undefined>[number],
) {
if (typeof breakingChange === 'string') { if (typeof breakingChange === 'string') {
return breakingChange return breakingChange
} }

View file

@ -601,10 +601,7 @@
"version": "1.0.0-a.30", "version": "1.0.0-a.30",
"date": "26/08/2024", "date": "26/08/2024",
"extra": "This release is the thirtieth alpha release of the 1.0.0-alpha series.", "extra": "This release is the thirtieth alpha release of the 1.0.0-alpha series.",
"features": [ "features": ["Added support for 24 more languages!", "Update installed mods from the browser settings"],
"Added support for 24 more languages!",
"Update installed mods from the browser settings"
],
"fixes": [ "fixes": [
{ {
"description": "Letterboxing option is missing", "description": "Letterboxing option is missing",
@ -932,11 +929,7 @@
"image": false, "image": false,
"workflowId": 11020784612, "workflowId": 11020784612,
"extra": "This update is a small patch to fix some issues that weren't addressed in the previous release!", "extra": "This update is a small patch to fix some issues that weren't addressed in the previous release!",
"features": [ "features": ["Moved application menu button to the right", "Added new shortcuts", "Collapsed tab sidebar is now smaller"],
"Moved application menu button to the right",
"Added new shortcuts",
"Collapsed tab sidebar is now smaller"
],
"fixes": [ "fixes": [
{ {
"description": "Fixed issue with hovering over window control buttons (macOS)" "description": "Fixed issue with hovering over window control buttons (macOS)"
@ -962,9 +955,7 @@
"Improved Expand Tabs on Hover layout" "Improved Expand Tabs on Hover layout"
], ],
"themeChanges": ["Toggle inputs will not use the themed tertiary color"], "themeChanges": ["Toggle inputs will not use the themed tertiary color"],
"breakingChanges": [ "breakingChanges": ["The keyboard shortcuts will be overriden by the defaults ones in this update"],
"The keyboard shortcuts will be overriden by the defaults ones in this update"
],
"fixes": [ "fixes": [
{ {
"description": "Fixed Firefox add-ons not updating", "description": "Fixed Firefox add-ons not updating",
@ -1140,10 +1131,7 @@
"description": "Fixed about page linking 'global Community' to a Mozilla page" "description": "Fixed about page linking 'global Community' to a Mozilla page"
} }
], ],
"features": [ "features": ["About page will now display the Firefox version used", "Disabled forcing container grouping for workspaces"]
"About page will now display the Firefox version used",
"Disabled forcing container grouping for workspaces"
]
}, },
{ {
"version": "1.0.1-a.11", "version": "1.0.1-a.11",
@ -1284,9 +1272,7 @@
"description": "Fixed sidebar webpanels being in a darker contrast" "description": "Fixed sidebar webpanels being in a darker contrast"
} }
], ],
"features": [ "features": ["Added a confirmation dialog when the gradient generator has successfully saved the gradient"]
"Added a confirmation dialog when the gradient generator has successfully saved the gradient"
]
}, },
{ {
"version": "1.0.1-a.15", "version": "1.0.1-a.15",
@ -2142,10 +2128,7 @@
"date": "30/01/2025", "date": "30/01/2025",
"workflowId": 13062083313, "workflowId": 13062083313,
"extra": "Quick fix for a critical bug that was introduced in the previous release.", "extra": "Quick fix for a critical bug that was introduced in the previous release.",
"fixes": [ "fixes": ["Fixed the browser not opening when having multiple windows", "Fixed macos fullscreen having a weird shadow"]
"Fixed the browser not opening when having multiple windows",
"Fixed macos fullscreen having a weird shadow"
]
}, },
{ {
"version": "1.7.5b", "version": "1.7.5b",
@ -2204,9 +2187,7 @@
"Fixed opening glance tabs on essentials messing up the sidebar", "Fixed opening glance tabs on essentials messing up the sidebar",
"Fixed pinned tabs appearing on normal container after a restart" "Fixed pinned tabs appearing on normal container after a restart"
], ],
"features": [ "features": ["Tabs can now be dragged into pinned tabs by dragging them into the workspace indicator"],
"Tabs can now be dragged into pinned tabs by dragging them into the workspace indicator"
],
"workflowId": 13209591935, "workflowId": 13209591935,
"date": "08/02/2025" "date": "08/02/2025"
}, },
@ -2739,10 +2720,7 @@
"version": "1.12.5b", "version": "1.12.5b",
"image": false, "image": false,
"extra": "", "extra": "",
"fixes": [ "fixes": ["Fixed a weird shadow with the URL bar.", "Fixed all tabs button appearing unexpectedly."],
"Fixed a weird shadow with the URL bar.",
"Fixed all tabs button appearing unexpectedly."
],
"features": [], "features": [],
"workflowId": 15024223699, "workflowId": 15024223699,
"date": "14/05/2025" "date": "14/05/2025"

View file

@ -44,9 +44,7 @@ export const locales = CONSTANT.I18N.LOCALES.map(({ value }) => value)
* List of locales excluding the default locale * List of locales excluding the default locale
* @type {Locale[]} * @type {Locale[]}
*/ */
const otherLocales = CONSTANT.I18N.LOCALES.filter( const otherLocales = CONSTANT.I18N.LOCALES.filter(({ value }) => value !== CONSTANT.I18N.DEFAULT_LOCALE)
({ value }) => value !== CONSTANT.I18N.DEFAULT_LOCALE,
)
/** /**
* Retrieves locales other than the default locale * Retrieves locales other than the default locale
@ -108,10 +106,7 @@ export const getUI = (locale?: Locale | string): UI => {
typeof overrideValue === 'object' typeof overrideValue === 'object'
) { ) {
// Type assertion to handle nested merging // Type assertion to handle nested merging
;(result as Record<keyof T, unknown>)[key] = deepMerge( ;(result as Record<keyof T, unknown>)[key] = deepMerge(defaultValue as object, overrideValue as Partial<object>)
defaultValue as object,
overrideValue as Partial<object>,
)
} else if (overrideValue !== undefined) { } else if (overrideValue !== undefined) {
// Override with the new value if it exists // Override with the new value if it exists
;(result as Record<keyof T, unknown>)[key] = overrideValue ;(result as Record<keyof T, unknown>)[key] = overrideValue
@ -142,14 +137,12 @@ export const getStaticPaths = (() => {
params: { locale: undefined }, params: { locale: undefined },
props: { locale: CONSTANT.I18N.DEFAULT_LOCALE }, props: { locale: CONSTANT.I18N.DEFAULT_LOCALE },
}, },
...CONSTANT.I18N.LOCALES.filter(({ value }) => value !== CONSTANT.I18N.DEFAULT_LOCALE).map( ...CONSTANT.I18N.LOCALES.filter(({ value }) => value !== CONSTANT.I18N.DEFAULT_LOCALE).map(({ value }) => ({
({ value }) => ({ params: { locale: value },
params: { locale: value }, props: {
props: { locale: value,
locale: value, },
}, })),
}),
),
] ]
}) satisfies GetStaticPaths }) satisfies GetStaticPaths