| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Add a new lint rule, prose-token-leak, to flag literal token value duplication in markdown body text to prevent documentation drift (Issue google-labs-code#16). * Extend Model State: - Add 'documentSections' to DesignSystemState type interface and forward it inside the model compilation handler. * Rule Implementation & Registration: - Add 'prose-token-leak.ts' containing regex evaluation of CSS dimensions and hex values, omitting markdown links, HTML tags/comments, headings, and code blocks. - Register the rule in index.ts and update test assertions to expect 12 rule descriptors. * Documentation: - Update spec.mdx to describe the prose token replication policy, and compile docs/spec.md.
|
Also, future extensions might/could include:
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Added a new lint rule, prose-token-leak, to flag literal token value duplication in markdown body text to prevent documentation drift (resolves Issue #16).
Background & Motivation
The spec explicity separates machine-readable tokens (YAML frontmatter) and human-readable context (markdown body). When authors duplicate literal values (such as hex colors #ffffff, functional colors rgb(...) / hsl(...), or dimensions 16px) in their prose descriptions or tables, it introduces a dual source of truth. If token values are updated, the prose is frequently forgotten and drifts out of sync.
As discussed in Issue #16, there is community consensus that:
This rule builds on the pattern established in PR #155 (custom linter checks and omitted-sections validations) by keeping standard linter warnings as the primary gate for format compliance.
Relation to other PRs
Changes