Skip to content

Conversation

zomars
Copy link
Contributor

@zomars zomars commented Aug 6, 2025

fix: update eslint-config-next to resolve pre-commit hook failures

Summary

This PR fixes the ESLint configuration error "ESLint couldn't find the config 'next'" that was blocking commits due to pre-commit hooks. The issue was caused by multiple conflicting versions of eslint-config-next across the monorepo preventing proper workspace dependency hoisting.

Changes made:

  • Updated all eslint-config-next versions to ^15.4.5 across 4 packages to align with Next.js ^15.3.0
  • Added eslint-config-next@^15.4.5 and eslint-plugin-unused-imports to root package.json dependencies to force workspace hoisting
  • Updated yarn.lock with new dependency resolutions

Verification:

  • ✅ Pre-commit hooks now run successfully without ESLint config errors
  • yarn lint:report resolves ESLint configurations properly
  • ⚠️ Some type checking errors exist but appear unrelated to these dependency changes

Review & Testing Checklist for Human

  • Test pre-commit hooks end-to-end - Make a test commit to verify hooks run without "next config not found" errors
  • Run full lint check - Execute yarn lint:report to ensure all ESLint rules work correctly across packages
  • Verify builds work - Run yarn build to ensure no regressions in build process
  • Check type errors are unrelated - Compare yarn type-check:ci output with main branch to confirm type errors existed before this change

Recommended test plan:

  1. Checkout this branch locally
  2. Run yarn install to get updated dependencies
  3. Make a small change to any .ts/.tsx file in apps/ or packages/
  4. Stage and commit the change to verify pre-commit hooks work
  5. Run yarn lint:report to ensure no ESLint configuration errors

Diagram

%%{ init : { "theme" : "default" }}%%
graph TD
    PC["Pre-commit hooks<br/>.husky/pre-commit"]:::context
    LS["lint-staged<br/>package.json"]:::context
    RC[".eslintrc.js<br/>(root config)"]:::context
    EP["packages/config/<br/>eslint-preset.js"]:::context
    
    PC --> LS
    LS --> RC
    RC --> EP
    EP --> ECN["eslint-config-next<br/>(extends 'next')"]:::major-edit
    
    subgraph "Package Updates"
        P1["packages/config/<br/>package.json"]:::major-edit
        P2["example-apps/credential-sync/<br/>package.json"]:::major-edit  
        P3["packages/platform/examples/base/<br/>package.json"]:::major-edit
        P4["apps/ui-playground/<br/>package.json"]:::major-edit
        ROOT["package.json<br/>(root)"]:::major-edit
    end
    
    ECN --> P1
    ECN --> P2
    ECN --> P3
    ECN --> P4
    ECN --> ROOT
    
    ROOT --> NM["node_modules/<br/>eslint-config-next<br/>(hoisted)"]:::minor-edit
    
    subgraph Legend
        L1[Major Edit]:::major-edit
        L2[Minor Edit]:::minor-edit
        L3[Context/No Edit]:::context
    end

classDef major-edit fill:#90EE90
classDef minor-edit fill:#87CEEB  
classDef context fill:#FFFFFF
Loading

Notes

  • Root cause: Multiple versions of eslint-config-next (13.2.1, 14.0.4, 15.1.6) prevented Yarn from hoisting the package to root node_modules, causing ESLint to fail when running from root during pre-commit hooks
  • Solution approach: Standardized all packages to use eslint-config-next@^15.4.5 and added it to root dependencies to force hoisting
  • Compatibility: Version 15.4.5 is compatible with the Next.js 15.3.0 used in the main apps

Session details:

devin-ai-integration bot and others added 2 commits August 6, 2025 04:47
- Align all eslint-config-next versions to ^15.4.5 to match Next.js ^15.3.0
- Add eslint-config-next and eslint-plugin-unused-imports to root dependencies
- Fix workspace dependency hoisting issues causing ESLint config resolution failures
- Ensure pre-commit hooks can properly resolve 'next' ESLint configuration

Co-Authored-By: zomars@cal.com <zomars@me.com>
Co-Authored-By: zomars@cal.com <zomars@me.com>
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

Copy link
Contributor

coderabbitai bot commented Aug 6, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1754455100-fix-eslint-config-next-resolution

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
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
  • 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 explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this 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.

@keithwillcode keithwillcode added core area: core, team members only foundation labels Aug 6, 2025
package.json Outdated
@@ -123,6 +123,8 @@
"city-timezones": "^1.2.1",
"date-fns-tz": "^3.2.0",
"eslint": "^8.34.0",
"eslint-config-next": "^15.4.5",
"eslint-plugin-unused-imports": "latest",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

DevinAI, avoid using latest

… latest

Addresses GitHub comment feedback to avoid using 'latest' version specifier

Co-Authored-By: zomars@cal.com <zomars@me.com>
Copy link

vercel bot commented Aug 6, 2025

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

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Aug 6, 2025 5:26am
cal-eu ⬜️ Ignored (Inspect) Aug 6, 2025 5:26am

…ascade

- Revert massive yarn.lock changes and use targeted approach
- Use eslint-config-next ^14.0.4 instead of ^15.4.5 to avoid cascading
- Add yarn resolution to ensure consistent version across monorepo
- Add required ESLint plugins to root dependencies for proper hoisting
- Resolves ESLint configuration error blocking pre-commit hooks

Co-Authored-By: zomars@cal.com <zomars@me.com>
@zhyd1997
Copy link
Contributor

zhyd1997 commented Aug 6, 2025

Hi @zomars

PTAL: #22924

Copy link
Contributor

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label Aug 21, 2025
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 foundation Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants