-
Notifications
You must be signed in to change notification settings - Fork 1
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
fx: no ignored replay buffer rule does not check supplied config for buffer size #39
fx: no ignored replay buffer rule does not check supplied config for buffer size #39
Conversation
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
packages/eslint-plugin-rxjs/src/lib/rules/no-ignored-replay-buffer.tsOops! Something went wrong! :( ESLint: 9.17.0 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by WalkthroughThe pull request enhances the Changes
Possibly related issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
View your CI Pipeline Execution ↗ for commit 5a58c4e.
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this 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)
packages/eslint-plugin-rxjs/src/lib/rules/no-ignored-replay-buffer.ts (1)
56-61
: Selective check for object-based shareReplay configuration.
This logic efficiently handles scenarios with a single config object. If you want to support multiple arguments (e.g.shareReplay(1, someScheduler)
), consider extending this logic.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/eslint-plugin-rxjs/docs/rules/no-ignored-replay-buffer.md
(2 hunks)packages/eslint-plugin-rxjs/src/lib/rules/no-ignored-replay-buffer.ts
(2 hunks)packages/eslint-plugin-rxjs/src/lib/tests/rules/no-ignored-replay-buffer.spec.ts
(5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: main
🔇 Additional comments (22)
packages/eslint-plugin-rxjs/src/lib/rules/no-ignored-replay-buffer.ts (11)
1-1
: No issues with the updated import statement.
5-7
: References and acknowledgments look good.
Comments referencing external sources do not raise any issues.
26-43
: Solid check for 'bufferSize' in shareReplay configuration.
This function correctly enforces the presence of thebufferSize
property. If you'd like to enforce additional constraints, such as restrictingbufferSize
to positive integers, consider adding further checks.
44-44
: No concerns.
A blank line added for readability is fine.
46-47
: New parameter types are correctly declared.
51-51
: Robust error reporting for zero-arg usage.
Reporting is appropriately triggered if no arguments are passed.
55-55
: Blank line for logical separation.
No issues here.
68-68
: Correct usage of the parent node for ReplaySubject.
74-75
: Extends the same approach for replay usage in a MemberExpression.
81-81
: Ensures publishReplay or shareReplay calls are also handled.
84-89
: Consistent coverage for namespaced publishReplay/shareReplay.
This ensures the rule won’t miss prefixed or namespaced usage.packages/eslint-plugin-rxjs/src/lib/tests/rules/no-ignored-replay-buffer.spec.ts (6)
29-33
: Positive test with shareReplay config.
Well-structured valid case verifyingbufferSize
presence.
55-60
: Namespaced valid test for shareReplay config.
Helps confirm the rule remains robust under different import patterns.
72-76
: Additional valid coverage for shareReplay config.
Reinforces consistent passing scenarios.
122-131
: Invalid test ensures missing bufferSize is caught.
This effectively validates the newly added logic.
132-141
: Further invalid case for missing bufferSize, strengthening coverage.
185-194
: Namespaced shareReplay invalid test.
Adds valuable coverage for namespaced usage without bufferSize.packages/eslint-plugin-rxjs/docs/rules/no-ignored-replay-buffer.md (5)
14-17
: Helpful incorrect code example.
Demonstrates the absence ofbufferSize
inshareReplay
configuration clearly.
18-18
: Blank line is fine.
31-34
: Clear correct code example.
Showcases the recommended approach usingbufferSize
.
35-35
: Blank line for formatting.
38-38
: Reiterates no options for the rule.
No changes needed.
Issue Number: #37
Body
Now fails on config files that have no bufferSize
Summary by CodeRabbit
Documentation
no-ignored-replay-buffer
ESLint ruleshareReplay
New Features
bufferSize
configuration inshareReplay
function callsTests
shareReplay
configuration scenarios