Skip to content

Latest commit

 

History

History
46 lines (38 loc) · 956 Bytes

no-visibility.md

File metadata and controls

46 lines (38 loc) · 956 Bytes

no-visibility

Disallows the .show/.hide/.toggle methods.

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

Rule details

❌ Examples of incorrect code:

$( 'div' ).show();
$div.show();
$( 'div' ).first().show();
$( 'div' ).append( $( 'input' ).show() );
$( 'div' ).hide();
$div.hide();
$( 'div' ).first().hide();
$( 'div' ).append( $( 'input' ).hide() );
$( 'div' ).toggle();
$div.toggle();
$( 'div' ).first().toggle();
$( 'div' ).append( $( 'input' ).toggle() );

✔️ Examples of correct code:

show();
[].show();
div.show();
div.show;
hide();
[].hide();
div.hide();
div.hide;
toggle();
[].toggle();
div.toggle();
div.toggle;

Resources