Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 785 Bytes

no-prop.md

File metadata and controls

34 lines (26 loc) · 785 Bytes

no-prop

Disallows the .prop/.removeProp methods and $.prop/$.removeProp utilies. Prefer direct property access.

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

Rule details

❌ Examples of incorrect code:

$.prop();
$( 'div' ).prop();
$div.prop();
$( 'div' ).first().prop();
$( 'div' ).append( $( 'input' ).prop() );
$( 'div' ).removeProp();

✔️ Examples of correct code:

prop();
[].prop();
div.prop();
div.prop;
removeProp();
div.removeProp();

Resources