Fix ESLint/TypeScript regressions and stale test from Lovable sessions (2026-05-28)#501
Fix ESLint/TypeScript regressions and stale test from Lovable sessions (2026-05-28)#501adm01-debug wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 11 minutes and 36 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Cleanup PR that resolves ESLint and TypeScript regressions introduced by a Lovable session. Removes unused imports/vars, replaces any with explicit types in the supplier comparison modal, and corrects an image field name in the similar products mapping.
Changes:
SupplierComparisonModal.tsx: drop unused imports/vars, addRowProps/ComparisonRowDatainterfaces, use strict equality forfastestLeadTimeDays.ProductDetail.tsx: map similar item image viaimage_url(the field actually exposed bySimilarProductItem).SmartRecommendationsMock.tsxandPriceFreshnessBadge.tsx: remove unusedBadgeimport and prefix unusedlongDatewith_.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/components/compare/SupplierComparisonModal.tsx | Removes unused imports, types ComparisonRow/ComparisonCard props, fixes eqeqeq; also Prettier reformatting. |
| src/pages/products/ProductDetail.tsx | Uses correct image_url field from SimilarProductItem. |
| src/components/products/SmartRecommendationsMock.tsx | Removes unused Badge import; Prettier reformatting. |
| src/components/products/PriceFreshnessBadge.tsx | Prefixes unused longDate with _; Prettier reformatting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- SupplierComparisonModal: remove 8 unused imports (useEffect, useNavigate, Crown, ShieldCheck, Clock, Palette, Info, ArrowRightLeft + navigate var), type ComparisonRow/ComparisonCard props with explicit interface instead of any, fix eqeqeq violation (!= → !==) - SmartRecommendationsMock: remove unused Badge import - ProductDetail: fix TS2551/TS2339 — SimilarProductItem uses image_url not og_image_url/images - PriceFreshnessBadge: prefix unused longDate with _ after Lovable removed its only usage in FreshnessTooltipBody
7a7e859 to
0e2c789
Compare
New Lovable commits (1775bf4..eeaf42e) added the PromoFlix HLS player and tweaked price-freshness labels, introducing 16 ESLint regressions + 1 broken unit test: - PromoFlixPlayer.tsx: replace console.log telemetry with logger.debug (no-console + no-explicit-any on details param), fix 3 react-hooks/ exhaustive-deps (add stable logTelemetry/clearLoadingTimeout to deps, capture videoRef.current in effect for safe cleanup) - PromoFlixPlayer.test.tsx: type hls.js mock instance and mock.calls predicates instead of any (10 warnings) - price-freshness.ts: wire the unused baseLabel into the fresh-status return (no-unused-vars) - price-freshness.test.ts: update stale "Atualizado hoje" expectation to match Lovable's new "Atualizado (há 0 dias)" label copy
0e2c789 to
4f4fae1
Compare
|
Fechando este PR como duplicata superada pelo #502. Motivo (resolução do conflito):
Para evitar dois PRs duplicados conflitando entre si no merge, todo o trabalho segue consolidado no #502. Nenhuma alteração deste PR se perde. |
Summary
Exhaustive audit of two Lovable sessions today. The branch is rebased onto the latest
origin/main(eeaf42ef) and fixes 29 ESLint regressions, 2 TypeScript regressions, and 1 broken unit test introduced by Lovable.Round 1 — SupplierComparison / SmartRecommendations / PriceFreshness
SupplierComparisonModal.tsx(11 problems)useEffect,useNavigate/navigate,Crown,ShieldCheck,Clock,Palette,Info,ArrowRightLeftComparisonRow/ComparisonCardprops withRowProps/ComparisonRowDatainstead ofanyeqeqeq:fastestLeadTimeDays != null→!== nullSmartRecommendationsMock.tsx(1) — removed unusedBadgeimportProductDetail.tsx(TS2551 + TS2339) —SimilarProductItemexposesimage_url, notog_image_url/imagesPriceFreshnessBadge.tsx(1) — prefixed unusedlongDatewith_(kept the newer regexstrippedlogic from main during rebase)Round 2 — PromoFlix HLS player (new feature)
PromoFlixPlayer.tsx(5 problems)console.logtelemetry withlogger.debug(fixesno-console+no-explicit-anyon thedetailsparam →Record<string, unknown>)react-hooks/exhaustive-deps: added stablelogTelemetry/clearLoadingTimeoutto dep arrays; capturedvideoRef.currentinto a local var for safe effect cleanupPromoFlixPlayer.test.tsx(10anywarnings) — typed the hls.js mock instance (MockHlsInstance) andmock.callspredicates; non-null assertions where the mock/handler is guaranteed presentprice-freshness.ts(1) — wired the unusedbaseLabelinto the fresh-status returnprice-freshness.test.ts— Lovable changed the label copy (Atualizado hoje→Atualizado (há 0 dias)) and updated the badge tests + snapshots but left this unit test stale → updated the assertion to matchTest plan
npm run lint:baseline→ ✅ 0 regressions (90 errors vs baseline 107)npm run typecheck→ ✅ 0 regressions (122 errors vs baseline 147)npx vitest runon PromoFlixPlayer + price-freshness → ✅ all pass (13 + 15)npx prettier --check→ ✅ all touched files pass