Skip to content

Conversation

@Tobbe
Copy link
Member

@Tobbe Tobbe commented Dec 5, 2025

Follow-up on #629. That PR switched the entire framework, and project templates, over to eslint's new flat config. This PR adds a deprecation notice that's printed whenever someone runs yarn cedar lint that is still using the legacy config format.

The deprecation warning can be disabled by setting eslintLegacyConfigWarning to false in your redwood.toml file

@netlify
Copy link

netlify bot commented Dec 5, 2025

Deploy Preview for cedarjs ready!

Name Link
🔨 Latest commit 59a4a1d
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/6932c61e689afd0008f93fca
😎 Deploy Preview https://deploy-preview-651--cedarjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added this to the next-release milestone Dec 5, 2025
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 5, 2025

Greptile Overview

Greptile Summary

This PR adds a deprecation warning system for legacy ESLint configurations to help users migrate to the new flat config format.

Key Changes:

  • Added detectLegacyEslintConfig() function that checks for .eslintrc.* files and eslintConfig/eslint fields in package.json
  • Added showLegacyEslintDeprecationWarning() function that displays a helpful migration message with reference to PR feat(eslint): Migrate to eslint's new flat config format #629
  • Integrated the warning into the lint command handler, showing it before running ESLint
  • Added new eslintLegacyConfigWarning config option (defaults to true) in redwood.toml to allow users to disable warnings
  • Updated documentation to explain the new configuration option

Implementation Quality:
The implementation is clean and well-structured. The detection logic comprehensively checks all legacy config formats, and the warning message provides clear migration guidance. The feature is configurable and non-breaking.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The changes are straightforward, well-implemented, and non-breaking. The feature is opt-out with sensible defaults, the code is clean and follows existing patterns, and the documentation is complete. No logical errors, security issues, or edge cases were found.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
packages/cli/src/commands/lint.js 5/5 Added legacy ESLint config detection and deprecation warning with configurable option
packages/project-config/src/config.ts 5/5 Added eslintLegacyConfigWarning config field with default value of true
docs/docs/app-configuration-redwood-toml.md 5/5 Documented new eslintLegacyConfigWarning configuration option

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI as cedar lint
    participant Handler as lint handler
    participant Config as getConfig()
    participant Detector as detectLegacyEslintConfig()
    participant FS as File System
    participant Warning as showLegacyEslintDeprecationWarning()
    participant ESLint as yarn eslint

    User->>CLI: Run lint command
    CLI->>Handler: Execute handler
    Handler->>Config: Get config
    Config-->>Handler: Return config with eslintLegacyConfigWarning
    Handler->>Detector: Check for legacy configs
    Detector->>FS: Check for .eslintrc.* files
    FS-->>Detector: File exists status
    Detector->>FS: Read package.json
    FS-->>Detector: Package.json contents
    Detector-->>Handler: Return array of legacy files found
    alt Legacy files found AND warning enabled
        Handler->>Warning: Show deprecation warning
        Warning->>User: Display warning message
    end
    Handler->>ESLint: Execute eslint with args
    ESLint-->>User: Linting results
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

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.

2 participants