Skip to content

feat(lint): flag unrecognized typography sub-properties#125

Merged
davideast merged 1 commit into
google-labs-code:mainfrom
rmyndharis:feat/flag-unknown-typography-props
Jul 22, 2026
Merged

feat(lint): flag unrecognized typography sub-properties#125
davideast merged 1 commit into
google-labs-code:mainfrom
rmyndharis:feat/flag-unknown-typography-props

Conversation

@rmyndharis

Copy link
Copy Markdown
Contributor

Summary

Typography sub-properties outside the schema — fontFamily, fontSize, fontWeight, lineHeight, letterSpacing, fontFeature, fontVariation — were silently dropped by the model: never resolved, never emitted to Tailwind/DTCG, and with no finding. A typo (fontwight) or an unsupported property (textTransform, color) simply vanished, looking identical to "the linter didn't notice."

This mirrors the existing treatment of unknown component sub-tokens, which the broken-ref rule already reports as a warning ("'X' is not a recognized component sub-token").

Change

parseTypography now emits a warning for each sub-property not in the schema, e.g.:

'textTransform' is not a recognized typography property. Valid properties: fontFamily, fontSize, fontWeight, lineHeight, letterSpacing, fontFeature, fontVariation.

Recognized properties resolve exactly as before. Warnings don't affect the exit code (only errors do), so this is additive.

Testing

  • bun test: 283 pass, 1 skip, 0 fail (added a test: an unknown textTransform warns at typography.<token>.textTransform while fontFamily still resolves and never warns).
  • bun run lint (tsc --noEmit): clean.
  • Verified no existing fixture or test uses a non-standard typography property, so no current case newly warns.

A typography token's sub-properties outside the schema (fontFamily,
fontSize, fontWeight, lineHeight, letterSpacing, fontFeature, fontVariation)
were silently dropped by the model — never resolved, never exported, and
with no diagnostic, so a typo like `fontwight` or an unsupported property
like `textTransform` vanished without a trace. Emit a warning for each,
mirroring how unknown component sub-tokens are already reported.

@davideast davideast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you (again) @rmyndharis!

@davideast
davideast merged commit 2513a54 into google-labs-code:main Jul 22, 2026
9 checks passed
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.

2 participants