Disallows using the ready event on the document.
📋 This rule is enabled in plugin:no-jquery/deprecated-1.8
.
🔧 The --fix
option on the command line can automatically fix some of the problems reported by this rule.
❌ Examples of incorrect code:
$( document ).on( 'ready', function () {} );
$document.on( 'ready', function () {} );
✔️ Examples of correct code:
$( document ).on( 'click', function () {} );
$( document ).on();
$document.on( 'click', function () {} );
$document.on();
$document.on( ready );
$document.on( ready() );
$document.ready();
$( function () {} );
document.on( 'ready' );
document.on( 'ready', function () {} );
🔧 Examples of code fixed by this rule:
$( document ).on( 'ready', function () {} ); /* → */ $( document ).ready( function () {} );
$document.on( 'ready', function () {} ); /* → */ $document.ready( function () {} );