Skip to content

fix(design): catch quoted font names in non-English custom properties - #94

Merged
fusengine merged 2 commits into
mainfrom
fix/design-font-quoted-prop
Jul 29, 2026
Merged

fix(design): catch quoted font names in non-English custom properties#94
fusengine merged 2 commits into
mainfrom
fix/design-font-quoted-prop

Conversation

@fusengine

Copy link
Copy Markdown
Owner

Summary

  • The typo gate recognized typography custom properties only via an English keyword in the property name (--*font*/--*ff*/--*type*). A French-named token like the corpus's --police-texte: "Inter", … (refs-design/linear-recode/styles.css:60) carried no such keyword and slipped through unbanned.
  • Adds FONT_QUOTED_PROP_RE: flags any --* custom property whose value quotes a forbidden font name, using the quote itself as the usage signal. Accepted trade-off, documented in the JSDoc: a quoted mention in a non-keyword property (e.g. --comment: "we never use Inter") is flagged too — indistinguishable from real usage without prose parsing.
  • Separate chore commit bumps CHANGELOG + package.json to 0.1.85 per repo convention (every commit gets its own release cycle).

Changes

  • src/policy/design/design-system-rules.ts (37 → 45 lines)
  • test/design-font-custom-prop.test.ts (new, 6 cases, mutation-checked)
  • CHANGELOG.md, package.json (version bump, separate commit)

Test plan

  • bun test — 987 pass / 1 skip / 0 fail (was 981/1/0 before; +6 tests, +1 file, exactly the additions)
  • bunx tsc --noEmit — exit 0
  • CI green (this PR)

Breaking changes

None.

The typo gate only recognized typography custom properties by an English
keyword in the property name (--*font*/--*ff*/--*type*). Tokens named in
French, like the corpus's --police-texte, carried no such keyword and
slipped through unbanned even when quoting a forbidden font (e.g.
refs-design/linear-recode/styles.css: --police-texte: "Inter", ...).

Add FONT_QUOTED_PROP_RE: any --* custom property whose value quotes one
of the forbidden names is flagged, using the quote itself as the usage
signal instead of an English keyword. Trade-off: a quoted mention in a
non-keyword property (e.g. --comment: "we never use Inter") is flagged
too, since it's indistinguishable from real usage without prose parsing.

Adds test/design-font-custom-prop.test.ts (6 cases, mutation-checked)
covering the two-line real-world fixture, all four banned names, the
existing English-keyword branch (regression guard), and the allowed-font
negative control.
@fusengine
fusengine merged commit 0bb5507 into main Jul 29, 2026
1 check passed
@fusengine
fusengine deleted the fix/design-font-quoted-prop branch July 29, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant