import { FONT_ALIAS_KEYS, resolveAliasDisplayName } from "@hyperframes/parsers/composition"; import type { LintContext, HyperframeLintFinding } from "../context"; import { isRegistrySourceFile, isRegistryInstalledFile } from "./composition"; const GENERIC_FAMILIES = new Set([ "serif", "sans-serif", "monospace", "cursive", "fantasy", "system-ui", "ui-serif", "ui-sans-serif", "ui-monospace", "ui-rounded", "math", "emoji", "fangsong", // Vendor-prefixed system-font keywords. Like `system-ui`, the engine resolves // these to the OS UI font — they are never installable files and must not be // flagged as a missing @font-face, even when a generic fallback follows them // (e.g. `-apple-system, system-ui, sans-serif`). "-apple-system", "blinkmacsystemfont", "inherit", "initial", "unset", "revert", ]); // A CSS comment can contain a `}` (e.g. `@font-face { /* 400 } regular */ // font-family: 'X'; ... }`), which truncates the naive `@font-face\s*\{[^}]*\}` // block match at the comment's brace — so the rule never sees the real // `font-family` and reports a false-positive font_family_without_font_face. // Large/"framework" stylesheets hit this far more often than minimal ones, // which is why a simple