Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎨 Add linting and prettier to more places #1432

Merged
merged 6 commits into from
Nov 9, 2024
Merged

Conversation

lukevella
Copy link
Owner

@lukevella lukevella commented Nov 9, 2024

Summary by CodeRabbit

  • New Features

    • Introduced new marketing components: Mention, MentionedBy, and BigTestimonial.
  • Bug Fixes

    • Minor formatting adjustments in various components to improve code consistency and readability without affecting functionality.
  • Chores

    • Removed unnecessary spaces in class names across multiple components for cleaner code.
    • Updated ESLint configurations and TypeScript settings for better compliance and structure.
    • Added new utility classes in CSS for enhanced styling options.
  • Documentation

    • Updated package.json scripts for better clarity and organization.

Copy link

vercel bot commented Nov 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2024 3:56pm
landing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2024 3:56pm

Copy link
Contributor

coderabbitai bot commented Nov 9, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request introduces various minor formatting changes across multiple files, primarily focusing on import statements and class name adjustments for consistency and readability. Key functionalities, such as locale handling in middleware and user interface components, remain unchanged. Additionally, new components are added in the marketing section, while several scripts in package configurations are updated or removed. Overall, the changes are cosmetic, enhancing code clarity without altering core logic or functionality.

Changes

File Change Summary
apps/landing/src/middleware.ts Minor formatting change in import statement for NextRequest. Core functionality unchanged.
apps/web/declarations/next-auth.d.ts Refined import statement for DefaultJWT. Updated Session, User, and JWT interfaces to include new properties (locale, timeZone, timeFormat, weekStart).
apps/web/sentry.server.config.ts Removed commented-out line for Spotlight feature. Configuration remains unchanged.
apps/web/src/app/[locale]/(admin)/settings/profile/delete-account-dialog.tsx Adjusted formatting in import statement for DialogProps. Functionality unchanged.
apps/web/src/app/[locale]/poll/[urlId]/duplicate-dialog.tsx Adjusted formatting in import statement for DialogProps. Functionality unchanged.
apps/web/src/app/[locale]/poll/[urlId]/edit-details/page.tsx Modified import statements for consistency. Functionality unchanged.
apps/web/src/app/[locale]/poll/[urlId]/edit-settings/page.tsx Updated import for PollSettingsFormData. Formatting adjustment only.
apps/web/src/app/api/logout/route.ts Minor formatting change in import statement for NextRequest. Functionality unchanged.
apps/web/src/app/api/storage/[...key]/route.ts Reformatted import statement for NextRequest. Functionality unchanged.
apps/web/src/app/global-error.tsx Updated parameter destructuring for error. Formatting change only.
apps/web/src/components/add-to-calendar-button.tsx Adjusted import statements for clarity. Functionality unchanged.
apps/web/src/components/create-poll.tsx Minor formatting change in import statement for NewEventData. Functionality unchanged.
apps/web/src/components/participant-dropdown.tsx Minor formatting adjustments. Functionality unchanged.
apps/web/src/components/pay-wall-dialog.tsx Adjusted import statements for clarity. Functionality unchanged.
apps/web/src/components/poll-context.tsx Updated imports for clarity. Functionality unchanged.
apps/web/src/components/poll/manage-poll/finalize-poll-dialog.tsx Minor formatting adjustments. Functionality unchanged.
apps/web/tests/create-delete-poll.spec.ts Minor formatting change in import statement for Page. Functionality unchanged.
apps/web/tests/edit-options.spec.ts Minor formatting change in import statement for Page. Functionality unchanged.
packages/billing/.eslintrc.js Updated ESLint configuration import.
packages/billing/package.json Added new linting script and modified existing scripts.
packages/emails/.eslintrc.js Modified ESLint configuration import.
packages/emails/src/components/styled-components.tsx Minor formatting adjustments in imports.
packages/emails/src/templates/new-comment.tsx Consolidated import statement and defined new interface NewCommentEmailProps.
packages/posthog/package.json Added new scripts for linting and type-checking.
packages/posthog/src/next/middleware.ts Changed import for NextResponse to a type import.
packages/ui/src/avatar.tsx Added seed prop to AvatarFallback component.
packages/ui/src/flex.tsx Minor formatting changes in imports.
packages/ui/src/form.tsx Consolidated import statements for improved readability.
packages/ui/src/hooks/use-toast.ts Minor formatting change in export statement.
packages/ui/src/icon.tsx Minor formatting change in import statement.
packages/ui/src/toast.tsx Changed import for VariantProps to type import.
packages/utils/.eslintrc.js New ESLint configuration file created.
packages/utils/package.json Updated scripts and removed "type" field.
packages/eslint-config/.eslintrc.js New ESLint configuration file created.
packages/eslint-config/preset.js Adjusted the project property in ESLint configuration.
apps/landing/package.json Removed "prettier" script.
apps/landing/src/app/[locale]/blog/layout.tsx Minor formatting adjustment in class name.
apps/landing/src/app/[locale]/footer.tsx Minor formatting adjustment in class name.
apps/landing/src/app/[locale]/nav-link.tsx Minor formatting adjustment in class name.
apps/landing/src/app/[locale]/pricing/page.tsx Minor formatting adjustment in header class.
apps/landing/src/components/error-page.tsx Minor formatting adjustment in class name.
apps/landing/src/components/home/bonus.tsx Minor formatting adjustment in class name.
apps/landing/src/components/marketing.tsx Restructured marketing components and removed old components.
apps/landing/src/style.css Minor formatting adjustments and new utility classes added.
apps/landing/tsconfig.json Minor formatting adjustments.
apps/web/package.json Removed "prettier" script.
apps/web/src/app/[locale]/(admin)/menu-item.tsx Minor formatting adjustment in class name.
apps/web/src/app/[locale]/(admin)/sidebar.tsx Minor formatting adjustment in class name.
apps/web/src/app/[locale]/not-found.tsx Minor formatting adjustment in JSX structure.
apps/web/src/components/cookie-consent.tsx Minor formatting adjustment in button class name.
apps/web/src/components/discussion/discussion.tsx Minor formatting adjustment in timestamp class name.
apps/web/src/components/forms/poll-options-form/week-calendar.tsx Adjusted class names for styling consistency.
apps/web/src/components/forms/poll-settings.tsx Minor formatting adjustment in class name.
apps/web/src/components/poll/desktop-poll.tsx Minor formatting adjustment in table class name and added EscapeListener.
apps/web/src/components/steps/steps.tsx Minor formatting adjustment in class name.
apps/web/src/style.css Adjusted utility classes and added new background pattern classes.
apps/web/tsconfig.json Minor formatting adjustments.
packages/billing/tsconfig.json Minor formatting adjustment in exclude property.
packages/database/tsconfig.json Minor formatting adjustment in exclude property.
packages/emails/tsconfig.json Minor formatting adjustments in JSON structure.
packages/icons/tsconfig.json Minor formatting adjustment in exclude property.
packages/languages/tsconfig.json Minor formatting adjustment in exclude property.
packages/posthog/tsconfig.json Minor formatting adjustment in exclude property.
packages/ui/src/textarea.tsx Minor formatting adjustment in class names.
packages/ui/tsconfig.json Minor formatting adjustments in paths and exclude sections.
packages/utils/tsconfig.json Minor formatting adjustments in JSON structure.
turbo.json Added new format task and fixed JSON syntax in i18n:scan task.

