fix: false-positive orphaned CSS for CSS-module class accessors#48
Conversation
…ssors Detect and treat `styles.card` / `styles['card-hover']` (the canonical Next.js/React CSS-module consumption pattern) as used classes. Previously every *.module.css class was reported as orphaned and marked removable=True, which could delete live styles. Bracket accessors are recognized and non-module object access (util.foo) is not over-matched. Adds TestCSSModuleUsage regression tests; all 116 tests pass, ruff clean. Co-Authored-By: cowork-bot <cowork-bot@users.noreply.github.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
🤖 Automated Code Review✅ Ruff Lint — No issues
|
Pre-PR Code Review — APPROVEReviewer: Hermes Pre-PR Code Reviewer (cron) AnalysisCore fix (CSS-module accessor recognition): Sound. The
Tests: 3 new focused tests cover dot accessor, bracket accessor, and non-module over-match guard. All 116 tests pass locally. Fix applied during review: Removed unused CI: All checks pass (test 3.10/3.11/3.12/3.13, code-review). Publish skipped (expected for PR). No security issues, no regressions, no breaking changes. Merging with admin privileges (bot-authored PR cannot self-approve under branch protection). |
Fixes false-positive detection of orphaned CSS when class names are accessed via CSS-module patterns (e.g. styles.className). The scanner now recognizes CSS-module accessor patterns and does not flag those class names as orphaned.