Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1.18 KB

no-on-ready.md

File metadata and controls

42 lines (32 loc) · 1.18 KB

no-on-ready

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.

Rule details

❌ 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 () {} );

Resources