Skip to content

feat(mint): add legacy pattern detection to CSS audit prompt - #105

Draft
nujovich wants to merge 4 commits into
mainfrom
hermes/build/mint-relicss-legacy-pattern-detection
Draft

feat(mint): add legacy pattern detection to CSS audit prompt#105
nujovich wants to merge 4 commits into
mainfrom
hermes/build/mint-relicss-legacy-pattern-detection

Conversation

@nujovich

@nujovich nujovich commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Card: https://github.com/nujovich/mint-radar/issues/9

What: Extends the CSS audit with legacy pattern detection. Milestone 1 adds a new audit step (STEP 13) to lib/prompts.mjs that detects obsolete vendor prefixes (-webkit-, -moz-, -ms-, -o-), classic clearfix hacks, and IE-specific CSS hacks (*property, _property, filter:progid, expression()), and suggests modern replacements for each.

Why: ReliCSS demonstrated strong demand for tools that identify CSS fossil patterns. Mint already performs semantic CSS auditing (colors, fonts, spacing, motion, layout a11y, modern practices, overflow safety) but has no awareness of legacy CSS artifacts that bloat stylesheets and complicate maintenance. Adding legacy pattern detection closes this gap, reinforcing Mint's positioning as a thorough CSS health auditor.

Milestones

  • Milestone 1 — Extend audit prompt in lib/prompts.mjs with STEP 13: legacy pattern detection (obsolete vendor prefixes, clearfix hacks, IE-specific hacks), suggest modern alternatives
  • Milestone 2 — Add legacyPatterns field to AuditReport type in lib/types.ts
  • Milestone 3 — Wire legacy patterns results in playground UI as warning-level alerts
  • Milestone 4 — Add test fixture with CSS legacy patterns and test in lib/tests/

Milestone 3 detail

Added legacyPatterns to the LINT_CATEGORIES registry in lib/audit-summary.mjs, making legacy pattern findings visible in both the CLI summary line (formatLintSummary) and the playground AuditView (collectLintGroups). The AuditView renderer was extended to fall back to issue.suggestion when issue.reason is not present (LegacyPatternIssue uses suggestion rather than reason).

Files changed:

  • lib/audit-summary.mjs — added legacyPatterns entry to LINT_CATEGORIES (key, shortLabel: 'legacy', label: 'Legacy CSS patterns')
  • components/AuditView.tsx — made reason optional, added suggestion to LintIssue interface, render uses issue.reason || issue.suggestion
  • lib/__tests__/audit-summary.test.mjs — added tests for formatLintSummary (legacy shortLabel) and collectLintGroups (legacyPatterns included, raw issues preserved)

Milestone 4 detail

Added a CSS test fixture containing legacy patterns and integration tests:

  • lib/__tests__/helpers/legacy-css-fixture.css — test fixture with obsolete vendor prefixes, clearfix hacks, IE-specific hacks, and modern valid CSS
  • lib/__tests__/prompts.test.mjs — updated to include STEP 13 in step count test, added buildAuditPrompt legacy patterns describe block with 5 tests
  • lib/__tests__/css-auditor.test.mjs — added CssAuditor legacyPatterns integration describe block with 3 tests

Tests

All 735 tests passing:

npm test

How to test:

npm test

@nujovich

Copy link
Copy Markdown
Owner Author

All milestones complete. Ready for review when you are.

1 similar comment
@nujovich

nujovich commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

All milestones complete. Ready for review when you are.

@nujovich

nujovich commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

BUILD 2026-08-09: All milestones complete. Ready for review when you are.

@nujovich

Copy link
Copy Markdown
Owner Author

All milestones complete. Ready for review when you are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant