Open
Description
Inspections can't detect jQuery usages if non-$
alias is used
Example of a code that can be omitted by jquery/no-ajax
rule:
import jQuery from 'jquery';
jQuery
.ajax({ url: url, method: 'POST' })
.done(() => { });
That's because some rules contains the following code:
if (node.callee.object.name !== '$') return
the quick-fix solution is to check for jQuery
/jquery
also:
const jQueryAliases = ['$', 'jQuery', 'jquery'];
const calleeObjectName = node.callee.object.name;
if (! jQueryAliases.includes(calleeObjectName)) return
Ideally jQueryAliases should be a configurable option
PS: If you agree with this solution - I can create a PR 👍
Metadata
Metadata
Assignees
Labels
No labels