Skip to content

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

Open
rmyndharis wants to merge 1 commit into
google-labs-code:mainfrom
rmyndharis:feat/flag-unknown-typography-props
Open

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

Conversation

@rmyndharis

Copy link
Copy Markdown

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.
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