From 17daae9a1f42d8c7b6480b5597163799f192cc67 Mon Sep 17 00:00:00 2001 From: Akshar Patel Date: Thu, 22 Oct 2026 16:05:38 -0400 Subject: [PATCH] fix(lint): accept final font-family descriptors without semicolons --- docs/reference/lint-rules.mdx | 2 ++ packages/lint/src/rules/fonts.test.ts | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/reference/lint-rules.mdx b/docs/reference/lint-rules.mdx index 4c8c63b27bc..ddf0e49e62e 100644 --- a/docs/reference/lint-rules.mdx +++ b/docs/reference/lint-rules.mdx @@ -730,6 +730,8 @@ Source: `packages/lint/src/rules/fonts.ts`. **Fix:** Declare each family with `@font-face` pointing at the captured `.woff2` files, or bundle the font under `capture/assets/fonts/`. +The declaration may use a quoted or unquoted family name. If `font-family` is the last descriptor in the block, its final semicolon is optional. + ### `system_font_will_alias` **Warning.** A system font family is used without a matching `@font-face`; in distributed rendering system-font capture is disabled, so the font is substituted at render time and text can reflow. Only reported when the linter runs with the `distributed: true` option (linting for distributed or Lambda renders); a local render captures the system font as designed, so it is not flagged there. diff --git a/packages/lint/src/rules/fonts.test.ts b/packages/lint/src/rules/fonts.test.ts index fdbabb76696..f57df3bbee0 100644 --- a/packages/lint/src/rules/fonts.test.ts +++ b/packages/lint/src/rules/fonts.test.ts @@ -239,6 +239,20 @@ p { FONT-FAMILY: "Real Brand", sans-serif !important; } expect(findings).toHaveLength(0); }); + it.each(["ProjectFont", "Project Font"])( + "recognizes an unquoted final font-family descriptor without a semicolon: %s", + async (family) => { + const html = `
+ +
`; + const findings = await findByCode(html, "font_family_without_font_face"); + expect(findings).toHaveLength(0); + }, + ); + it("does not flag a system font declared via @font-face src: local()", async () => { // Regression: two independent reports of this rule hard-erroring on OS // system fonts (Hiragino Sans, Microsoft YaHei) that have no downloadable