Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.08 KB

no-proxy.md

File metadata and controls

39 lines (28 loc) · 1.08 KB

no-proxy

Disallows the $.proxy utility. Prefer Function#bind.

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

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

🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

Rule details

❌ Examples of incorrect code:

$.proxy( this.fn, context );
$.proxy( fn, context, arg1, arg2 );
$.proxy( context, 'fnName' );
$.proxy( context, 'fnName', arg1, arg2 );

✔️ Examples of correct code:

proxy( fn, context );
'test'.proxy( fn, context );
'test'.proxy;

🔧 Examples of code fixed by this rule:

$.proxy( this.fn, context );        /* → */ this.fn.bind( context );
$.proxy( fn, context, arg1, arg2 ); /* → */ fn.bind( context, arg1, arg2 );

Resources