Disallows the .parents
method. Prefer Element#closest
.
📋 This rule is enabled in plugin:no-jquery/all
.
❌ Examples of incorrect code:
$( 'div' ).parents();
$div.parents();
$( 'div' ).first().parents();
$( 'div' ).append( $( 'input' ).parents() );
✔️ Examples of correct code:
parents();
[].parents();
div.parents();
div.parents;