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.
❌ 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 );