Possibly related PRs

Poem

🐰 In the code where bunnies hop,
Formatting changes never stop.
Imports tidy, classes neat,
A cleaner path for code to greet.
With every line, a joyful cheer,
For clarity brings the code so dear! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (8)
packages/posthog/package.json (1)

10-14: Consider enhancing the script configurations.

The addition of linting, type checking, and formatting scripts is a good practice. However, consider these improvements:

  1. Make the lint script more specific and strict:
  2. Scope the prettier command to specific file types:
 "scripts": {
-  "lint": "eslint ./src",
+  "lint": "eslint './src/**/*.{js,jsx,ts,tsx}' --max-warnings=0",
   "type-check": "tsc --noEmit",
-  "prettier": "prettier --write ."
+  "prettier": "prettier --write './src/**/*.{js,jsx,ts,tsx,json,css,md}'"
 }

These changes will:

  • Explicitly target relevant file extensions for linting
  • Enforce zero warnings policy
  • Scope prettier to specific file types and directories to avoid formatting unwanted files
packages/billing/package.json (1)

13-15: LGTM! Consider adding --fix flag to lint script.

The addition of prettier and lint scripts aligns well with the PR objectives. The trailing comma in the type-check script improves git diff readability.

Consider adding the --fix flag to automatically fix auto-fixable issues:

-    "lint": "eslint ./src"
+    "lint": "eslint ./src --fix"
packages/database/package.json (1)

11-12: Consider adding a lint script for consistency

Other packages in the monorepo (e.g., @rallly/billing, @rallly/posthog) include both lint and prettier scripts. For consistency across packages, consider adding a lint script here as well.

Add the lint script:

  "scripts": {
    "db:generate": "prisma generate",
    "db:push": "prisma db push --skip-generate",
    "db:deploy": "prisma migrate deploy",
    "db:migrate": "prisma migrate dev",
    "db:seed": "tsx prisma/seed.ts",
    "type-check": "tsc --pretty --noEmit",
+   "lint": "eslint .",
    "prettier": "prettier --write ."
  },
apps/web/declarations/next-auth.d.ts (1)

Line range hint 13-36: Consider extracting common properties into a shared interface.

The same set of properties (locale, timeZone, timeFormat, weekStart) are repeated across all three interfaces. Consider extracting these into a shared interface to improve maintainability and reduce duplication.

interface UserPreferences {
  locale?: string | null;
  timeZone?: string | null;
  timeFormat?: TimeFormat | null;
  weekStart?: number | null;
}

declare module "next-auth" {
  interface Session {
    user: UserPreferences & DefaultSession["user"] & {
      id: string;
    };
  }

  interface User extends DefaultUser, UserPreferences {}
}

declare module "next-auth/jwt" {
  interface JWT extends DefaultJWT, UserPreferences {}
}
apps/web/src/app/api/storage/[...key]/route.ts (1)

Line range hint 39-60: Consider enhancing error handling and security.

While not directly related to the formatting changes, here are some suggestions to improve the code:

  1. Add specific error handling for different S3 errors (NoSuchKey, AccessDenied, etc.)
  2. Add validation for the imageKey to prevent path traversal
  3. Implement a whitelist for allowed content types

Here's a suggested implementation:

 export async function GET(
   _req: NextRequest,
   context: { params: { key: string[] } },
 ) {
   const imageKey = context.params.key.join("/");
 
   if (!imageKey) {
     return new NextResponse("No key provided", { status: 400 });
   }
+  // Prevent path traversal
+  if (imageKey.includes('..')) {
+    return new NextResponse("Invalid key", { status: 400 });
+  }
 
   try {
     const { buffer, contentType } = await getAvatar(imageKey);
+    // Whitelist allowed content types
+    const allowedTypes = ['image/jpeg', 'image/png', 'image/gif'];
+    const safeContentType = allowedTypes.includes(contentType) 
+      ? contentType 
+      : 'application/octet-stream';
+
     return new NextResponse(buffer, {
       headers: {
-        "Content-Type": contentType,
+        "Content-Type": safeContentType,
         "Cache-Control": "public, max-age=3600",
       },
     });
   } catch (error) {
+    if (error instanceof Error) {
+      if (error.message === "Object not found") {
+        return NextResponse.json(
+          { error: "File not found" },
+          { status: 404 }
+        );
+      }
+    }
     console.error(error);
     return NextResponse.json(
       { error: "Failed to fetch object" },
       { status: 500 },
     );
   }
 }
packages/emails/src/templates/new-comment.tsx (1)

Line range hint 12-45: Consider using Trans component for preview text consistency.

While the component implementation looks good overall, consider using the Trans component for the preview text to maintain consistency with other translated content in the component.

