Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 679 Bytes

no-jquery-constructor.md

File metadata and controls

37 lines (29 loc) · 679 Bytes

no-jquery-constructor

Disallows the jQuery constructor $().

📋 This rule is enabled in plugin:no-jquery/all.

Rule details

❌ Examples of incorrect code:

$( 'div' );
$( '#id' );
$( '.selector' );
$( '.selector', '.context' );
$( function () {} );
$( [] );
$( undefined );
$( false );
jQuery( 'div' );

✔️ Examples of correct code:

foo.$( '.selector' );
foo.$( '<div>' );
foo.jQuery( '.selector' );
foo.jQuery( '<div>' );
$;
jQuery;

Resources