/** * Spacing Validator * * Enforces the spacing doctrine (docs/SPACING.md, #1397/#1647): rhythm * belongs to prose context and layout containers, never to components. * The 18 accidental default margins that motivated the doctrine grew one * innocuous declaration at a time — this validator is what keeps the list * from regrowing after #1645 stripped it. * * Scope: component/recipe SCSS files (`.scss`). Two named exemptions: * - `*-light-dom.scss` files — the flow owners (ed-text-passage et al.) * whose whole job is margining prose content. Skipped entirely. Do NOT * "fix" this: it is doctrine D1's one legal margin home. * - Declarations carrying an `ed-margin-ok:` / `ed-size-token-ok:` marker * comment — the documented-deviation escape hatch (mirrors the * `ed-raw-value-ok:` convention). The marker must carry a reason. * * Checks: * 1. ROOT MARGIN (error) — a `margin*` declaration with a non-zero value * inside a `:host` block, or inside the component's ROOT selector — the * bare BEM block (`.ed-c-foo`, `.ed-r-foo`) or a root modifier * (`.ed-c-foo--variant`) with no descendant part. A component spacing * itself from its siblings is the doctrine's cardinal violation; margins * on internal `__element` parts are the component's own layout and legal. * Negative margins are exempt (spatial layering — e.g. ed-feature's * overlap — not rhythm). * 2. SIZE-TOKEN RHYTHM (warning) — a `gap` or `margin*` declaration * consuming a t-shirt spacing token (`--ed-theme-spacing-sm|md|lg|xl|xxl`) * where a spacing ROLE names the relationship * (`--ed-theme-spacing-region|section|block|flow|field|inline`). Roles * are what let a theme retune the whole system by remapping six values. * Padding is deliberately NOT flagged: roles govern rhythm between * siblings, not a surface's internal padding (doctrine D8). * * Conservatism: selector tracking is a lightweight brace-depth walk, not a * real SCSS parser. When the current selector cannot be determined the * declaration is NOT flagged — per this repo's validator philosophy, false * positives are worse than false negatives (#1015, #1530). */ import type { HealthIssue } from '../types.js'; export declare class SpacingValidator { validateFile(filePath: string): Promise; } //# sourceMappingURL=spacing-validator.d.ts.map