Some checks failed
DSS Project Analysis / dss-context-update (push) Has been cancelled
Complete implementation of enterprise design system validation: Phase 1 - @dss/rules npm package: - CLI with validate and init commands - 16 rules across 5 categories (colors, spacing, typography, components, a11y) - dss-ignore support (inline and next-line) - Break-glass [dss-skip] for emergency merges - CI workflow templates (Gitea, GitHub, GitLab) Phase 2 - Metrics dashboard: - FastAPI metrics API with SQLite storage - Portfolio-wide metrics aggregation - Project drill-down with file:line:column violations - Trend charts and history tracking Phase 3 - Local analysis cache: - LocalAnalysisCache for offline-capable validation - Mode detection (LOCAL/REMOTE/CI) - Stale cache warnings with recommendations Phase 4 - Project onboarding: - dss-init command for project setup - Creates ds.config.json, .dss/ folder structure - Updates .gitignore and package.json scripts - Optional CI workflow setup Architecture decisions: - No commit-back: CI uploads to dashboard, not git - Three-tier: Dashboard (read-only) → CI (authoritative) → Local (advisory) - Pull-based rules via npm for version control 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
80 lines
2.5 KiB
JSON
80 lines
2.5 KiB
JSON
{
|
|
"$schema": "../schemas/rule.schema.json",
|
|
"id": "components",
|
|
"version": "1.0.0",
|
|
"name": "Component Usage Rules",
|
|
"description": "Rules for component implementation and usage patterns",
|
|
"category": "components",
|
|
"severity": "error",
|
|
"rules": [
|
|
{
|
|
"id": "use-design-system-components",
|
|
"name": "Use Design System Components",
|
|
"description": "Prefer design system components over native HTML or custom implementations",
|
|
"severity": "error",
|
|
"components": {
|
|
"required": {
|
|
"Button": {
|
|
"import": "@dss/components",
|
|
"forbiddenAlternatives": ["button", "a.btn", "div[role=button]"]
|
|
},
|
|
"Input": {
|
|
"import": "@dss/components",
|
|
"forbiddenAlternatives": ["input[type=text]", "textarea"]
|
|
},
|
|
"Select": {
|
|
"import": "@dss/components",
|
|
"forbiddenAlternatives": ["select", "div.dropdown"]
|
|
},
|
|
"Card": {
|
|
"import": "@dss/components",
|
|
"forbiddenAlternatives": ["div.card", "article"]
|
|
},
|
|
"Modal": {
|
|
"import": "@dss/components",
|
|
"forbiddenAlternatives": ["div.modal", "dialog"]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": "component-prop-validation",
|
|
"name": "Required Component Props",
|
|
"description": "Components must include required accessibility and functionality props",
|
|
"severity": "error",
|
|
"validation": {
|
|
"Button": {
|
|
"requiredProps": ["variant"],
|
|
"conditionalProps": { "loading": ["loadingText"], "icon": ["aria-label"] }
|
|
},
|
|
"Input": {
|
|
"requiredProps": ["label", "name"],
|
|
"conditionalProps": { "error": ["errorMessage"] }
|
|
},
|
|
"Modal": {
|
|
"requiredProps": ["title", "onClose"],
|
|
"recommendedProps": ["aria-describedby"]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": "no-inline-styles",
|
|
"name": "No Inline Styles on Components",
|
|
"description": "Components should use className/variant props, not style attribute",
|
|
"severity": "warning",
|
|
"patterns": {
|
|
"forbidden": ["style={{", "style={"]
|
|
},
|
|
"exceptions": ["dynamic positioning", "animations", "calculated values"]
|
|
}
|
|
],
|
|
"adoption": {
|
|
"thresholds": {
|
|
"minimum": 60,
|
|
"target": 80,
|
|
"excellent": 95
|
|
},
|
|
"metrics": ["percentage_using_ds_components", "custom_component_count", "token_compliance_rate"]
|
|
}
|
|
}
|