Feature: Verifier catches silent css declaration mistakes before render#2
Merged
Conversation
The DSL's worst failures are silent — a hallucinated Tailwind class produces no CSS at all under JIT. The verifier catches those at edit time, before render. Added: ViewComponentCssDsl::Verifier — six static checks for component declarations: Tailwind class validity (via a compiled-CSS oracle), self-conflicting declarations, method-rule resolution, axis settability, variant-matrix smoke, and template html_attrs splat coverage
The library alone relies on devs remembering to run it; the README now ships copy-pasteable enforcement: a CI-failing spec, a bin script, and a Claude Code hook.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
ViewComponentCssDsl::Verifier, a fast static checker for component css declarations.The DSL's failure modes are silent. The verifier catches them statically — fast enough to run on every edit, with no rendering required.
Details
CompiledCssOracleflags any declared class missing from the compiled build, which contains exactly the valid ones.html_attrssplat (sidecar, inlineerb_template, and hand-written#callall covered) — plus a bare-instance smoke run of every axis-value combination.The six checks and usage are documented in the README. The verifier is an opt-in
require; nothing loads at runtime by default.