Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 1.05 KB

no-is-function.md

File metadata and controls

37 lines (26 loc) · 1.05 KB

no-is-function

Disallows the $.isFunction utility. Prefer typeof.

📋 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:

$.isFunction( expression( arg ) );
if ( $.isFunction( fn ) ) { g(); }

✔️ Examples of correct code:

isFunction();
myClass.isFunction();
$div.isFunction();

🔧 Examples of code fixed by this rule:

$.isFunction( expression( arg ) ); /* → */ typeof expression( arg ) === 'function';
if ( $.isFunction( fn ) ) { g(); } /* → */ if ( typeof fn === 'function' ) { g(); }

Resources