From 3e2dfc5166a2b720ac91d3b2163bc837276f98dc Mon Sep 17 00:00:00 2001 From: Viktor Svertoka Date: Tue, 3 Feb 2026 12:04:15 +0200 Subject: [PATCH] chore(lint): finalize ESLint + Prettier --- .prettierrc | 10 - frontend/.prettierrc | 5 +- frontend/README.md | 29 +- frontend/actions/quiz.ts | 19 +- frontend/app/[locale]/about/page.tsx | 38 +- .../app/[locale]/blog/[slug]/PostDetails.tsx | 29 +- frontend/app/[locale]/blog/[slug]/page.tsx | 6 +- .../blog/category/[category]/page.tsx | 32 +- frontend/app/[locale]/blog/page.tsx | 6 +- frontend/app/[locale]/dashboard/page.tsx | 50 +- .../app/[locale]/forgot-password/page.tsx | 8 +- frontend/app/[locale]/layout.tsx | 20 +- frontend/app/[locale]/leaderboard/page.tsx | 5 +- frontend/app/[locale]/login/page.tsx | 24 +- frontend/app/[locale]/page.tsx | 1 + frontend/app/[locale]/privacy-policy/page.tsx | 1 + frontend/app/[locale]/q&a/page.tsx | 11 +- frontend/app/[locale]/quiz/[slug]/page.tsx | 35 +- frontend/app/[locale]/quizzes/page.tsx | 41 +- frontend/app/[locale]/reset-password/page.tsx | 15 +- .../shop/admin/orders/[id]/RefundButton.tsx | 6 +- .../[locale]/shop/admin/orders/[id]/page.tsx | 58 +- .../app/[locale]/shop/admin/orders/page.tsx | 70 +- frontend/app/[locale]/shop/admin/page.tsx | 20 +- .../shop/admin/products/[id]/edit/page.tsx | 15 +- .../products/_components/ProductForm.tsx | 90 +- .../[locale]/shop/admin/products/new/page.tsx | 3 +- .../app/[locale]/shop/admin/products/page.tsx | 75 +- .../app/[locale]/shop/cart/CartPageClient.tsx | 64 +- frontend/app/[locale]/shop/cart/page.tsx | 1 + .../app/[locale]/shop/checkout/error/page.tsx | 51 +- .../checkout/payment/StripePaymentClient.tsx | 34 +- .../shop/checkout/payment/[orderId]/page.tsx | 70 +- .../success/OrderStatusAutoRefresh.tsx | 2 +- .../[locale]/shop/checkout/success/page.tsx | 44 +- .../app/[locale]/shop/orders/[id]/page.tsx | 45 +- frontend/app/[locale]/shop/orders/error.tsx | 6 +- frontend/app/[locale]/shop/orders/page.tsx | 33 +- frontend/app/[locale]/shop/page.tsx | 41 +- .../[locale]/shop/products/[slug]/page.tsx | 23 +- frontend/app/[locale]/shop/products/page.tsx | 16 +- frontend/app/[locale]/signup/page.tsx | 24 +- .../app/[locale]/terms-of-service/page.tsx | 1 + frontend/app/api/ai/explain/route.ts | 3 +- .../app/api/auth/github/callback/route.ts | 298 +++-- frontend/app/api/auth/github/route.ts | 34 +- .../app/api/auth/google/callback/route.ts | 62 +- frontend/app/api/auth/google/route.ts | 20 +- frontend/app/api/auth/login/route.ts | 51 +- frontend/app/api/auth/logout/route.ts | 9 +- frontend/app/api/auth/me/route.ts | 11 +- .../api/auth/password-reset/confirm/route.ts | 112 +- frontend/app/api/auth/password-reset/route.ts | 102 +- .../app/api/auth/resend-verification/route.ts | 106 +- frontend/app/api/auth/signup/route.ts | 67 +- frontend/app/api/auth/verify-email/route.ts | 96 +- frontend/app/api/blog-author/route.ts | 1 + frontend/app/api/blog-search/route.ts | 1 + .../app/api/questions/[category]/route.ts | 3 +- frontend/app/api/quiz/[slug]/route.ts | 1 + frontend/app/api/quiz/guest-result/route.ts | 47 +- frontend/app/api/quiz/verify-answer/route.ts | 1 + frontend/app/api/sessions/activity/route.ts | 7 +- .../shop/admin/orders/[id]/refund/route.ts | 8 +- .../app/api/shop/admin/orders/[id]/route.ts | 6 +- .../admin/orders/reconcile-stale/route.ts | 4 +- frontend/app/api/shop/admin/orders/route.ts | 8 +- .../app/api/shop/admin/products/[id]/route.ts | 19 +- .../shop/admin/products/[id]/status/route.ts | 6 +- frontend/app/api/shop/admin/products/route.ts | 18 +- frontend/app/api/shop/cart/rehydrate/route.ts | 8 +- frontend/app/api/shop/catalog/route.ts | 5 +- frontend/app/api/shop/checkout/route.ts | 31 +- .../internal/orders/restock-stale/route.ts | 12 +- frontend/app/api/shop/orders/[id]/route.ts | 12 +- .../app/api/shop/webhooks/stripe/route.ts | 24 +- frontend/app/api/stats/route.ts | 1 + frontend/app/layout.tsx | 5 +- frontend/app/not-found.tsx | 34 +- frontend/client.ts | 8 +- .../components/about/CommunitySection.tsx | 204 ++-- frontend/components/about/FeaturesSection.tsx | 1005 ++++++++++------ frontend/components/about/HeroSection.tsx | 277 +++-- frontend/components/about/InteractiveGame.tsx | 1056 +++++++++-------- frontend/components/about/PricingSection.tsx | 363 +++--- frontend/components/about/SponsorsWall.tsx | 182 +-- frontend/components/about/TopicsSection.tsx | 175 ++- frontend/components/auth/AuthErrorBanner.tsx | 38 +- .../components/auth/AuthProvidersBlock.tsx | 33 +- frontend/components/auth/AuthShell.tsx | 38 +- .../components/auth/AuthSuccessBanner.tsx | 29 +- .../components/auth/ForgotPasswordForm.tsx | 141 +-- frontend/components/auth/LoginForm.tsx | 340 +++--- frontend/components/auth/OAuthButtons.tsx | 36 +- frontend/components/auth/PostAuthQuizSync.tsx | 117 +- frontend/components/auth/ProviderButton.tsx | 49 +- .../components/auth/ResetPasswordForm.tsx | 126 +- frontend/components/auth/SignupForm.tsx | 276 ++--- .../components/auth/fields/EmailField.tsx | 62 +- frontend/components/auth/fields/NameField.tsx | 52 +- .../components/auth/fields/PasswordField.tsx | 86 +- frontend/components/auth/icons/GitHubIcon.tsx | 24 +- frontend/components/auth/icons/GoogleIcon.tsx | 40 +- frontend/components/auth/logoutButton.tsx | 7 +- frontend/components/blog/BlogCard.tsx | 62 +- frontend/components/blog/BlogCategoryGrid.tsx | 3 +- .../components/blog/BlogCategoryLinks.tsx | 7 +- frontend/components/blog/BlogFilters.tsx | 58 +- frontend/components/blog/BlogGrid.tsx | 3 +- frontend/components/blog/BlogHeaderSearch.tsx | 35 +- frontend/components/blog/BlogNavLinks.tsx | 11 +- frontend/components/blog/BlogPageHeader.tsx | 2 +- frontend/components/blog/BlogPagination.tsx | 25 +- .../components/blog/FeaturedPostCtaButton.tsx | 1 + frontend/components/dashboard/ProfileCard.tsx | 32 +- .../components/dashboard/QuizSavedBanner.tsx | 50 +- frontend/components/dashboard/StatsCard.tsx | 39 +- frontend/components/header/AppChrome.tsx | 2 +- frontend/components/header/AppMobileMenu.tsx | 55 +- frontend/components/header/DesktopActions.tsx | 8 +- frontend/components/header/DesktopNav.tsx | 6 +- frontend/components/header/MainSwitcher.tsx | 7 +- frontend/components/header/MobileActions.tsx | 4 +- frontend/components/header/NavLink.tsx | 1 + frontend/components/header/UnifiedHeader.tsx | 6 +- frontend/components/home/CodeCard.tsx | 14 +- frontend/components/home/HeroBackground.tsx | 12 +- frontend/components/home/HeroCodeCards.tsx | 2 +- frontend/components/home/HeroSection.tsx | 26 +- .../components/home/InteractiveCTAButton.tsx | 26 +- .../leaderboard/LeaderboardClient.tsx | 26 +- .../leaderboard/LeaderboardPodium.tsx | 24 +- .../leaderboard/LeaderboardTable.tsx | 80 +- frontend/components/leaderboard/types.ts | 2 +- frontend/components/legal/LegalBlock.tsx | 11 +- frontend/components/legal/LegalPageShell.tsx | 38 +- .../components/legal/PrivacyPolicyContent.tsx | 10 +- .../legal/TermsOfServiceContent.tsx | 5 +- frontend/components/q&a/AIWordHelper.tsx | 44 +- frontend/components/q&a/AccordionList.tsx | 26 +- frontend/components/q&a/CodeBlock.tsx | 13 +- .../components/q&a/FloatingExplainButton.tsx | 5 +- .../components/q&a/HighlightCachedTerms.tsx | 5 +- frontend/components/q&a/Pagination.tsx | 25 +- frontend/components/q&a/QaSection.tsx | 41 +- frontend/components/q&a/types.ts | 6 +- frontend/components/q&a/useQaTabs.ts | 7 +- frontend/components/quiz/CountdownTimer.tsx | 15 +- .../components/quiz/ExplanationRenderer.tsx | 11 +- .../components/quiz/PendingResultHandler.tsx | 20 +- frontend/components/quiz/QuizCard.tsx | 34 +- frontend/components/quiz/QuizContainer.tsx | 54 +- frontend/components/quiz/QuizProgress.tsx | 52 +- frontend/components/quiz/QuizQuestion.tsx | 32 +- frontend/components/quiz/QuizResult.tsx | 134 ++- frontend/components/quiz/QuizzesSection.tsx | 83 +- .../quiz/tests/quiz-container-flow.test.tsx | 9 +- .../components/shared/AnimatedNavLink.tsx | 43 +- .../components/shared/CategoryTabButton.tsx | 8 +- frontend/components/shared/CookieBanner.tsx | 15 +- .../shared/DynamicGridBackground.tsx | 6 +- frontend/components/shared/Footer.tsx | 52 +- .../components/shared/GitHubStarButton.tsx | 31 +- frontend/components/shared/HeaderButton.tsx | 18 +- .../components/shared/LanguageSwitcher.tsx | 13 +- frontend/components/shared/Logo.tsx | 15 +- .../components/shared/OnlineCounterPopup.tsx | 67 +- frontend/components/shop/AddToCartButton.tsx | 29 +- frontend/components/shop/CartProvider.tsx | 6 +- frontend/components/shop/CatalogLoadMore.tsx | 3 +- .../components/shop/CatalogProductsClient.tsx | 6 +- frontend/components/shop/CategoryTile.tsx | 7 +- frontend/components/shop/ClearCartOnMount.tsx | 1 + frontend/components/shop/ProductCard.tsx | 21 +- frontend/components/shop/ProductFilters.tsx | 25 +- frontend/components/shop/ProductSort.tsx | 13 +- frontend/components/shop/ProductsToolbar.tsx | 16 +- frontend/components/shop/ShopHero.tsx | 17 +- .../components/shop/admin/AdminPagination.tsx | 5 +- .../shop/admin/AdminProductDeleteButton.tsx | 4 +- .../shop/admin/AdminProductStatusToggle.tsx | 4 +- .../components/shop/admin/ShopAdminTopbar.tsx | 13 +- .../components/shop/header/CartButton.tsx | 6 +- frontend/components/shop/header/NavLinks.tsx | 35 +- .../components/tests/CookieBanner.test.tsx | 5 +- .../components/tests/blog/blog-card.test.tsx | 25 +- .../tests/blog/blog-category-grid.test.tsx | 22 +- .../tests/blog/blog-category-links.test.tsx | 7 +- .../tests/blog/blog-filters.test.tsx | 9 +- .../components/tests/blog/blog-grid.test.tsx | 6 +- .../tests/blog/blog-header-search.test.tsx | 5 +- .../tests/blog/blog-nav-links.test.tsx | 3 +- .../tests/q&a/accordion-list.test.tsx | 26 +- .../tests/q&a/ai-word-helper.test.tsx | 76 +- .../components/tests/q&a/code-block.test.tsx | 16 +- .../q&a/floating-explain-button.test.tsx | 4 +- .../tests/q&a/highlight-cached-terms.test.tsx | 4 +- .../components/tests/q&a/pagination.test.tsx | 4 +- .../components/tests/q&a/qa-section.test.tsx | 6 +- .../tests/q&a/selectable-text.test.tsx | 4 +- frontend/components/tests/q&a/types.test.ts | 2 +- .../components/tests/q&a/use-qa-tabs.test.tsx | 4 +- frontend/components/theme/ThemeProvider.tsx | 10 +- frontend/components/theme/ThemeToggle.tsx | 8 +- frontend/components/ui/accordion.tsx | 26 +- frontend/components/ui/badge.tsx | 15 +- frontend/components/ui/button.tsx | 7 +- frontend/components/ui/confirm-modal.tsx | 21 +- frontend/components/ui/gradient-badge.tsx | 24 +- frontend/components/ui/radio-group.tsx | 82 +- frontend/components/ui/section-heading.tsx | 37 +- frontend/components/ui/tabs.tsx | 24 +- frontend/data/about.ts | 293 ++--- frontend/db/index.ts | 18 +- .../drizzle_legacy/meta/0000_snapshot.json | 118 +- .../drizzle_legacy/meta/0001_snapshot.json | 164 +-- .../drizzle_legacy/meta/0002_snapshot.json | 164 +-- .../drizzle_legacy/meta/0003_snapshot.json | 172 +-- .../drizzle_legacy/meta/0004_snapshot.json | 198 +--- .../drizzle_legacy/meta/0005_snapshot.json | 206 +--- .../drizzle_legacy/meta/0006_snapshot.json | 215 +--- .../drizzle_legacy/meta/0007_snapshot.json | 215 +--- .../drizzle_legacy/meta/0008_snapshot.json | 215 +--- .../drizzle_legacy/meta/0009_snapshot.json | 215 +--- .../drizzle_legacy/meta/0010_snapshot.json | 215 +--- .../drizzle_legacy/meta/0012_snapshot.json | 236 +--- .../drizzle_legacy/meta/0013_snapshot.json | 244 +--- .../drizzle_legacy/meta/0014_snapshot.json | 244 +--- .../drizzle_legacy/meta/0015_snapshot.json | 236 +--- .../drizzle_legacy/meta/_journal.json | 21 +- .../drizzle_legacy/relations.ts | 299 +++-- .../drizzle_legacy/schema.ts | 864 ++++++++------ frontend/db/queries/leaderboard.ts | 10 +- frontend/db/queries/points.ts | 9 +- frontend/db/queries/quiz.ts | 17 +- frontend/db/queries/shop/admin-orders.ts | 3 +- frontend/db/queries/shop/orders.ts | 108 +- frontend/db/queries/shop/products.ts | 9 +- frontend/db/queries/users.ts | 6 +- frontend/db/schema/categories.ts | 12 +- frontend/db/schema/emailVerificationTokens.ts | 28 +- frontend/db/schema/index.ts | 10 +- frontend/db/schema/passwordResetTokens.ts | 28 +- frontend/db/schema/points.ts | 45 +- frontend/db/schema/questions.ts | 15 +- frontend/db/schema/quiz.ts | 21 +- frontend/db/schema/sessions.ts | 10 +- frontend/db/schema/shop.ts | 7 +- frontend/db/schema/users.ts | 41 +- frontend/db/seed-categories.ts | 3 +- frontend/db/seed-demo-leaderboard.ts | 5 +- frontend/db/seed-questions.ts | 4 +- frontend/db/seed-quiz-angular-advanced.ts | 11 +- frontend/db/seed-quiz-angular.ts | 11 +- frontend/db/seed-quiz-css-advanced.ts | 9 +- frontend/db/seed-quiz-css.ts | 9 +- frontend/db/seed-quiz-from-json.ts | 12 +- frontend/db/seed-quiz-git.ts | 123 +- frontend/db/seed-quiz-html-advanced.ts | 9 +- frontend/db/seed-quiz-html.ts | 9 +- frontend/db/seed-quiz-javascript-advanced.ts | 9 +- frontend/db/seed-quiz-javascript.ts | 9 +- frontend/db/seed-quiz-nodejs-advanced.ts | 11 +- frontend/db/seed-quiz-nodejs.ts | 11 +- frontend/db/seed-quiz-react.ts | 12 +- frontend/db/seed-quiz-typescript-advanced.ts | 132 ++- frontend/db/seed-quiz-typescript.ts | 9 +- frontend/db/seed-quiz-verify.ts | 14 +- frontend/db/seed-quiz-vue.ts | 127 +- frontend/db/seed-users.ts | 41 +- frontend/drizzle/meta/0000_snapshot.json | 244 +--- frontend/drizzle/meta/0001_snapshot.json | 252 +--- frontend/drizzle/meta/0002_snapshot.json | 252 +--- frontend/drizzle/meta/0003_snapshot.json | 252 +--- frontend/drizzle/meta/0004_snapshot.json | 252 +--- frontend/drizzle/meta/0005_snapshot.json | 252 +--- frontend/drizzle/meta/_journal.json | 2 +- frontend/eslint.config.mjs | 47 +- frontend/hooks/use-mounted.ts | 12 +- frontend/hooks/useAntiCheat.ts | 2 +- frontend/hooks/useQuizGuards.ts | 18 +- frontend/hooks/useQuizSession.ts | 16 +- frontend/i18n/request.ts | 3 +- frontend/i18n/routing.ts | 3 +- frontend/lib/about/github-sponsors.ts | 97 +- frontend/lib/about/stats.ts | 85 +- frontend/lib/admin/parseAdminProductForm.ts | 5 +- frontend/lib/ai/prompts.ts | 1 - frontend/lib/auth.ts | 4 +- frontend/lib/auth/email-verification.ts | 21 +- frontend/lib/auth/guard-shop-admin-page.ts | 1 + frontend/lib/auth/internal-janitor.ts | 2 +- frontend/lib/auth/oauth-state.ts | 45 +- frontend/lib/auth/password-reset.ts | 33 +- frontend/lib/auth/safe-redirect.ts | 18 +- frontend/lib/cart.ts | 12 +- frontend/lib/config/catalog.ts | 77 +- frontend/lib/email/sendPasswordResetEmail.ts | 39 +- frontend/lib/email/sendVerificationEmail.ts | 18 +- frontend/lib/email/templates/base-layout.ts | 13 +- .../lib/email/templates/reset-password.ts | 12 +- frontend/lib/email/templates/verify-email.ts | 12 +- frontend/lib/email/transporter.ts | 16 +- frontend/lib/env/auth.ts | 88 +- frontend/lib/env/stripe.ts | 47 +- frontend/lib/http/getBaseUrl.ts | 22 +- frontend/lib/logout.ts | 11 +- frontend/lib/psp/stripe.ts | 1 + frontend/lib/quiz/guest-quiz.ts | 10 +- frontend/lib/quiz/quiz-crypto.ts | 9 +- frontend/lib/quiz/quiz-session.ts | 5 +- frontend/lib/redis.ts | 1 + frontend/lib/security/client-ip.ts | 3 +- frontend/lib/security/csrf.ts | 1 + frontend/lib/security/rate-limit.ts | 7 +- frontend/lib/services/inventory.ts | 1 + frontend/lib/services/orders.ts | 10 +- frontend/lib/services/orders/_shared.ts | 8 +- frontend/lib/services/orders/checkout.ts | 24 +- .../lib/services/orders/payment-attempts.ts | 6 +- .../lib/services/orders/payment-intent.ts | 3 +- frontend/lib/services/orders/payment-state.ts | 1 + frontend/lib/services/orders/refund.ts | 3 +- frontend/lib/services/orders/restock.ts | 8 +- frontend/lib/services/orders/summary.ts | 1 - frontend/lib/services/orders/sweeps.ts | 2 +- frontend/lib/services/products.ts | 13 +- .../lib/services/products/admin/queries.ts | 6 +- .../lib/services/products/cart/rehydrate.ts | 16 +- frontend/lib/services/products/mapping.ts | 1 + .../lib/services/products/mutations/create.ts | 8 +- .../lib/services/products/mutations/delete.ts | 6 +- .../lib/services/products/mutations/toggle.ts | 2 +- .../lib/services/products/mutations/update.ts | 15 +- frontend/lib/services/products/prices.ts | 5 +- frontend/lib/services/products/slug.ts | 1 + frontend/lib/shop/data.ts | 27 +- frontend/lib/shop/idempotency.ts | 23 +- frontend/lib/shop/payments.ts | 12 +- frontend/lib/shop/request-locale.ts | 18 +- frontend/lib/shop/slug.ts | 10 +- .../lib/tests/blog/blog-author-route.test.ts | 6 +- .../lib/tests/blog/blog-search-route.test.ts | 6 +- frontend/lib/tests/factories/quiz/quiz.ts | 4 +- frontend/lib/tests/helpers/makeCheckoutReq.ts | 1 + .../lib/tests/q&a/questions-route.test.ts | 4 +- frontend/lib/tests/quiz/guest-quiz.test.ts | 12 +- .../lib/tests/quiz/guest-result-route.test.ts | 11 +- .../lib/tests/quiz/quiz-anticheat.test.ts | 49 +- frontend/lib/tests/quiz/quiz-crypto.test.ts | 12 +- frontend/lib/tests/quiz/quiz-session.test.ts | 32 +- frontend/lib/tests/quiz/quiz-setup.test.ts | 7 +- .../lib/tests/quiz/quiz-slug-route.test.ts | 37 +- frontend/lib/tests/quiz/setup.ts | 2 +- .../lib/tests/quiz/use-quiz-guards.test.ts | 25 +- .../lib/tests/quiz/use-quiz-session.test.ts | 35 +- frontend/lib/tests/quiz/verify-answer.test.ts | 8 +- .../tests/shop/admin-api-killswitch.test.ts | 4 +- .../tests/shop/admin-csrf-contract.test.ts | 2 +- ...-patch-price-config-error-contract.test.ts | 3 +- .../shop/admin-product-sale-contract.test.ts | 2 +- .../cart-rehydrate-variant-sanitize.test.ts | 5 +- .../shop/checkout-concurrency-stock1.test.ts | 14 +- .../shop/checkout-currency-policy.test.ts | 6 +- .../tests/shop/checkout-no-payments.test.ts | 7 +- .../checkout-origin-posture-contract.test.ts | 3 +- ...set-payment-intent-reject-contract.test.ts | 13 +- .../checkout-stripe-error-contract.test.ts | 9 +- frontend/lib/tests/shop/currency.test.ts | 51 +- frontend/lib/tests/shop/format-money.test.ts | 19 +- .../tests/shop/order-items-variants.test.ts | 4 +- frontend/lib/tests/shop/orders-access.test.ts | 4 +- .../lib/tests/shop/origin-posture.test.ts | 5 +- .../shop/payment-state-legacy-writers.test.ts | 3 +- .../shop/payment-status-tripwire.test.ts | 3 +- frontend/lib/tests/shop/prices.test.ts | 16 +- ...product-admin-merged-prices-policy.test.ts | 3 +- ...dmin-update-prices-patch-semantics.test.ts | 5 +- .../tests/shop/product-sale-invariant.test.ts | 6 +- .../shop/public-product-visibility.test.ts | 7 +- .../lib/tests/shop/rate-limit-subject.test.ts | 3 +- .../shop/restock-order-only-once.test.ts | 4 +- .../restock-release-failure-invariant.test.ts | 13 +- .../shop/restock-stale-claim-gate.test.ts | 4 +- .../shop/restock-stale-stripe-orphan.test.ts | 4 +- .../restock-stuck-reserving-sweep.test.ts | 4 +- .../tests/shop/restock-sweep-claim.test.ts | 4 +- .../shop/stripe-webhook-contract.test.ts | 2 +- .../shop/stripe-webhook-mismatch.test.ts | 5 +- .../stripe-webhook-paid-status-repair.test.ts | 3 +- .../shop/stripe-webhook-psp-fields.test.ts | 14 +- .../stripe-webhook-rate-limit-env.test.ts | 1 + .../shop/stripe-webhook-refund-full.test.ts | 3 +- frontend/lib/utils.ts | 6 +- frontend/lib/validation/checkout.ts | 6 +- frontend/lib/validation/shop.ts | 3 +- frontend/messages/en.json | 55 +- frontend/messages/pl.json | 100 +- frontend/messages/uk.json | 60 +- frontend/package-lock.json | 161 ++- frontend/package.json | 8 +- frontend/postcss.config.mjs | 2 +- frontend/proxy.ts | 29 +- frontend/tsconfig.json | 19 +- frontend/vitest.config.ts | 11 +- 405 files changed, 8619 insertions(+), 9858 deletions(-) delete mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 3fed3135..00000000 --- a/.prettierrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "printWidth": 80, - "useTabs": false, - "semi": true, - "singleQuote": true, - "trailingComma": "es5", - "bracketSpacing": true, - "arrowParens": "avoid", - "proseWrap": "always" -} diff --git a/frontend/.prettierrc b/frontend/.prettierrc index 3fed3135..e6e05952 100644 --- a/frontend/.prettierrc +++ b/frontend/.prettierrc @@ -6,5 +6,8 @@ "trailingComma": "es5", "bracketSpacing": true, "arrowParens": "avoid", - "proseWrap": "always" + "proseWrap": "always", + + "plugins": ["prettier-plugin-tailwindcss"], + "tailwindFunctions": ["clsx", "cn"] } diff --git a/frontend/README.md b/frontend/README.md index e215bc4c..0a7fac56 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,4 +1,5 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). +This is a [Next.js](https://nextjs.org) project bootstrapped with +[`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). ## Getting Started @@ -14,23 +15,35 @@ pnpm dev bun dev ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +Open [http://localhost:3000](http://localhost:3000) with your browser to see the +result. -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. +You can start editing the page by modifying `app/page.tsx`. The page +auto-updates as you edit the file. -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. +This project uses +[`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) +to automatically optimize and load [Geist](https://vercel.com/font), a new font +family for Vercel. ## Learn More To learn more about Next.js, take a look at the following resources: -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js + features and API. - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! +You can check out +[the Next.js GitHub repository](https://github.com/vercel/next.js) - your +feedback and contributions are welcome! ## Deploy on Vercel -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. +The easiest way to deploy your Next.js app is to use the +[Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) +from the creators of Next.js. -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. +Check out our +[Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) +for more details. diff --git a/frontend/actions/quiz.ts b/frontend/actions/quiz.ts index 85724b50..20aac9fb 100644 --- a/frontend/actions/quiz.ts +++ b/frontend/actions/quiz.ts @@ -1,15 +1,16 @@ 'use server'; +import { and,eq, inArray } from 'drizzle-orm'; + import { db } from '@/db'; +import { awardQuizPoints, calculateQuizPoints } from '@/db/queries/points'; import { - quizAttempts, - quizAttemptAnswers, quizAnswers, + quizAttemptAnswers, + quizAttempts, quizQuestions, } from '@/db/schema/quiz'; -import { awardQuizPoints,calculateQuizPoints } from '@/db/queries/points'; import { getCurrentUser } from '@/lib/auth'; -import { eq, inArray, and } from 'drizzle-orm'; export interface UserAnswer { questionId: string; @@ -93,7 +94,8 @@ export async function submitQuizAttempt( return { success: false, error: 'Unauthorized' }; } - const { userId, quizId, answers, violations, startedAt, completedAt } = input; + const { userId, quizId, answers, violations, startedAt, completedAt } = + input; if (userId && userId !== session.id) { return { success: false, error: 'User mismatch' }; @@ -186,9 +188,10 @@ export async function submitQuizAttempt( }; } - const percentage = ((correctAnswersCount / questionIds.length) * 100).toFixed( - 2 - ); + const percentage = ( + (correctAnswersCount / questionIds.length) * + 100 + ).toFixed(2); const integrityScore = calculateIntegrityScore(violations); const timeSpentSeconds = Math.floor( (completedAtDate.getTime() - startedAtDate.getTime()) / 1000 diff --git a/frontend/app/[locale]/about/page.tsx b/frontend/app/[locale]/about/page.tsx index 57c93a75..e4313412 100644 --- a/frontend/app/[locale]/about/page.tsx +++ b/frontend/app/[locale]/about/page.tsx @@ -1,38 +1,34 @@ -import { getTranslations } from "next-intl/server" -import { getPlatformStats } from "@/lib/about/stats" -import { getSponsors } from "@/lib/about/github-sponsors" +import { getTranslations } from 'next-intl/server'; -import { HeroSection } from "@/components/about/HeroSection" -import { TopicsSection } from "@/components/about/TopicsSection" -import { FeaturesSection } from "@/components/about/FeaturesSection" -import { PricingSection } from "@/components/about/PricingSection" -import { CommunitySection } from "@/components/about/CommunitySection" +import { CommunitySection } from '@/components/about/CommunitySection'; +import { FeaturesSection } from '@/components/about/FeaturesSection'; +import { HeroSection } from '@/components/about/HeroSection'; +import { PricingSection } from '@/components/about/PricingSection'; +import { TopicsSection } from '@/components/about/TopicsSection'; +import { getSponsors } from '@/lib/about/github-sponsors'; +import { getPlatformStats } from '@/lib/about/stats'; export async function generateMetadata() { - const t = await getTranslations("about") + const t = await getTranslations('about'); return { - title: t("metaTitle"), - description: t("metaDescription"), - } + title: t('metaTitle'), + description: t('metaDescription'), + }; } export default async function AboutPage() { const [stats, sponsors] = await Promise.all([ getPlatformStats(), - getSponsors() - ]) + getSponsors(), + ]); return ( -
- +
-
- ) -} \ No newline at end of file + ); +} diff --git a/frontend/app/[locale]/blog/[slug]/PostDetails.tsx b/frontend/app/[locale]/blog/[slug]/PostDetails.tsx index 7ce07d19..f16b593a 100644 --- a/frontend/app/[locale]/blog/[slug]/PostDetails.tsx +++ b/frontend/app/[locale]/blog/[slug]/PostDetails.tsx @@ -1,11 +1,12 @@ +import groq from 'groq'; import Image from 'next/image'; import { notFound } from 'next/navigation'; -import groq from 'groq'; import { getTranslations } from 'next-intl/server'; + import { client } from '@/client'; +import { DynamicGridBackground } from '@/components/shared/DynamicGridBackground'; import { Link } from '@/i18n/routing'; import { formatBlogDate } from '@/lib/blog/date'; -import { DynamicGridBackground } from '@/components/shared/DynamicGridBackground'; export const revalidate = 0; @@ -189,7 +190,7 @@ function renderPortableTextBlock(block: any, index: number): React.ReactNode { return (
{children}
@@ -209,7 +210,7 @@ function renderPortableTextBlock(block: any, index: number): React.ReactNode { return (

{children}

@@ -283,7 +284,7 @@ function renderPortableText( key={block._key || `image-${i}`} src={block.url} alt={postTitle || 'Post image'} - className="rounded-xl border border-gray-200 my-6" + className="my-6 rounded-xl border border-gray-200" /> ); i += 1; @@ -482,7 +483,7 @@ export default async function PostDetails({ : null; return ( - +
{breadcrumbsJsonLd && (