Problem
The parser silently discards unknown top-level YAML keys. ParserHandler.toDesignSystem builds the design system from a fixed whitelist (name, description, colors, typography, rounded, spacing, components); any key not in that list is dropped without an error or a warning. A misspelled section name therefore disappears with no signal to the author:
---
name: "Example"
colours: # typo for `colors` — silently ignored
primary: "#E30613"
---
lint reports no findings for the colours block, and downstream missing-sections even reports colors as absent — the author is told the opposite of what they intended, with no hint that a typo is the cause. There is currently no way for a user to notice this class of mistake.
Proposal
Add a lint rule that warns when the front matter contains a top-level key that is not part of the known schema.
Known top-level keys (allowlist): name, description, colors, typography, rounded, spacing, components, version.
New linting rule
| Rule |
Severity |
What it checks |
unknown-key |
warning |
A top-level front-matter key is not part of the known schema |
Proposed message
Unexpected unknown top-level key "colours"
Example output
{
"findings": [
{
"severity": "warning",
"path": "colours",
"message": "Unexpected unknown top-level key \"colours\""
}
],
"summary": { "errors": 0, "warnings": 1, "infos": 0 }
}
Version
@google/design.md 0.1.1
Problem
The parser silently discards unknown top-level YAML keys.
ParserHandler.toDesignSystembuilds the design system from a fixed whitelist (name,description,colors,typography,rounded,spacing,components); any key not in that list is dropped without an error or a warning. A misspelled section name therefore disappears with no signal to the author:lintreports no findings for thecoloursblock, and downstreammissing-sectionseven reportscolorsas absent — the author is told the opposite of what they intended, with no hint that a typo is the cause. There is currently no way for a user to notice this class of mistake.Proposal
Add a lint rule that warns when the front matter contains a top-level key that is not part of the known schema.
Known top-level keys (allowlist):
name,description,colors,typography,rounded,spacing,components,version.New linting rule
unknown-keyProposed message
Example output
{ "findings": [ { "severity": "warning", "path": "colours", "message": "Unexpected unknown top-level key \"colours\"" } ], "summary": { "errors": 0, "warnings": 1, "infos": 0 } }Version
@google/design.md0.1.1