Files
dss/packages/dss-rules/rules/accessibility.json
DSS 9dbd56271e
Some checks failed
DSS Project Analysis / dss-context-update (push) Has been cancelled
feat: Enterprise DSS architecture implementation
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>
2025-12-11 09:41:36 -03:00

76 lines
2.1 KiB
JSON

{
"$schema": "../schemas/rule.schema.json",
"id": "accessibility",
"version": "1.0.0",
"name": "Accessibility Rules",
"description": "WCAG 2.1 AA compliance rules (token-based, not computed)",
"category": "accessibility",
"severity": "error",
"rules": [
{
"id": "images-have-alt",
"name": "Images Must Have Alt Text",
"description": "All img elements must have alt attribute",
"severity": "error",
"wcag": "1.1.1",
"validation": {
"type": "attribute-required",
"element": "img",
"attribute": "alt"
}
},
{
"id": "buttons-have-text",
"name": "Buttons Must Have Accessible Names",
"description": "Button elements must have visible text or aria-label",
"severity": "error",
"wcag": "4.1.2",
"validation": {
"type": "accessible-name",
"elements": ["button", "[role=button]"]
}
},
{
"id": "form-labels",
"name": "Form Inputs Must Have Labels",
"description": "All form inputs must be associated with a label",
"severity": "error",
"wcag": "1.3.1",
"validation": {
"type": "label-association",
"elements": ["input", "select", "textarea"]
}
},
{
"id": "no-focus-outline-none",
"name": "Do Not Remove Focus Outline",
"description": "Never use outline: none on focusable elements",
"severity": "error",
"wcag": "2.4.7",
"patterns": {
"forbidden": [
"outline:\\s*none",
"outline:\\s*0(?![0-9])",
":focus\\s*\\{[^}]*outline:\\s*none"
]
}
},
{
"id": "touch-target-size",
"name": "Minimum Touch Target Size",
"description": "Interactive elements should be at least 44x44 CSS pixels",
"severity": "warning",
"wcag": "2.5.5",
"guidelines": [
"Use Button component which ensures minimum size",
"Ensure clickable areas have sufficient padding"
]
}
],
"compliance": {
"level": "AA",
"standards": ["WCAG 2.1"],
"note": "Computed checks (contrast ratio) require runtime analysis"
}
}