Disallows the .bind
/.unbind
methods. Prefer .on
/.off
or EventTarget#addEventListener
/removeEventListener
.
📋 This rule is enabled in plugin:no-jquery/deprecated-3.0
.
📋 This rule is enabled in plugin:no-jquery/all
.
❌ Examples of incorrect code:
$( 'div' ).bind();
$div.bind();
$( 'div' ).first().bind();
$( 'div' ).append( $( 'input' ).bind() );
$( 'div' ).unbind();
$div.unbind();
$( 'div' ).first().unbind();
$( 'div' ).append( $( 'input' ).unbind() );
✔️ Examples of correct code:
bind();
[].bind();
div.bind();
div.bind;
$div.remove.bind( $div );
unbind();
[].unbind();
div.unbind();
div.unbind;
$div.remove.unbind( $div );