Skip to content

Conversation

@hariombalhara
Copy link
Member

What does this PR do?

Fixes ESLint configuration error by changing no-restricted-imports to @typescript-eslint/no-restricted-imports for app-store files to support the allowTypeImports option.

Problem: ESLint was failing with configuration error:

Configuration for rule "no-restricted-imports" is invalid:
Value {...,"allowTypeImports":false} should NOT have additional properties

Solution: The allowTypeImports option is only supported by the TypeScript ESLint version of the rule, not the standard ESLint rule.

Visual Demo (For contributors especially)

Before (ESLint configuration error):

Error: ../../.eslintrc.js#overrides[1]:
Configuration for rule "no-restricted-imports" is invalid:
Value {"allowTypeImports":false} should NOT have additional properties

After (ESLint runs successfully):

✖ 242 problems (11 errors, 231 warnings)
11 errors and 0 warnings potentially fixable with the `--fix` option.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • 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. N/A - This is an internal configuration fix.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Run yarn lint:report from the repository root
  2. Verify ESLint runs without configuration errors
  3. Verify that tRPC imports are still properly restricted in packages/app-store/** files
  4. Test that type-only imports are handled according to the allowTypeImports: false setting

Expected result: ESLint should run successfully without configuration errors while maintaining the same import restriction behavior.

Checklist

  • My code follows the style guidelines of this project
  • I have checked if my changes generate no new warnings

Link to Devin run: https://app.devin.ai/sessions/5c84830b94dc4807866fdcc4ac3f77e6
Requested by: @hariombalhara

Human Review Checklist:

  • Verify @typescript-eslint/no-restricted-imports enforces the same restrictions as the original rule
  • Test that allowTypeImports: false works correctly (type imports should be blocked)
  • Confirm tRPC imports are still properly restricted in app-store files

…-imports for allowTypeImports support

The allowTypeImports option is only supported by @typescript-eslint/no-restricted-imports,
not the standard ESLint no-restricted-imports rule. This fixes the configuration error:
'Configuration for rule no-restricted-imports is invalid: allowTypeImports should NOT have additional properties'

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 16, 2025

Walkthrough

The pull request updates .eslintrc.js by changing the app-store override rule key from "no-restricted-imports" to "@typescript-eslint/no-restricted-imports". The existing options (error level and patterns with group/message) are preserved. This shifts the restriction to the TypeScript-specific rule without altering the configured patterns or severity. No other files or configurations are modified.

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title concisely and accurately summarizes the primary change: replacing ESLint's no-restricted-imports with @typescript-eslint/no-restricted-imports to enable allowTypeImports support in the app-store override, which matches the changes in .eslintrc.js.
Description Check ✅ Passed The PR description directly explains the configuration error, the reason the TypeScript-specific rule is required, the exact change made, and provides testing steps and expected outcomes, so it is clearly related to the changeset and sufficient for reviewers.
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 devin/fix-eslint-restricted-imports-1757999042

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.

@keithwillcode keithwillcode added core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO labels Sep 16, 2025
@hariombalhara hariombalhara marked this pull request as ready for review September 16, 2025 05:06
@graphite-app graphite-app bot requested a review from a team September 16, 2025 05:06
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

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

25-36: Optional: limit this override to TS files only.

The rule’s type-focused option isn’t needed for JS/JSX. Consider narrowing files to **/*.{ts,tsx} for this block to avoid running a TS rule on JS sources.

📜 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 7e415b4 and e60e1c9.

📒 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: Detect changes
🔇 Additional comments (2)
.eslintrc.js (2)

25-36: Good swap to @typescript-eslint/no-restricted-imports; fixes the schema error.

This change is correct and aligns with allowTypeImports support. Severity and patterns preserved.


25-36: Verify plugin availability and intended block surface.

  • Ensure @typescript-eslint/eslint-plugin is loaded via the preset; otherwise you’ll see “Definition for rule ‘@typescript-eslint/no-restricted-imports’ was not found.”
  • If you also want to block root imports like @calcom/trpc (not just deep paths), add a paths entry:
         "@typescript-eslint/no-restricted-imports": [
           "error",
           {
+            paths: [
+              {
+                name: "@calcom/trpc",
+                message: "tRPC imports are blocked in packages/app-store. Move UI to apps/web/components/apps or introduce an API boundary.",
+                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.",
                 allowTypeImports: false,
               },
             ],
           },
         ],

Copy link
Contributor

@eunjae-lee eunjae-lee left a comment

Choose a reason for hiding this comment

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

the problem seems to be fixed !

@eunjae-lee eunjae-lee enabled auto-merge (squash) September 16, 2025 08:02
@github-actions
Copy link
Contributor

github-actions bot commented Sep 16, 2025

E2E results are ready!

@vercel
Copy link

vercel bot commented Sep 16, 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 16, 2025 9:41am
cal-eu Ignored Ignored Sep 16, 2025 9:41am

@eunjae-lee eunjae-lee merged commit f267cd9 into main Sep 16, 2025
36 of 37 checks passed
@eunjae-lee eunjae-lee deleted the devin/fix-eslint-restricted-imports-1757999042 branch September 16, 2025 10:00
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 enterprise area: enterprise, audit log, organisation, SAML, SSO ready-for-e2e size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants