Skip to content

Latest commit

 

History

History
54 lines (46 loc) · 1.17 KB

no-wrap.md

File metadata and controls

54 lines (46 loc) · 1.17 KB

no-wrap

Disallows the .wrap/.wrapAll/.wrapInner/.unwrap methods.

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

Rule details

❌ Examples of incorrect code:

$( 'div' ).wrap();
$div.wrap();
$( 'div' ).first().wrap();
$( 'div' ).append( $( 'input' ).wrap() );
$( 'div' ).wrapAll();
$div.wrapAll();
$( 'div' ).first().wrapAll();
$( 'div' ).append( $( 'input' ).wrapAll() );
$( 'div' ).wrapInner();
$div.wrapInner();
$( 'div' ).first().wrapInner();
$( 'div' ).append( $( 'input' ).wrapInner() );
$( 'div' ).unwrap();
$div.unwrap();
$( 'div' ).first().unwrap();
$( 'div' ).append( $( 'input' ).unwrap() );

✔️ Examples of correct code:

wrap();
[].wrap();
div.wrap();
div.wrap;
wrapAll();
[].wrapAll();
div.wrapAll();
div.wrapAll;
wrapInner();
[].wrapInner();
div.wrapInner();
div.wrapInner;
unwrap();
[].unwrap();
div.unwrap();
div.unwrap;

Resources