Skip to content

lint should warn when frontmatter token-like fields are ignored by export #100

@NickAnthony

Description

@NickAnthony

Summary

design.md lint should warn when frontmatter contains token-like fields that will be ignored by exporters.

Right now, a DESIGN.md file can contain explicit design-token data, pass lint, and then export incomplete Tailwind output because the token-like fields are not part of the recognized schema.

Why this matters

My use case is to have an LLM generate a DESIGN.md file, then use design.md lint to tell the agent how to fix it before exporting tokens.

A successful lint plus successful export implies the exported Tailwind theme represents the DESIGN.md. In this case, export silently drops the color palette, so downstream agents or build tools may trust an incomplete Tailwind config.

Reproduction

Given a DESIGN.md file like:

---
brand_name: "Example"
base_colors:
  ink: "#0B0F14"
  paper: "#F6F7FA"
semantic_colors:
  background: "#F6F7FA"
  foreground: "#0B0F14"
typography:
  body:
    fontFamily: "Inter"
---

Run:

npx --yes @google/design.md@0.2.0 lint --format json DESIGN.md
npx --yes @google/design.md@0.2.0 export --format json-tailwind DESIGN.md

Observed export:

{
  "theme": {
    "extend": {
      "colors": {},
      "fontFamily": {
        "body": ["Inter"]
      }
    }
  }
}

Expected behavior

lint should warn that base_colors and semantic_colors are not recognized token fields and will not be exported.

More generally, lint should warn when unsupported frontmatter fields look like design tokens, such as:

  • maps containing hex color values
  • maps containing typography properties like fontFamily
  • maps containing dimensions or spacing-like values
  • DTCG-like token objects with $value / $type

Version

@google/design.md@0.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions