From d6919e340bd02895b464b37aa03d5e184555c40b Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sat, 25 Apr 2026 22:34:53 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- src/components/typography/combobox.tsx | 9 +-------- src/utils/fonts.test.ts | 8 +------- src/utils/fonts.ts | 5 +++-- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/components/typography/combobox.tsx b/src/components/typography/combobox.tsx index 5b9ab61e2..8163af171 100644 --- a/src/components/typography/combobox.tsx +++ b/src/components/typography/combobox.tsx @@ -1,13 +1,6 @@ import { useMemo } from "react"; -import { - fontList, - getFont, - getFontDisplayName, - getFontSearchKeywords, - localFontList, - webFontMap, -} from "@/utils/fonts"; +import { fontList, getFont, getFontDisplayName, getFontSearchKeywords, localFontList, webFontMap } from "@/utils/fonts"; import { cn } from "@/utils/style"; import { Combobox, type MultiComboboxProps, type SingleComboboxProps } from "../ui/combobox"; diff --git a/src/utils/fonts.test.ts b/src/utils/fonts.test.ts index 77001569b..5567c3fc2 100644 --- a/src/utils/fonts.test.ts +++ b/src/utils/fonts.test.ts @@ -56,13 +56,7 @@ describe("buildResumeFontFamily", () => { it("uses sans-oriented Chinese fallbacks for sans body fonts", () => { const fonts = splitFontStack(buildResumeFontFamily("Inter")); - expect(fonts.slice(0, 5)).toEqual([ - "Inter", - "Noto Sans SC", - "PingFang SC", - "Hiragino Sans GB", - "Microsoft YaHei", - ]); + expect(fonts.slice(0, 5)).toEqual(["Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei"]); expect(fonts.at(-1)).toBe("sans-serif"); }); }); diff --git a/src/utils/fonts.ts b/src/utils/fonts.ts index 31dd25ef4..c6a930c80 100644 --- a/src/utils/fonts.ts +++ b/src/utils/fonts.ts @@ -1,4 +1,5 @@ import type { LocalFont, WebFont } from "@/components/typography/types"; + import webFontListJSON from "@/components/typography/webfontlist.json"; type FontCategory = LocalFont["category"]; @@ -172,8 +173,8 @@ export function getLoadableWebFontWeights(family: string, preferredWeights: stri if (!font) return []; const availableWeights = new Set(font.weights); - const matchingWeights = unique(preferredWeights).filter( - (weight): weight is FontWeight => availableWeights.has(weight as FontWeight), + const matchingWeights = unique(preferredWeights).filter((weight): weight is FontWeight => + availableWeights.has(weight as FontWeight), ); if (matchingWeights.length > 0) return matchingWeights;