Skip to content

Fix ESLint/TypeScript regressions and stale test from Lovable sessions (2026-05-28)#501

Closed
adm01-debug wants to merge 2 commits into
mainfrom
claude/laughing-shannon-Ex05s
Closed

Fix ESLint/TypeScript regressions and stale test from Lovable sessions (2026-05-28)#501
adm01-debug wants to merge 2 commits into
mainfrom
claude/laughing-shannon-Ex05s

Conversation

@adm01-debug
Copy link
Copy Markdown
Owner

@adm01-debug adm01-debug commented May 28, 2026

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)

  • Removed 8 unused imports/vars: useEffect, useNavigate/navigate, Crown, ShieldCheck, Clock, Palette, Info, ArrowRightLeft
  • Typed ComparisonRow/ComparisonCard props with RowProps/ComparisonRowData instead of any
  • Fixed eqeqeq: fastestLeadTimeDays != null!== null

SmartRecommendationsMock.tsx (1) — removed unused Badge import

ProductDetail.tsx (TS2551 + TS2339) — SimilarProductItem exposes image_url, not og_image_url/images

PriceFreshnessBadge.tsx (1) — prefixed unused longDate with _ (kept the newer regex stripped logic from main during rebase)

Round 2 — PromoFlix HLS player (new feature)

PromoFlixPlayer.tsx (5 problems)

  • Replaced console.log telemetry with logger.debug (fixes no-console + no-explicit-any on the details param → Record<string, unknown>)
  • Fixed 3 react-hooks/exhaustive-deps: added stable logTelemetry/clearLoadingTimeout to dep arrays; captured videoRef.current into a local var for safe effect cleanup

PromoFlixPlayer.test.tsx (10 any warnings) — typed the hls.js mock instance (MockHlsInstance) and mock.calls predicates; non-null assertions where the mock/handler is guaranteed present

price-freshness.ts (1) — wired the unused baseLabel into the fresh-status return

price-freshness.test.ts — Lovable changed the label copy (Atualizado hojeAtualizado (há 0 dias)) and updated the badge tests + snapshots but left this unit test stale → updated the assertion to match

Test plan

  • npm run lint:baseline → ✅ 0 regressions (90 errors vs baseline 107)
  • npm run typecheck → ✅ 0 regressions (122 errors vs baseline 147)
  • npx vitest run on PromoFlixPlayer + price-freshness → ✅ all pass (13 + 15)
  • npx prettier --check → ✅ all touched files pass

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
we-dream-big Error Error May 28, 2026 10:06pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Warning

Review limit reached

@adm01-debug, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 27d9a67d-e88e-4147-ab67-bffd5803c919

📥 Commits

Reviewing files that changed from the base of the PR and between 1ec1363 and 4f4fae1.

📒 Files selected for processing (8)
  • src/components/compare/SupplierComparisonModal.tsx
  • src/components/products/PriceFreshnessBadge.tsx
  • src/components/products/SmartRecommendationsMock.tsx
  • src/components/products/gallery/PromoFlixPlayer.test.tsx
  • src/components/products/gallery/PromoFlixPlayer.tsx
  • src/pages/products/ProductDetail.tsx
  • src/utils/price-freshness.test.ts
  • src/utils/price-freshness.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/laughing-shannon-Ex05s

Comment @coderabbitai help to get the list of available commands and usage tips.

@supabase
Copy link
Copy Markdown

supabase Bot commented May 28, 2026

This pull request has been ignored for the connected project doufsxqlfjyuvxuezpln because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@adm01-debug adm01-debug marked this pull request as ready for review May 28, 2026 20:01
Copilot AI review requested due to automatic review settings May 28, 2026 20:01
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, add RowProps/ComparisonRowData interfaces, use strict equality for fastestLeadTimeDays.
  • ProductDetail.tsx: map similar item image via image_url (the field actually exposed by SimilarProductItem).
  • SmartRecommendationsMock.tsx and PriceFreshnessBadge.tsx: remove unused Badge import and prefix unused longDate with _.

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
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
@adm01-debug adm01-debug force-pushed the claude/laughing-shannon-Ex05s branch from 0e2c789 to 4f4fae1 Compare May 28, 2026 22:06
@adm01-debug adm01-debug changed the title Fix ESLint and TypeScript regressions from Lovable session 2026-05-28 Fix ESLint/TypeScript regressions and stale test from Lovable sessions (2026-05-28) May 28, 2026
@adm01-debug
Copy link
Copy Markdown
Owner Author

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.

@adm01-debug adm01-debug deleted the claude/laughing-shannon-Ex05s branch May 29, 2026 13:37
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.

3 participants