feat(eslint): update deps and configs#352
Conversation
🦋 Changeset detectedLatest commit: b2d67c6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Ignoring CodeRabbit configuration file changes. For security, only the configuration from the base branch is applied for open source repositories. WalkthroughUpdates ESLint and related plugins (including ESLint v10 and perfectionist v5), adds React Server Components and type-aware React rules, extends ignore handling (function-based + TypeScript/astro patterns), adjusts import/prop sorting to perfectionist v5 conventions, and bumps many dependency versions. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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. Comment |
PR Review: Update ESLint Dependencies and ConfigurationsI've reviewed PR #352 which updates ESLint to v10 and enhances React/perfectionist configurations. Here's my comprehensive feedback: ✅ Strengths1. Proper Version Management
2. Enhanced Type Safety
3. React Server Components Support
4. Better Next.js Integration
5. Improved Naming Conventions
6. Enhanced Flexibility
🔍 Potential Issues & Concerns1. Breaking Change: Removed TypeScript Parser Config (react.ts:330-336) The removal of TypeScript parser configuration from the main React config block could be problematic: // REMOVED:
...(isTypeAware
? {
project: tsconfigPath,
projectService: true,
tsconfigRootDir: import.meta.dirname,
}
: {}),Issue: Type-aware rules ( Recommendation: Verify that the type-aware configuration block (lines 417-427) includes the necessary parser options, or document where this configuration is now handled. 2. Severity Change: react-refresh/only-export-components (line 352) Changed from -'warn',
+'error',Impact: This is a breaking change for existing codebases that may have warnings. Users will now get build failures instead of warnings. Recommendation:
3. Perfectionist v5 Migration (perfectionist.ts:236-262) The import group names have changed significantly:
Removed: Issue: Removing Recommendation: Investigate if perfectionist v5 has a replacement for 4. Missing TypeScript Configuration In filesTypeAware = [GLOB_TS, GLOB_TSX],
ignoresTypeAware = [`${GLOB_MARKDOWN}/**`, GLOB_ASTRO_TS],But I notice that 5. Glob Pattern Concern (globs.ts:452) export const GLOB_ASTRO_TS = '**/*.astro/*.ts';Issue: This pattern seems unusual. Astro doesn't typically have nested Recommendation: Add a comment explaining this is for Astro's virtual TypeScript files, not physical file paths. 📝 Code Quality & Best Practices1. Good Documentation
2. Proper Type Safety
3. Configuration Organization
🔒 Security ConcernsNo security issues identified. The changes are primarily configuration updates. ⚡ Performance ConsiderationsPotential Performance Impact:
Recommendation: Document performance implications of enabling type-aware React rules in the README. 🎯 Action ItemsHigh Priority:
Medium Priority: Low Priority: 📊 Overall AssessmentThis is a solid update that brings the package up to date with the latest ESLint ecosystem. The changes are well-structured and add valuable features (RSC support, better type safety, improved naming conventions). However, there are a few breaking changes that need careful attention:
Recommendation: ✅ Approve with minor changes Address the TypeScript parser configuration concern and document the breaking changes clearly in release notes. The rest can be handled in follow-up PRs or documentation updates. Great work on keeping the ESLint configuration up to date! 🎉 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@packages/eslint-config/src/configs/ignores.ts`:
- Around line 11-12: Update the JSDoc for the function in ignores.ts to add a
missing `@param` description for ignoreTypeScript and refresh the userIgnores
description to reflect it can be either CLI prompt choices or a function;
specifically edit the `@param` entries for userIgnores and ignoreTypeScript (the
parameter names userIgnores and ignoreTypeScript) so userIgnores explains the
allowed types/behaviour (e.g., array or function that returns/filters ignores)
and ignoreTypeScript documents what the flag controls (e.g., whether TypeScript
files are ignored), keeping the wording concise and consistent with the
function's actual behavior.
In `@packages/eslint-config/src/configs/react.ts`:
- Around line 257-281: The config names in the react config block are using the
wrong namespace prefix; update the two entries named 'antfu/react/typescript'
and 'antfu/react/type-aware-rules' to use the project's consistent 'mheob/'
prefix so they read 'mheob/react/typescript' and 'mheob/react/type-aware-rules';
locate the object with name fields in the array (the rule set with files:
filesTypeAware and the conditional isTypeAware branch) and replace the string
literals accordingly to restore consistent naming with other entries like
'mheob/react/setup' and 'mheob/react/rules'.
🧹 Nitpick comments (1)
packages/eslint-config/src/configs/ignores.ts (1)
19-19: Local variableignoresshadows the enclosing function name.Consider renaming to
ignorePatterns(or similar) to avoid confusion when reading or debugging.♻️ Proposed rename
- let ignores = [...GLOB_EXCLUDE]; + let ignorePatterns = [...GLOB_EXCLUDE]; - if (ignoreTypeScript) ignores.push(GLOB_TS, GLOB_TSX); + if (ignoreTypeScript) ignorePatterns.push(GLOB_TS, GLOB_TSX); - ignores = typeof userIgnores === 'function' ? userIgnores(ignores) : [...ignores, ...userIgnores]; + ignorePatterns = typeof userIgnores === 'function' ? userIgnores(ignorePatterns) : [...ignorePatterns, ...userIgnores]; return [ { - ignores, + ignores: ignorePatterns, name: 'mheob/ignores', }, ];
BREAKING CHANGES: - Bump ESLint to v10, perfectionist to v5, and other dependencies to latest versions - Add React Server Components support (react-rsc) - Add type-aware React rules and naming conventions - Update perfectionist sort-imports for v5 compat - Enhance ignores with function-based overrides - Remove .coderabbit.yaml configuration
|
Pull Request ReviewThis is a well-structured major version update that modernizes the ESLint configuration ecosystem. The changes are comprehensive and follow good practices for configuration library maintenance. ✅ Strengths1. Proper Version Management
2. React Configuration Enhancements (
3. Perfectionist Configuration (
4. Enhanced Ignores Configuration (
5. Type System Improvements (
6. Ecosystem Updates
🔍 Observations & Suggestions1. Type-Aware Rules Default Behavior
2. React Compiler Rules Coverage
3. Naming Convention Rules Severity
4. Type Safety - Any Usage
5. Perfectionist Import Groups
6. Ignores Function Signature
🔒 Security Considerations
⚡ Performance Considerations
🐛 Potential IssuesMinor - Documentation Gap
Minor - Generated Files
📋 Testing RecommendationsBefore merging, verify:
📝 Minor Code Quality Notes
SummaryThis is a high-quality PR that:
Recommendation: ✅ Approve and merge after running the test suite to verify no regressions. Great work maintaining this configuration library! The enhancements will provide real value to users. 🚀 |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @mheob/eslint-config@10.0.0 ### Major Changes - [#352](#352) ([@mheob](https://github.com/mheob)): Update ESLint dependencies and enhance React and perfectionist configs - Bump ESLint to v10, perfectionist to v5, and many other dependencies - Add React Server Components support via react-rsc plugin - Add type-aware React rules (no-implicit-key, no-leaked-conditional-rendering) - Add React naming convention rules (context-name, ref-name, use-state) - Update perfectionist sort-imports groups to v5 naming convention - Enhance ignores config to support function-based userIgnores and TypeScript file ignoring - Add GLOB_ASTRO_TS glob pattern and ignoresTypeAware type option - Update generated type definitions for new plugin rules



Summary
Update ESLint ecosystem dependencies to latest major versions and enhance the React and perfectionist configurations with new rules and improved flexibility.
Changes
eslint-plugin-perfectionistto v5, adapting sort-imports groups to the new naming convention (type-import,value-builtin, etc.)react-rscplugin withfunction-definitionruleno-implicit-keyandno-leaked-conditional-renderingrules for type-aware lintingcontext-name,ref-name, anduse-staterulesuserIgnoresoverrides and automatic TypeScript file ignoring when TypeScript is disabledGLOB_ASTRO_TSpattern for Astro TypeScript virtual filesignoresTypeAwareoption toOptionsTypeScriptParserOptions@stylistic/eslint-plugin,eslint-plugin-regexp(v3),eslint-plugin-unicorn(v63),eslint-plugin-yml(v3),globals(v17),prettier(v3.8), and more.coderabbit.yaml: Drop CodeRabbit configuration fileMotivation
Keep the ESLint configuration up to date with the latest ecosystem releases, especially the ESLint v10 and perfectionist v5 major upgrades. The new React rules improve type safety and enforce better patterns for Server Components, naming conventions, and conditional rendering.
Summary by CodeRabbit
New Features
Dependencies
Chores