Skip to content

Commit

Permalink
jquery: Enable no-extend (allowDeep: true)
Browse files Browse the repository at this point in the history
Fixes #535
  • Loading branch information
edg2s committed May 2, 2024
1 parent 6c81afc commit 553add2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"no-jquery/no-constructor-attributes": "error",
"no-jquery/no-each-util": "error",
"no-jquery/no-error": "error",
"no-jquery/no-extend": [ "error", { "allowDeep": true } ],
"no-jquery/no-fade": "error",
"no-jquery/no-global-eval": "error",
"no-jquery/no-global-selector": "error",
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/jquery/invalid.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
// eslint-disable-next-line no-jquery/no-error
$.error( 'err' );

// eslint-disable-next-line no-jquery/no-extend
$.extend( {}, {} );
// Deep copy allowed
$.extend( true, {}, {} );

// eslint-disable-next-line no-jquery/no-fade
$( [] ).fadeIn();

Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/jquery/valid.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
$( [] ).animate( { scrollLeft: 50 } );
$( [] ).animate( { scrollTop: 50, scrollLeft: 50 } );

// Valid: no-jquery/no-extend ignores deep copy
$.extend( true, {}, {} );

}() );

0 comments on commit 553add2

Please sign in to comment.