-
-
Notifications
You must be signed in to change notification settings - Fork 638
Add ESLint custom rules documentation #1947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Documents the no-use-client-in-server-files rule, including why it exists (Shakapacker 9.3.0+ compatibility), usage examples, auto-fix capability, and guidance for adding new custom rules. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
WalkthroughA new documentation file is added to explain a custom ESLint rule that prevents 'use client' directives in server-only files (.server.tsx/.server.ts), including configuration, examples, and guidance for adding additional custom rules. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📚 Learning: 2025-09-16T08:01:11.146ZApplied to files:
📚 Learning: 2025-02-13T19:09:15.991ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (6)
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 |
Pull Request ReviewOverviewThis PR adds comprehensive documentation for the custom ESLint rules directory, specifically documenting the ✅ Strengths
📝 Suggestions for Improvement1. Minor Inconsistency in File Extension CoverageThe README mentions both ### `no-use-client-in-server-files`
Prevents the `'use client'` directive from being used in `.server.tsx` and `.server.ts` files.This matches the actual implementation in 2. Testing Command Could Be More SpecificLine 98 shows: node eslint-rules/no-use-client-in-server-files.test.cjsConsider adding context about expected output: # Run tests for the custom rules (should exit with code 0 if all tests pass)
node eslint-rules/no-use-client-in-server-files.test.cjs3. Configuration Section ReferenceLine 75 states "This rule is automatically enabled in the React on Rails ESLint configuration at the 4. URL Update ConsiderationLine 23 in url: 'https://github.com/shakacode/react_on_rails/pull/1919',Consider updating this to point to the new README once this PR is merged, as it will be the canonical documentation. Could be done in a follow-up PR. 🔍 Code Quality ReviewRule Implementation (
Test Coverage (
🎯 Best Practices AlignmentPer CLAUDE.md:
🔒 Security, Performance, and Bugs
📊 Overall AssessmentThis is a high-quality documentation PR that significantly improves the discoverability and understanding of the custom ESLint rules system. The documentation is well-written, comprehensive, and provides excellent context for both current and future developers. Recommendation: ✅ Approve with minor suggestions The suggestions above are minor improvements and not blockers. The PR is ready to merge as-is, but would benefit from the small enhancements noted. Great work on documenting this important rule! The context about Shakapacker 9.3.0+ and React Server Components will save developers significant debugging time. |
Summary
Adds comprehensive documentation for the custom ESLint rules directory, specifically documenting the
no-use-client-in-server-filesrule that enforces proper usage of server components in React Server Components architecture.What's Included
This change is
Summary by CodeRabbit