Skip to content

Conversation

@hbjORbj
Copy link
Contributor

@hbjORbj hbjORbj commented Sep 15, 2025

What does this PR do?

  • Add an ESlint rule for blocking importing features from appstore, lib, prisma
  • Left self-review comments

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A - I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

Logs of testing

// packages/app-store/...
import { trpc as x } from "@calcom/trpc/react";
import { TRPCError } from "@trpc/server";
import { trpc } from "../trpc/react";

throws
Screenshot 2025-09-17 at 5 57 13 PM

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 15, 2025

Walkthrough

Replaces a single path-based no-restricted-imports override in .eslintrc.js with four file-scoped overrides using patterns/group constraints and explicit messages. Overrides target: (1) packages/app-store + packages/lib — warn on importing features; (2) packages/lib — warn on importing app-store or features; (3) packages/app-store — error on importing trpc; (4) packages/prisma — error on importing features. Each override uses grouped pattern matching and per-block messages.

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "chore: eslint rule for blocking importing features from appstore, lib, prisma" accurately and concisely summarizes the primary change (adding ESLint rules to block cross-package feature imports) and matches the .eslintrc.js modifications described in the raw_summary and PR objectives.
Description Check ✅ Passed The PR description directly describes adding the ESLint rule to block imports from appstore, lib, and prisma, includes the self-review checklist and testing logs, and aligns with the raw_summary and PR objectives, so it meets the lenient requirement for a related description.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/eslint-rule

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

❤️ Share

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

@graphite-app graphite-app bot requested review from a team September 15, 2025 07:50
@hbjORbj hbjORbj changed the title chore: eslint rule chore: eslint rule for blocking importing features from appstore, lib, prisma Sep 15, 2025
@keithwillcode keithwillcode added core area: core, team members only foundation labels Sep 15, 2025
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: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between cbfd991 and e56a5ed.

📒 Files selected for processing (1)
  • .eslintrc.js (2 hunks)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Tests / Unit
  • GitHub Check: Linters / lint
  • GitHub Check: Type check / check-types
🔇 Additional comments (2)
.eslintrc.js (2)

31-32: LGTM: clear tRPC restriction message.

Message is explicit and actionable; good guidance for routing UI to the right place.


16-17: Block root imports too

Switching from paths → patterns removed the explicit root block; '@calcom/app-store' and '@calcom/features' (no subpath) are now allowed. Add root entries.

Apply this diff:

-            patterns: ["@calcom/app-store/*", "@calcom/features/*"],
+            patterns: [
+              "@calcom/app-store",
+              "@calcom/app-store/*",
+              "@calcom/features",
+              "@calcom/features/*"
+            ],

Search in this environment returned "No files were searched" — unable to confirm absence of bare-root imports; run a repo-wide search locally to verify.

@vercel
Copy link

vercel bot commented Sep 15, 2025

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

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Sep 19, 2025 7:26am
cal-eu Ignored Ignored Sep 19, 2025 7:26am