Here's a suggested improvement:

      preview={ctx.t("newComment_preview", {
        ns: "emails",
        defaultValue: "Go to your poll to see what they said.",
-     })}
+     })}
+     // Alternative: Use Trans component for consistency
+     // preview={
+     //   <Trans
+     //     i18n={ctx.i18n}
+     //     ns="emails"
+     //     i18nKey="newComment_preview"
+     //     defaults="Go to your poll to see what they said."
+     //   />
+     // }
packages/ui/src/avatar.tsx (2)

Line range hint 39-77: Consider enhancing the color system implementation.

While the current implementation is functional, here are some suggestions to make it more robust:

+type ColorPair = {
+  bg: string;
+  text: string;
+};

-const colorPairs = [
+const colorPairs: ColorPair[] = [
   { bg: "#E6F4FF", text: "#0065BD" },
   // ... other pairs
];

+const colorCache = new Map<string, { bgColor: string; textColor: string }>();

 export function getColor(seed: string): {
   bgColor: string;
   textColor: string;
 } {
+  const cached = colorCache.get(seed);
+  if (cached) return cached;
+
   let hash = 0;
   for (let i = 0; i < seed.length; i++) {
     hash = seed.charCodeAt(i) + ((hash << 5) - hash);
   }
   const colorPair = colorPairs[Math.abs(hash) % colorPairs.length];
-  return { bgColor: colorPair.bg, textColor: colorPair.text };
+  const result = { bgColor: colorPair.bg, textColor: colorPair.text };
+  colorCache.set(seed, result);
+  return result;
 }

These changes would:

  1. Add type safety for color pairs
  2. Implement memoization to improve performance for repeated seeds
  3. Make the code more maintainable

Line range hint 39-53: Consider extracting the color system to a shared utility.

The color pairs and color generation logic could be useful for other components beyond avatars. Consider moving this to a shared utility module (e.g., packages/ui/src/utils/colors.ts) to promote reusability and maintain a single source of truth for your design system's color palette.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between de6963d and 77c6c36.

📒 Files selected for processing (36)
  • apps/landing/src/middleware.ts (1 hunks)
  • apps/web/declarations/next-auth.d.ts (1 hunks)
  • apps/web/sentry.server.config.ts (0 hunks)
  • apps/web/src/app/[locale]/(admin)/settings/profile/delete-account-dialog.tsx (1 hunks)
  • apps/web/src/app/[locale]/poll/[urlId]/duplicate-dialog.tsx (1 hunks)
  • apps/web/src/app/[locale]/poll/[urlId]/edit-details/page.tsx (1 hunks)
  • apps/web/src/app/[locale]/poll/[urlId]/edit-settings/page.tsx (1 hunks)
  • apps/web/src/app/api/logout/route.ts (1 hunks)
  • apps/web/src/app/api/storage/[...key]/route.ts (1 hunks)
  • apps/web/src/app/global-error.tsx (2 hunks)
  • apps/web/src/components/add-to-calendar-button.tsx (1 hunks)
  • apps/web/src/components/create-poll.tsx (1 hunks)
  • apps/web/src/components/participant-dropdown.tsx (1 hunks)
  • apps/web/src/components/pay-wall-dialog.tsx (1 hunks)
  • apps/web/src/components/poll-context.tsx (1 hunks)
  • apps/web/src/components/poll/manage-poll/finalize-poll-dialog.tsx (1 hunks)
  • apps/web/tests/create-delete-poll.spec.ts (1 hunks)
  • apps/web/tests/edit-options.spec.ts (1 hunks)
  • packages/billing/.eslintrc.js (1 hunks)
  • packages/billing/package.json (1 hunks)
  • packages/database/package.json (1 hunks)
  • packages/emails/.eslintrc.js (1 hunks)
  • packages/emails/package.json (1 hunks)
  • packages/emails/src/components/styled-components.tsx (1 hunks)
  • packages/emails/src/templates/new-comment.tsx (1 hunks)
  • packages/posthog/package.json (1 hunks)
  • packages/posthog/src/next/middleware.ts (1 hunks)
  • packages/ui/package.json (1 hunks)
  • packages/ui/src/avatar.tsx (1 hunks)
  • packages/ui/src/flex.tsx (1 hunks)
  • packages/ui/src/form.tsx (1 hunks)
  • packages/ui/src/hooks/use-toast.ts (1 hunks)
  • packages/ui/src/icon.tsx (1 hunks)
  • packages/ui/src/toast.tsx (1 hunks)
  • packages/utils/.eslintrc.js (1 hunks)
  • packages/utils/package.json (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/web/sentry.server.config.ts
✅ Files skipped from review due to trivial changes (21)
  • apps/landing/src/middleware.ts
  • apps/web/src/app/[locale]/(admin)/settings/profile/delete-account-dialog.tsx
  • apps/web/src/app/[locale]/poll/[urlId]/duplicate-dialog.tsx
  • apps/web/src/app/[locale]/poll/[urlId]/edit-details/page.tsx
  • apps/web/src/app/api/logout/route.ts
  • apps/web/src/components/create-poll.tsx
  • apps/web/src/components/participant-dropdown.tsx
  • apps/web/src/components/pay-wall-dialog.tsx
  • apps/web/src/components/poll/manage-poll/finalize-poll-dialog.tsx
  • apps/web/tests/create-delete-poll.spec.ts
  • apps/web/tests/edit-options.spec.ts
  • packages/billing/.eslintrc.js
  • packages/emails/.eslintrc.js
  • packages/emails/src/components/styled-components.tsx
  • packages/posthog/src/next/middleware.ts
  • packages/ui/src/flex.tsx
  • packages/ui/src/form.tsx
  • packages/ui/src/hooks/use-toast.ts
  • packages/ui/src/icon.tsx
  • packages/ui/src/toast.tsx
  • packages/utils/.eslintrc.js
🔇 Additional comments (15)
packages/utils/package.json (2)

6-9: LGTM! Development workflow improvements added.

Good additions that align with the PR objectives:

  • Prettier formatting with --write .
  • ESLint for static analysis
  • TypeScript type checking

Let's verify the configuration files are in place:

#!/bin/bash
# Check for required config files
echo "Checking for Prettier config..."
fd -t f -e json -e yaml -e js "prettier" 

echo "Checking for ESLint config..."
fd -t f -e json -e yaml -e js "eslint" 

echo "Checking for TypeScript config..."
fd -t f "tsconfig.json"

1-5: Verify the impact of removing "type": "module"

The removal of the module type declaration could affect how Node.js interprets this package and its imports. This change might require updates to import statements across the codebase.

Let's verify the impact:

✅ Verification successful

Let me gather more specific information about the imports and module usage.


Based on the search results, I can now generate the final response:

Removing "type": "module" is safe in this context

The codebase exclusively uses ES Module imports with TypeScript, which are handled by the TypeScript compiler configuration rather than Node.js's module system. All imports of @rallly/utils are using the ES Module import syntax, and there are no require() statements found. The removal of "type": "module" won't impact the existing imports because:

  • All imports are using modern ES Module syntax (e.g., import { absoluteUrl } from "@rallly/utils/absolute-url")
  • The package is used within a TypeScript ecosystem where module resolution is controlled by tsconfig.json
  • No CommonJS require() statements were found in the codebase
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for ES module imports that might be affected
rg -g '*.{ts,js}' -l 'import .* from.*@rallly/utils'

# Check for any import/export statements in the source files
rg -g '*.{ts,js}' -l '^(import|export)' packages/utils/src/

Length of output: 613


Script:

#!/bin/bash
# Check how @rallly/utils is imported in the codebase
rg -g '*.{ts,js}' -A 2 'from.*@rallly/utils'

# Check the type of imports/exports in utils package
rg -g '*.{ts,js}' -A 2 '^(import|export)' packages/utils/src/

# Check if there are any require() statements
rg -g '*.{ts,js}' 'require\(["\']@rallly/utils'

# Check package.json files that depend on @rallly/utils
rg -g 'package.json' '"@rallly/utils":'

Length of output: 4202

apps/web/src/app/global-error.tsx (2)

7-11: LGTM! Clean formatting improvement.

The parameter destructuring has been formatted across multiple lines, improving readability while maintaining the same functionality.


Line range hint 1-27: LGTM! File maintains proper error handling.

The core error handling functionality with Sentry integration and NextError component remains correctly implemented, with only formatting improvements applied.

packages/emails/package.json (1)

9-9: Consider enhancing the Prettier integration.

The addition of Prettier is good, but consider these improvements:

  1. Add a check-only script for CI pipelines
  2. Add a combined script for all checks
  3. Ensure proper configuration is in place

Consider adding these scripts:

 "scripts": {
   "dev": "email dev --port 3333 --dir ./src/previews",
   "lint": "eslint ./src",
   "type-check": "tsc --pretty --noEmit",
   "prettier": "prettier --write .",
+  "prettier:check": "prettier --check .",
+  "format": "prettier --write .",
+  "check": "npm run lint && npm run type-check && npm run prettier:check",
   "i18n:scan": "i18next-scanner --config i18next-scanner.config.js"
 }
apps/web/declarations/next-auth.d.ts (1)

Line range hint 13-20: LGTM! Type definitions are well-structured.

The interface extensions are properly typed with optional properties and null unions, maintaining type safety across session, user, and JWT objects.

Also applies to: 22-28, 30-36

packages/ui/package.json (1)

11-11: LGTM! Good addition of the prettier script.

The addition of the prettier script aligns well with the PR's objective to enhance code formatting capabilities.

apps/web/src/app/api/storage/[...key]/route.ts (1)

2-2: LGTM! Import formatting aligns with PR objectives.

The type import formatting change is consistent with the PR's goal of improving code formatting and follows TypeScript best practices.

packages/emails/src/templates/new-comment.tsx (3)

3-3: LGTM! Import statement formatting looks good.

The consolidated import statement follows consistent formatting practices.


Line range hint 8-10: LGTM! Interface definition is well-structured.

The interface properly extends NotificationBaseProps and includes the necessary authorName property with appropriate typing.


Line range hint 47-58: LGTM! Static method implementation is well-structured.

The getSubject method is properly typed and correctly implements internationalization with variable interpolation.

apps/web/src/app/[locale]/poll/[urlId]/edit-settings/page.tsx (1)

9-10: LGTM! Import statements are properly formatted.

The changes align with the PR's objective of improving code formatting. The explicit type import for PollSettingsFormData follows TypeScript best practices by separating type imports from value imports.

packages/ui/src/avatar.tsx (1)

84-84: LGTM! Export statement formatting improved.

The spacing after commas in the export statement enhances readability and follows standard formatting conventions.

apps/web/src/components/add-to-calendar-button.tsx (1)

12-13: LGTM! Import statements properly organized.

The changes improve code organization by:

  • Explicitly importing types using the type keyword
  • Consolidating related calendar function imports
apps/web/src/components/poll-context.tsx (1)

11-11: LGTM! Import changes are well-organized and properly utilized.

The added imports are consistent with the codebase usage:

  • ParsedTimeSlotOption type is used in type declarations
  • getDuration function is used in the createOptionsContextValue function

Also applies to: 13-13

packages/database/package.json Outdated Show resolved Hide resolved
apps/web/declarations/next-auth.d.ts Outdated Show resolved Hide resolved
packages/ui/package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
packages/eslint-config/preset.js (2)

21-21: Consider using template literals for consistency.

While string concatenation works, template literals are more commonly used in modern JavaScript/TypeScript codebases.

-      project: workspaceDirPath + "/tsconfig.json",
+      project: `${workspaceDirPath}/tsconfig.json`,

31-38: LGTM! Well-structured type import rules.

The TypeScript type import configuration is well thought out. The rules will:

  • Enforce clear separation between type and value imports
  • Improve tree-shaking potential
  • Maintain consistent import style across the codebase

Moving these rules to the TypeScript override section is the correct approach as they are TypeScript-specific.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 77c6c36 and ce800df.

📒 Files selected for processing (3)
  • packages/eslint-config/.eslintrc.js (1 hunks)
  • packages/eslint-config/preset.js (2 hunks)
  • packages/ui/src/toast.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/eslint-config/.eslintrc.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/ui/src/toast.tsx

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.

1 participant