Skip to content

Improve custom no jquery rule to catch jquery chaining#3038

Merged
Crabcyborg merged 1 commit intomasterfrom
improve_nojquery_rule_to_catch_chaining
Mar 23, 2026
Merged

Improve custom no jquery rule to catch jquery chaining#3038
Crabcyborg merged 1 commit intomasterfrom
improve_nojquery_rule_to_catch_chaining

Conversation

@Crabcyborg
Copy link
Contributor

@Crabcyborg Crabcyborg commented Mar 23, 2026

Summary by CodeRabbit

  • Improvements
    • Enhanced jQuery method call detection to better recognize collection-returning patterns.
    • Improved accuracy for detecting chained jQuery method calls.
    • Refined detection logic for more complex jQuery usage scenarios.

@Crabcyborg Crabcyborg added this to the 6.30 milestone Mar 23, 2026
@Crabcyborg Crabcyborg changed the title Improve noqjuery rule to catch jquery chaining Improve custom no jquery rule to catch jquery chaining Mar 23, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 23, 2026

📝 Walkthrough

Walkthrough

The no-jquery-variable-methods linting rule was refactored to improve detection of jQuery collection-returning method calls. The logic now better tracks jQuery collections through constructor calls and chained methods by introducing a new helper function and restructuring how method call detection validates its inputs.

Changes

Cohort / File(s) Summary
jQuery Method Detection Logic
eslint-rules/rules/no-jquery-variable-methods.js
Refactored isjQueryMethodReturningCollection() to validate callees against COLLECTION_RETURNING_METHODS upfront; added isjQueryChainedCollectionCall() helper to recognize chained collection-returning calls; improved tracking of collection origins through jQuery constructors and method chains.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 Chain after chain, we hop along,
jQuery methods flowing strong,
Collections traced through loops so deep,
A better rule for us to keep!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title 'Improve custom no jquery rule to catch jquery chaining' directly and clearly summarizes the main objective of the changeset: enhancing the eslint rule's ability to detect jQuery method chaining.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch improve_nojquery_rule_to_catch_chaining

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@Crabcyborg Crabcyborg merged commit 7b88008 into master Mar 23, 2026
45 of 46 checks passed
@Crabcyborg Crabcyborg deleted the improve_nojquery_rule_to_catch_chaining branch March 23, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant