diff --git a/docs/reference/lint-rules.mdx b/docs/reference/lint-rules.mdx index d198134be1..d99159a915 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 6afa663bbe..2deb5e4971 100644 --- a/packages/lint/src/rules/fonts.test.ts +++ b/packages/lint/src/rules/fonts.test.ts @@ -119,6 +119,20 @@ describe("font rules", () => { expect(findings).toHaveLength(0); }); + it.each(["ProjectFont", "Project Font"])( + "recognizes an unquoted final font-family descriptor without a semicolon: %s", + async (family) => { + const html = `