Disallows the .ready
method. Prefer $()
.
📋 This rule is enabled in plugin:no-jquery/deprecated-3.0
.
📋 This rule is enabled in plugin:no-jquery/all
.
🔧 The --fix
option on the command line can automatically fix some of the problems reported by this rule.
❌ Examples of incorrect code:
$( document ).ready( fn );
$div.ready( fn );
$( 'div' ).first().ready( fn );
$( 'div' ).append( $( 'input' ).ready( fn ) );
$div = $( 'div' ).ready( fn );
✔️ Examples of correct code:
ready( fn );
[].ready( fn );
div.ready( fn );
div.ready;
$.ready( fn );
$( document ).on( 'ready', fn );
$( fn );
🔧 Examples of code fixed by this rule:
$( document ).ready( fn ); /* → */ $( fn );
$div.ready( fn ); /* → */ $( fn );
$( 'div' ).first().ready( fn ); /* → */ $( fn );