feat(mint): add @property type-check analysis to CSS audit - #104
Merged
Conversation
Owner
Author
|
All milestones complete. Ready for review when you are. |
2 similar comments
Owner
Author
|
All milestones complete. Ready for review when you are. |
Owner
Author
|
All milestones complete. Ready for review when you are. |
nujovich
marked this pull request as ready for review
July 23, 2026 14:02
nujovich
marked this pull request as draft
July 23, 2026 14:03
Owner
Author
|
All milestones complete. Ready for review when you are. |
STEP 13 emitted its own field shape (propertyName / declaredSyntax / location / issue), which neither the shared lint renderer nor the summary registry can read. Findings were produced by the model and then silently dropped: an empty severity badge, "—" as the anchor and a blank reason in the playground, and no entry at all in the CLI summary. - align propertyTypeIssues with the contract every other lint category follows: selector, property, rule, severity, reason (plus propertyName and declaredSyntax as extras) - split STEP 13 into three named rules: invalid-initial-value, fallback-type-mismatch, property-type-mismatch - detect invalid initial-value, where a syntax/initial-value mismatch (or a missing initial-value on a non-universal syntax) makes the browser reject the whole registration - drop the ad-hoc ">>" location separator in favour of selector+property - narrow the foreign-context rule to unambiguous cases to limit false positives - register propertyTypeIssues in LINT_CATEGORIES so both the CLI summary and AuditView surface it - add PropertyTypeIssue to AuditReport - assert the shared severity/reason/anchor fields across all five lint categories by parsing the prompt's own output example - add lib/__fixtures__/at-property.css covering one case per rule - remove the BUILD-PLAN-issue-8.md scratch file
The CSS layout linting section tables every lint category and its rules; @Property type checking was missing from it. - add the three @Property rules to the linting table - add a subsection explaining why invalid-initial-value matters (the browser rejects the whole registration) and that universal syntax is skipped - mention @Property type contracts in the audit step and the section intro - note that @Property findings do not feed the chaos score
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.
Card: https://github.com/nujovich/mint-radar/issues/8
What
Extends the CSS audit with
@propertytype-check analysis. A new STEP 13 inlib/prompts.mjsdetects CSS@propertyregistrations, validates them and theirvar()usages against the declaredsyntaxdescriptor, and reports violations aspropertyTypeIssues. It builds on Mint's existing LLM-based audit pipeline — no new runtime parser needed.Three rules are reported, most severe first:
invalid-initial-valueinitial-valuethat does not parse as the declaredsyntax, or a missinginitial-valueon a non-universal syntax. The browser rejects the whole registration, silently dropping both the type contract and the ability to transition.fallback-type-mismatchvar(--my-color, 14px)— a fallback whose type contradicts the registration, so it can never apply.property-type-mismatch<length>used incolor). Reported only when unambiguous from the stylesheet alone.Registrations declaring the universal syntax (
*) are skipped — they are not type-checkable.Why
@propertyadoption is growing (2.67% per Project Wallace 2026, driven by Tailwind v4). Mint audits colors, fonts, spacing, line-height, motion, layout accessibility, modern practices and overflow safety, but had no awareness of registered custom properties or their type contracts. Mismatches between a declared syntax and actual usage are a class of bug that neither ESLint CSS nor Stylelint targets natively, which reinforces Mint's positioning as a semantic auditor.Milestones
lib/prompts.mjs: detect registrations, validate against the declared syntax, report violationsPropertyTypeIssueinterface +propertyTypeIssuesonAuditReportinlib/types.tslib/__fixtures__/at-property.cssfixture covering one case per rule, plus tests@propertytype safetyReview fixes (bfa9a22)
The first commit shipped the prompt step alone, emitting an output shape of its own (
propertyName/declaredSyntax/location/issue). Neither shared consumer can read that shape, so findings were produced by the model and then silently discarded: an empty severity badge,—as the anchor and a blank reason in the playground, and no entry at all in the CLI summary.propertyTypeIssueswith the contract every other lint category follows:selector,property,rule,severity,reason(pluspropertyNameanddeclaredSyntaxas extras)invalid-initial-valuecheck — the highest-value deterministic check, and the one previously missing>>location separator in favour of discreteselector+property, mirroringlayoutA11yIssuespropertyTypeIssuesinLINT_CATEGORIES(lib/audit-summary.mjs) — the single registry feeding bothformatLintSummaryin the CLI andcollectLintGroupsinAuditView, so one entry lights up both surfaces<example>block and assertsseverity/reason/ anchor across all five lint categoriesBUILD-PLAN-issue-8.mdscratch fileDocumentation (dbf0727)
The README's CSS layout linting section tables every category and its rules;
@propertywas missing from it. Added the three rules to that table, a@propertytype safety subsection explaining whyinvalid-initial-valueis the one to fix first and that universal-syntax registrations are skipped, and updated the audit step and section intro. The subsection's CSS sample is wrapped inprettier-ignoreso the aligned trailing comments survive formatting, matching the existing convention in the Frankenstein example.Verification
The CLI summary line renders
1 overflow · 2 property types, and the shared renderer receivesseverity=warning,anchor=@property --spacing-unit,reason=Registered as <length> but initial-value…where it previously gotundefinedfor all three fields.Note for #105
#105 also adds a step numbered STEP 13, at the same hunk in
lib/prompts.mjs. Both PRs reportMERGEABLEbecause each is diffed againstmainin isolation. Whichever merges second must renumber to STEP 14 to avoid a duplicated step number in the audit prompt.How to test