Repository navigation
fix(ci): make Lint pass and unblock sharp on Linux build - #4
Conversation
- Format the four files flagged by format:check. - Force a single sharp version (0.34.2) via resolutions. With 0.33.5 (@strapi/upload) and 0.34.x (next) both installed, yarn 1 hoisted mismatched @img/sharp-* and @img/sharp-libvips-* packages, so sharp could not load libvips-cpp.so.8.16.1 when next.config.mjs loaded @plaiceholder/next on CI. - Resolve eslint-plugin-react-hooks to ^5.2.0: 4.6.x (pinned by @vercel/style-guide 6) calls context.getSource(), removed in ESLint 9, and crashed next lint. - Fix the 23 ESLint errors that surfaced once lint ran: unescaped entities, redundant list roles, missing video caption tracks, keyboard access for the YouTube thumbnail, a recharts Area falsely matched as an image-map area, and a redeclared ProjectStatistics name. - Add lib/email/send-email.ts (imported but never committed) and point category.ts at the existing @/lib/strapi-api client instead of the missing ../strapi-client. Also fixes nodemailer.createTransporter, which does not exist, to createTransport. Build still fails on pre-existing TypeScript errors in apps/web. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 22 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
⏱️ Code Review completed (23 eligible files · 19,788 chars · 2 model call(s) · 1 PR unit(s))
Whole diff with bounded context at base ac8985d / head e5e6fad.
Excluded by noise policy: yarn.lock.
✅ CLEAN_PASS: Complete diff reviewed
🔒 Dependency check
✅ Passed. Every new package version comes from the public registry or a source this lockfile already used for it, its checksum is pinned where the format records one, and OSV lists no new malicious package or high or critical vulnerability for the versions it was asked about.
Changed packages (1)
| Package | From | To | Lockfile |
|---|---|---|---|
eslint-plugin-react-hooks |
4.6.2 |
5.2.0 |
yarn.lock |
What
Fixes the CI failures that already exist on
main(Lint and Build all apps both fail onac8985d).format:check.eslint-plugin-react-hooksto^5.2.0. The 4.6.x version pinned by@vercel/style-guidecrashes under ESLint 9 withcontext.getSource is not a function.next lintactually ran: unescaped entities, redundantrole="list", missing<track>on<video>, keyboard access for the YouTube thumbnail, the rechartsAreafalse positive and a redeclared name.sharp@0.34.2viaresolutions.@strapi/upload) and 0.34.x (next) were installed, and yarn 1 hoisted mismatched@img/sharp-*/@img/sharp-libvips-*packages. As a resultsharpcould not loadlibvips-cpp.so.8.16.1on Linux whennext.config.mjsloaded@plaiceholder/next.lib/email/send-email.ts, which was imported but never committed.category.tsat the existing@/lib/strapi-apiclient instead of the non-existent../strapi-client.nodemailer.createTransporter, which does not exist, tocreateTransport.Known remaining failure
Build all apps will still fail.
next buildnow gets past compilation but stops at type checking.tsc --noEmitinapps/webreports 145 pre-existing type errors across about 35 files. The largest groups are:UserProfileCard.test.tsx: 49 errorsapi/projects/[id]/analytics/route.ts: 16 errorslib/payment/crypto.ts: 11 errorsparamsin dynamic pagesThese errors are not addressed here. Per
Docs/Give-Technical-Design.md(PR #3), M0 replaces this stack.Verification (local, Node 24 with engines ignored)
prettier --checkon the whole repo: pass.next lint: exit 0, warnings only.next build: compiles, then fails on type errors as described above.sharpfix is confirmed byyarn.lock, which now has onesharpand one@img/sharp-libvips-linux-x64. It still needs a CI run on Linux to confirm.🤖 Generated with Claude Code
📌 TL;DR
This PR resolves linting and accessibility errors by escaping special characters in JSX, adding ARIA attributes to interactive elements, and fixing a naming conflict in Recharts. It also refactors email transport logic into a shared utility and pins dependency versions to resolve build conflicts.
🎯 Type of Change
🔍 Changes Walkthrough
apps/web/src/app/[locale]/admin/categories/page.tsxapps/web/src/app/[locale]/campaigns/create/page.tsx'entity to fix JSX parsing issues.apps/web/src/app/[locale]/projects/[id]/components/ProjectDetailContent.tsx'entity in descriptive text.apps/web/src/app/[locale]/projects/[id]/components/ProjectDetailHero.tsx<track kind="captions" />to satisfy video accessibility lint rules.apps/web/src/app/[locale]/projects/[slug]/components/ProjectDetailHero.tsx<track kind="captions" />to satisfy video accessibility lint rules.apps/web/src/app/[locale]/projects/create/CreateProjectForm.tsx'entity in descriptive text.apps/web/src/app/[locale]/projects/page.tsxapps/web/src/app/api/comments/route.tsapps/web/src/app/api/project-updates/route.tsapps/web/src/components/catalyst/footer.tsxrole="list"attributes from<ul>elements (implicit by default).apps/web/src/components/crowdfunding/AnalyticsDashboard.tsxAreaimport toAreaSeriesto avoid conflict with local variable or component naming.apps/web/src/components/crowdfunding/DonationHistory.tsx“and”entities for proper typography.apps/web/src/components/crowdfunding/DonationsList.tsx“and”entities for proper typography.apps/web/src/components/crowdfunding/ProjectFilters.tsx“and”entities for proper typography.apps/web/src/components/crowdfunding/ProjectStatistics.tsxProjectStatisticstoProjectStatisticsDatato avoid conflict with component name.apps/web/src/components/crowdfunding/ProjectUpdates.tsx'entity in empty state message.apps/web/src/components/elementary/YouTubePlayer.tsxrole="button",tabIndex,aria-label, andonKeyDownhandler to make the video thumbnail keyboard accessible.apps/web/src/components/page-builder/sections/FeaturedProjects.tsx'entity in descriptive text.apps/web/src/lib/email/donation-receipt.tscreateTransporterdefinition and imported it from the new sharedsend-emailutility.apps/web/src/lib/email/send-email.tssendEmailhelper function.apps/web/src/lib/strapi-api/content/category.tsPrivateStrapiClientto use absolute path alias.apps/web/src/lib/strapi-api/content/project.tspackage.jsonresolutionsto pineslint-plugin-react-hooksandsharpversions, and added comments explaining the dependency conflicts.📊 Architectural Flow
flowchart TD subgraph "Email System Refactor" A[donation-receipt.ts] -->|Imports| B[send-email.ts] B -->|Uses| C[nodemailer] B -->|Exports| D[createTransporter] B -->|Exports| E[sendEmail] end subgraph "Dependency Resolution" F[package.json] -->|Pins| G[eslint-plugin-react-hooks] F -->|Pins| H[sharp] end