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
This commit is contained in:
Shintaro Jokagi 2025-05-15 13:52:37 +12:00
parent b4e5fe2bea
commit bcb1427a79
No known key found for this signature in database
GPG key ID: 0DDF8FA44C9A0DA8
50 changed files with 904 additions and 793 deletions

View file

@ -1,43 +1,41 @@
import releaseNotesStable from './release-notes/stable.json'
import releaseNotesStable from "./release-notes/stable.json";
interface FixWithIssue {
description: string
issue?: number
description: string;
issue?: number;
}
type Fix = string | FixWithIssue
type Fix = string | FixWithIssue;
export type BreakingChange = string | { description: string; link: string }
export type BreakingChange = string | { description: string; link: string };
export interface ReleaseNote {
version: string
date?: string // optional for twilight
extra?: string
image?: boolean
fixes?: Fix[]
features?: string[]
breakingChanges?: BreakingChange[]
themeChanges?: string[]
inProgress?: boolean
workflowId?: number
isTwilight?: boolean
version: string;
date?: string; // optional for twilight
extra?: string;
image?: boolean;
fixes?: Fix[];
features?: string[];
breakingChanges?: BreakingChange[];
themeChanges?: string[];
inProgress?: boolean;
workflowId?: number;
isTwilight?: boolean;
}
export const releaseNotes: ReleaseNote[] = releaseNotesStable.reverse()
export { default as releaseNotesTwilight } from './release-notes/twilight.json'
export const releaseNotes: ReleaseNote[] = releaseNotesStable.reverse();
export { default as releaseNotesTwilight } from "./release-notes/twilight.json";
export function getReleaseNoteFirefoxVersion(
releaseNote: ReleaseNote,
): string | null {
export function getReleaseNoteFirefoxVersion(releaseNote: ReleaseNote): string | null {
// Check if "firefox" is on the feature list
for (const feature of releaseNote.features || []) {
if (feature.toLowerCase().includes('firefox')) {
if (feature.toLowerCase().includes("firefox")) {
// may be X or X.X or X.X.X
const match = feature.match(/(\d+(\.\d+){0,2})/)
const match = feature.match(/(\d+(\.\d+){0,2})/);
if (match) {
return match[0]
return match[0];
}
}
}
return null
return null;
}