"no-restricted-imports": [
"warn",
{
paths: ["@calcom/app-store"],
Copy link
Contributor Author

@hbjORbj hbjORbj Sep 15, 2025

Choose a reason for hiding this comment

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

patterns alone is sufficient

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: 1

♻️ Duplicate comments (1)
.eslintrc.js (1)

24-42: Duplicate rule key: the second no-restricted-imports overrides the first. Merge them.

Only the last key in the object is applied, which downgrades severity and drops allowTypeImports and the tRPC block. Merge into a single rule and also block the @calcom/features root with a dev-facing message.

-        "no-restricted-imports": [
-          "error",
-          {
-            allowTypeImports: false,
-            patterns: [
-              {
-                group: ["@calcom/trpc/*", "@trpc/*"],
-                message:
-                  "tRPC imports are blocked in packages/app-store. Move UI to apps/web/components/apps or introduce an API boundary.",
-              },
-            ],
-          },
-        ],
-        "no-restricted-imports": [
-          "warn",
-          {
-            patterns: ["@calcom/features/*"],
-          },
-        ],
+        "no-restricted-imports": [
+          "error",
+          {
+            allowTypeImports: false,
+            patterns: [
+              {
+                group: ["@calcom/trpc/*", "@trpc/*"],
+                message:
+                  "tRPC imports are blocked in packages/app-store. Move UI to apps/web/components/apps or introduce an API boundary.",
+              },
+              {
+                group: ["@calcom/features", "@calcom/features/*"],
+                message:
+                  "Features are not allowed in packages/app-store. Move UI to apps/web/components/apps or introduce an API boundary.",
+              },
+            ],
+          },
+        ],

Run to confirm there are no other duplicate rule keys for the same override:

#!/bin/bash
# Detect duplicate "no-restricted-imports" keys within a single rules object of any override.
rg -nP '(?s)files:\s*\[.*?\]\s*,\s*rules:\s*\{[^}]*"no-restricted-imports"[^}]*"no-restricted-imports"' -C2 .eslintrc.js
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e56a5ed and 837f53b.

📒 Files selected for processing (1)
  • .eslintrc.js (2 hunks)
🔇 Additional comments (1)
.eslintrc.js (1)

31-32: LGTM — message reads clearly and points to the right remediation.

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: 1

♻️ Duplicate comments (1)
.eslintrc.js (1)

13-18: Make it actually block in lib/prisma: use error severity, add allowTypeImports, add guidance.

The PR says “block,” but this is only a warning. Also, be explicit about type-only imports and provide actionable messages.

Apply this diff:

         "no-restricted-imports": [
-          "warn",
+          "error",
           {
-            patterns: ["@calcom/app-store", "@calcom/app-store/*", "@calcom/features", "@calcom/features/*"],
+            allowTypeImports: false,
+            patterns: [
+              {
+                group: ["@calcom/app-store", "@calcom/app-store/*"],
+                message: "app-store code must not be imported into lib/prisma. Move shared contracts to packages/lib or introduce an API boundary.",
+              },
+              {
+                group: ["@calcom/features", "@calcom/features/*"],
+                message: "features are not allowed in lib/prisma. Extract shareable code to packages/lib or create an API boundary.",
+              },
+            ],
           },
         ],
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e550845 and ab9faab.

📒 Files selected for processing (1)
  • .eslintrc.js (2 hunks)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Production builds / Build Atoms
🔇 Additional comments (1)
.eslintrc.js (1)

30-37: LGTM: tRPC ban expanded correctly.

Including both “@calcom/trpc” and “@trpc” (and their subpaths) at error level with a clear message is good.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 15, 2025

E2E results are ready!

@hbjORbj hbjORbj marked this pull request as draft September 16, 2025 11:22
@pull-request-size pull-request-size bot added size/M and removed size/S labels Sep 17, 2025
@hbjORbj hbjORbj marked this pull request as ready for review September 17, 2025 08:04
@hbjORbj hbjORbj marked this pull request as draft September 17, 2025 08:05
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: 1

♻️ Duplicate comments (1)
.eslintrc.js (1)

12-16: Critical: app-store→features ban is shadowed by the later override; consolidate and make it error-level.

Files under packages/app-store match both overrides; the later one replaces the earlier rule config for import/no-restricted-paths, dropping the features ban. Also, "block" implies error severity. Fix by removing app-store from the first override, pruning unrelated zones, and adding the features zone into the app-store override at error level.

Apply this diff:

@@
-    // WARN: features must not be imported by app-store, prisma, or lib
+    // ERROR: features must not be imported by prisma (app-store handled below; lib handled in its override)
     {
       files: [
-        "packages/app-store/**/*.{ts,tsx,js,jsx}",
         "packages/prisma/**/*.{ts,tsx,js,jsx}",
-        "packages/lib/**/*.{ts,tsx,js,jsx}",
       ],
       rules: {
         "import/no-restricted-paths": [
-          "warn",
+          "error",
           {
             zones: [
-              {
-                target: "./packages/features",
-                from: "./packages/app-store",
-                message: "Do not import packages/features from packages/app-store.",
-              },
               {
                 target: "./packages/features",
                 from: "./packages/prisma",
                 message: "Do not import packages/features from packages/prisma.",
               },
-              {
-                target: "./packages/features",
-                from: "./packages/lib",
-                message: "Do not import packages/features from packages/lib.",
-              },
             ],
           },
         ],
       },
     },
@@
-    // ERROR: app-store must not import trpc
+    // ERROR: app-store must not import trpc or features
     {
       files: ["packages/app-store/**/*.{ts,tsx,js,jsx}"],
       rules: {
         "import/no-restricted-paths": [
           "error",
           {
             zones: [
               {
                 target: "./packages/trpc",
                 from: "./packages/app-store",
                 message:
                   "packages/app-store must not import packages/trpc. Move UI to apps/web/components/apps or introduce an API boundary.",
               },
+              {
+                target: "./packages/features",
+                from: "./packages/app-store",
+                message: "Do not import packages/features from packages/app-store. Move UI to apps/web/components/apps or introduce an API boundary.",
+              },
             ],
           },
         ],
       },
     },

Also applies to: 18-41, 69-83

🧹 Nitpick comments (2)
.eslintrc.js (2)

18-41: Minor: remove now-dead duplication for lib.

After the consolidation, this override no longer targets lib; keeping a lib zone here would be misleading. You already have a dedicated lib override below.

-              {
-                target: "./packages/features",
-                from: "./packages/lib",
-                message: "Do not import packages/features from packages/lib.",
-              },

10-10: Comment label should reflect error-level enforcement.

Update WARN→ERROR to match the actual severity to avoid confusion.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ab9faab and 6549534.

📒 Files selected for processing (1)
  • .eslintrc.js (1 hunks)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Install dependencies / Yarn install & cache
🔇 Additional comments (1)
.eslintrc.js (1)

69-83: Optional hardening: block alias imports (add no-restricted-imports) for packages/app-store.

Keep import/no-restricted-paths, and also add no-restricted-imports to catch aliased/resolver-bypassed imports.

File: .eslintrc.js (rules block)

       rules: {
-        "import/no-restricted-paths": [
+        "import/no-restricted-paths": [
           "error",
           {
             zones: [
@@
             ],
           },
         ],
+        "no-restricted-imports": [
+          "error",
+          {
+            patterns: [
+              {
+                group: ["@calcom/trpc", "@calcom/trpc/*", "@trpc", "@trpc/*"],
+                message:
+                  "packages/app-store must not import trpc directly. Move UI to apps/web/components/apps or introduce an API boundary.",
+              },
+              {
+                group: ["@calcom/features", "@calcom/features/*"],
+                message:
+                  "Do not import @calcom/features in packages/app-store. Move UI to apps/web/components/apps or introduce an API boundary.",
+              }
+            ],
+          },
+        ],
       },

Verify with (use npx/pnpm if eslint isn't global):

#!/bin/bash
if command -v eslint >/dev/null 2>&1; then
  eslint --print-config packages/app-store/src/index.ts | jq '.rules["import/no-restricted-paths"], .rules["no-restricted-imports"]'
  eslint --print-config packages/lib/src/index.ts | jq '.rules["import/no-restricted-paths"]'
  eslint --print-config packages/prisma/src/index.ts | jq '.rules["import/no-restricted-paths"]'
elif command -v npx >/dev/null 2>&1; then
  npx --yes eslint --print-config packages/app-store/src/index.ts | jq '.rules["import/no-restricted-paths"], .rules["no-restricted-imports"]'
  npx --yes eslint --print-config packages/lib/src/index.ts | jq '.rules["import/no-restricted-paths"]'
  npx --yes eslint --print-config packages/prisma/src/index.ts | jq '.rules["import/no-restricted-paths"]'
elif command -v pnpm >/dev/null 2>&1; then
  pnpm dlx eslint --print-config packages/app-store/src/index.ts | jq '.rules["import/no-restricted-paths"], .rules["no-restricted-imports"]'
  pnpm dlx eslint --print-config packages/lib/src/index.ts | jq '.rules["import/no-restricted-paths"]'
  pnpm dlx eslint --print-config packages/prisma/src/index.ts | jq '.rules["import/no-restricted-paths"]'
else
  echo "Install eslint or run with npx/pnpm to print effective config."
  exit 1
fi

@hbjORbj hbjORbj marked this pull request as ready for review September 17, 2025 08:58
@dosubot dosubot bot added the ✨ feature New feature or request label Sep 17, 2025
@hbjORbj hbjORbj marked this pull request as draft September 17, 2025 08:59
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

♻️ Duplicate comments (3)
.eslintrc.js (3)

68-92: Critical: app-store features ban is overridden and not enforced. Merge into one error-level rule.

The later app-store override replaces the earlier one, dropping the features restriction for app-store. Consolidate here and keep severity at error; also disallow type-only imports.

       "no-restricted-imports": [
         "error",
         {
+          allowTypeImports: false,
           patterns: [
             {
               group: [
                 // Catch all relative paths into trpc
                 "**/trpc",
                 "**/trpc/*",
                 // Catch alias imports
                 "@calcom/trpc",
                 "@calcom/trpc/*",
                 "@trpc",
                 "@trpc/*",
               ],
               message:
                 "packages/app-store must not import trpc. Move UI to apps/web/components/apps or introduce an API boundary.",
             },
+            {
+              group: [
+                // Catch all relative paths into features
+                "**/features",
+                "**/features/*",
+                // Catch alias imports
+                "@calcom/features",
+                "@calcom/features/*",
+              ],
+              message:
+                "packages/app-store must not import features. Move UI to apps/web/components/apps or introduce an API boundary.",
+            },
           ],
         },
       ],

11-15: Scope this override to prisma and make it truly blocking (error + no type-only imports).

Avoid duplicate/overlapping overrides and enforce “block” semantics.

-      files: [
-        "packages/app-store/**/*.{ts,tsx,js,jsx}",
-        "packages/prisma/**/*.{ts,tsx,js,jsx}",
-        "packages/lib/**/*.{ts,tsx,js,jsx}",
-      ],
+      files: ["packages/prisma/**/*.{ts,tsx,js,jsx}"],
@@
-        "no-restricted-imports": [
-          "warn",
+        "no-restricted-imports": [
+          "error",
           {
+            allowTypeImports: false,
             patterns: [
               {
                 group: [
@@
-                message: "Avoid importing packages/features from app-store, prisma, or lib.",
+                message: "packages/prisma must not import features.",
               },
             ],
           },
         ],

Also applies to: 18-35


39-63: Enforce “block” in lib (error severity) and prevent type-only imports.

Current warn won’t fail CI; type-only imports can bypass the ban.

-        "no-restricted-imports": [
-          "warn",
+        "no-restricted-imports": [
+          "error",
           {
-            patterns: [
+            allowTypeImports: false,
+            patterns: [
               {
                 group: [
                   // Catch all relative paths into app-store
                   "**/app-store",
                   "**/app-store/*",
                   // Catch all relative paths into features
                   "**/features",
                   "**/features/*",
                   // Catch alias imports
                   "@calcom/app-store",
                   "@calcom/app-store/*",
                   "@calcom/features",
                   "@calcom/features/*",
                 ],
                 message: "packages/lib should not import app-store or features.",
               },
             ],
           },
         ],
🧹 Nitpick comments (1)
.eslintrc.js (1)

9-9: Update comments to reflect error severity (not WARN) for accuracy.

Keep file comments aligned with rule behavior.

-    // WARN: features must not be imported by app-store, prisma, or lib
+    // ERROR: features must not be imported by app-store, prisma, or lib
@@
-    // WARN: lib must not import app-store or features
+    // ERROR: lib must not import app-store or features

Also applies to: 37-37

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6549534 and 3acfe9e.

📒 Files selected for processing (1)
  • .eslintrc.js (1 hunks)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Install dependencies / Yarn install & cache

@hbjORbj hbjORbj marked this pull request as ready for review September 17, 2025 09:11
@dosubot dosubot bot added the 🧹 Improvements Improvements to existing features. Mostly UX/UI label Sep 17, 2025
Comment on lines +23 to +25
// Catch all relative paths into features
"**/features",
"**/features/*",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This might throw for valid imports e.g., importing a folder named features within the same package.
But we have a good message + we have no choice other than relying on no-restricted-imports rule for now since the zones approach isn't supported in our TS version (@typescript-eslint only supports <5.4 but we're on 5.9)

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: 1

♻️ Duplicate comments (3)
.eslintrc.js (3)

35-61: Make it truly “blocking” for lib and disallow type-only imports.

Severity is warn; change to error and add allowTypeImports: false.

       files: ["packages/lib/**/*.{ts,tsx,js,jsx}"],
       rules: {
         "no-restricted-imports": [
-          "warn",
+          "error",
           {
             patterns: [
               {
                 group: [
                   // Catch all relative paths into app-store
                   "**/app-store",
                   "**/app-store/*",
                   // Catch all relative paths into features
                   "**/features",
                   "**/features/*",
                   // Catch alias imports
                   "@calcom/app-store",
                   "@calcom/app-store/*",
                   "@calcom/features",
                   "@calcom/features/*",
                 ],
                 message: "@calcom/lib should not import @calcom/app-store or @calcom/features.",
               },
             ],
+            allowTypeImports: false
           },
         ],
       },

11-32: Bug: this override is shadowed for app-store files; features ban doesn’t apply.

ESLint merges overrides “last one wins” per rule. The later app-store override (Lines 64-87) redefines no-restricted-imports and drops the features ban for app-store. Remove this whole block and fold “features” into the app-store override to truly block it.

Apply this diff to delete the redundant override:

-    // WARN: features must not be imported by app-store or lib
-    {
-      files: ["packages/app-store/**/*.{ts,tsx,js,jsx}", "packages/lib/**/*.{ts,tsx,js,jsx}"],
-      rules: {
-        "no-restricted-imports": [
-          "warn",
-          {
-            patterns: [
-              {
-                group: [
-                  // Catch all relative paths into features
-                  "**/features",
-                  "**/features/*",
-                  // Catch all alias imports
-                  "@calcom/features",
-                  "@calcom/features/*",
-                ],
-                message: "Avoid importing @calcom/features from @calcom/app-store or @calcom/lib.",
-              },
-            ],
-          },
-        ],
-      },
-    },

66-86: Fold “features” ban into app-store override and forbid type-only imports.

Make the rule truly blocking for both trpc and features; prevent type-only escapes.

         "no-restricted-imports": [
           "error",
           {
-            patterns: [
+            patterns: [
               {
                 group: [
                   // Catch all relative paths into trpc
                   "**/trpc",
                   "**/trpc/*",
                   // Catch alias imports
                   "@calcom/trpc",
                   "@calcom/trpc/*",
                   "@trpc",
                   "@trpc/*",
                 ],
                 message:
                   "@calcom/app-store must not import trpc. Move UI to apps/web/components/apps or introduce an API boundary.",
               },
+              {
+                group: [
+                  // Catch all relative paths into features
+                  "**/features",
+                  "**/features/*",
+                  // Catch all alias imports
+                  "@calcom/features",
+                  "@calcom/features/*",
+                ],
+                message:
+                  "Features are not allowed in packages/app-store. Move UI to apps/web/components/apps or introduce an API boundary.",
+              },
             ],
+            allowTypeImports: false
           },
         ],
🧹 Nitpick comments (4)
.eslintrc.js (4)

94-111: Block type-only imports in prisma too.

Prevent escapes via import type.

         "no-restricted-imports": [
           "error",
           {
             patterns: [
               {
                 group: [
                   // Catch all relative paths into features
                   "**/features",
                   "**/features/*",
                   // Catch all alias imports
                   "@calcom/features",
                   "@calcom/features/*",
                 ],
                 message: "Avoid importing @calcom/features from @calcom/prisma.",
               },
             ],
+            allowTypeImports: false
           },
         ],

64-64: Nit: update the comment to reflect both trpc and features are blocked.

-    // ERROR: app-store must not import trpc
+    // ERROR: app-store must not import trpc or features

35-35: Optional: include ESM/CJS and TS variants in file globs.

Covers mts/cts/mjs/cjs if present in the repo.

-      files: ["packages/lib/**/*.{ts,tsx,js,jsx}"],
+      files: ["packages/lib/**/*.{ts,tsx,js,jsx,mts,cts,mjs,cjs}"],
-      files: ["packages/app-store/**/*.{ts,tsx,js,jsx}"],
+      files: ["packages/app-store/**/*.{ts,tsx,js,jsx,mts,cts,mjs,cjs}"],
-      files: ["packages/prisma/**/*.{ts,tsx,js,jsx}"],
+      files: ["packages/prisma/**/*.{ts,tsx,js,jsx,mts,cts,mjs,cjs}"],

Also applies to: 64-64, 92-92


41-56: Heads‑up: broad “/features” can flag legitimate local folders.**

You noted this trade‑off; once feasible, prefer import/no-restricted-paths with zones for precise, path‑based boundaries (no TS 5.x dependency). Keep this as follow‑up tech debt.

Would you like me to draft a zones-based config that mirrors these constraints for when the parser/resolver setup allows it?

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a1f62d5 and 162b67f.

📒 Files selected for processing (1)
  • .eslintrc.js (1 hunks)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Production builds / Build Web App
  • GitHub Check: Production builds / Build Atoms
  • GitHub Check: Production builds / Build API v1
  • GitHub Check: Linters / lint
  • GitHub Check: Type check / check-types
  • GitHub Check: Production builds / Build Docs
  • GitHub Check: Production builds / Build API v2
  • GitHub Check: Tests / Unit

@hbjORbj hbjORbj merged commit ef8b0fa into main Sep 19, 2025
64 of 66 checks passed
@hbjORbj hbjORbj deleted the chore/eslint-rule branch September 19, 2025 08:05
ThyMinimalDev pushed a commit that referenced this pull request Sep 22, 2025
…, prisma (#23832)

* eslint rule

* improve

* fix

* improve msg
ThyMinimalDev added a commit that referenced this pull request Sep 24, 2025
…ata (#23934)

* feat: add BillingCacheService with 1-hour TTL for team subscription data

- Create BillingCacheService following CalendarsCacheService pattern
- Use teamId-based cache keys with 1-hour TTL (3,600,000 ms)
- Integrate caching into getBillingData method in BillingService
- Add cache invalidation to all webhook handlers:
  - handleStripeSubscriptionDeleted
  - handleStripePaymentSuccess
  - handleStripePaymentFailed
  - handleStripePaymentPastDue
  - handleStripeCheckoutEvents
- Add cache invalidation to cancelTeamSubscription method
- Add RedisModule import to billing module
- Add BillingCacheService to billing module providers
- Add findTeamByPlatformBillingId method to OrganizationsRepository for cache invalidation

Co-Authored-By: [email protected] <[email protected]>

* refactor: implement BillingServiceCachingProxy pattern

- Extract IBillingService interface with all public methods
- Create BillingServiceCachingProxy that implements caching logic
- Remove all caching logic from original BillingService
- Simplify cache invalidation using billing.id = team.id
- Update module to use proxy with proper dependency injection
- Update controller to inject proxy interface
- Remove unused BillingService import from controller

This follows the proxy pattern requested in PR feedback, separating
caching concerns from core billing logic for better maintainability.

Co-Authored-By: [email protected] <[email protected]>

* chore: add e2e for billing check

* chore: eslint rule for blocking importing features from appstore, lib, prisma (#23832)

* eslint rule

* improve

* fix

* improve msg

* chore: fix any types set by devin

* fix: add mising expect in test

* refactor: move cache methods into BillingServiceCachingProxy

- Remove BillingCacheService abstraction as suggested by @keithwillcode
- Move cache methods directly into proxy as private methods
- Update proxy to inject RedisService directly
- Move BillingData type to interface for better type safety
- Remove BillingCacheService from module providers
- Delete unused billing-cache.service.ts file

This simplifies the architecture by removing unnecessary abstraction
and follows standard caching proxy patterns.

Co-Authored-By: [email protected] <[email protected]>

* fix: test and legacy starter

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: Benny Joo <[email protected]>
Co-authored-by: Morgan <[email protected]>
saurabhraghuvanshii pushed a commit to saurabhraghuvanshii/cal.com that referenced this pull request Sep 24, 2025
…ata (calcom#23934)

* feat: add BillingCacheService with 1-hour TTL for team subscription data

- Create BillingCacheService following CalendarsCacheService pattern
- Use teamId-based cache keys with 1-hour TTL (3,600,000 ms)
- Integrate caching into getBillingData method in BillingService
- Add cache invalidation to all webhook handlers:
  - handleStripeSubscriptionDeleted
  - handleStripePaymentSuccess
  - handleStripePaymentFailed
  - handleStripePaymentPastDue
  - handleStripeCheckoutEvents
- Add cache invalidation to cancelTeamSubscription method
- Add RedisModule import to billing module
- Add BillingCacheService to billing module providers
- Add findTeamByPlatformBillingId method to OrganizationsRepository for cache invalidation

Co-Authored-By: [email protected] <[email protected]>

* refactor: implement BillingServiceCachingProxy pattern

- Extract IBillingService interface with all public methods
- Create BillingServiceCachingProxy that implements caching logic
- Remove all caching logic from original BillingService
- Simplify cache invalidation using billing.id = team.id
- Update module to use proxy with proper dependency injection
- Update controller to inject proxy interface
- Remove unused BillingService import from controller

This follows the proxy pattern requested in PR feedback, separating
caching concerns from core billing logic for better maintainability.

Co-Authored-By: [email protected] <[email protected]>

* chore: add e2e for billing check

* chore: eslint rule for blocking importing features from appstore, lib, prisma (calcom#23832)

* eslint rule

* improve

* fix

* improve msg

* chore: fix any types set by devin

* fix: add mising expect in test

* refactor: move cache methods into BillingServiceCachingProxy

- Remove BillingCacheService abstraction as suggested by @keithwillcode
- Move cache methods directly into proxy as private methods
- Update proxy to inject RedisService directly
- Move BillingData type to interface for better type safety
- Remove BillingCacheService from module providers
- Delete unused billing-cache.service.ts file

This simplifies the architecture by removing unnecessary abstraction
and follows standard caching proxy patterns.

Co-Authored-By: [email protected] <[email protected]>

* fix: test and legacy starter

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: Benny Joo <[email protected]>
Co-authored-by: Morgan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only ✨ feature New feature or request foundation 🧹 Improvements Improvements to existing features. Mostly UX/UI ready-for-e2e 💻 refactor size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants