You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ideally jQueryAliases should be a configurable option
PS: If you agree with this solution - I can create a PR 👍
The text was updated successfully, but these errors were encountered:
alies-dev
changed the title
Inspections can't detect jQuery usages if non-$ alias used
Inspections can't detect jQuery usages if non-$ alias is used
Sep 10, 2018
Not a maintainer of this plugin, but I think this would be a good idea. I wonder if this would be a use case for using ESLint's shared settings so the aliases are accessible across all rules.
// .eslintrc.jsmodule.exports={settings: {jQueryAliases: ['jquery','jQuery','$'],},}// in your rulemodule.exports={create(context){constjQueryAliases=context.settings&&context.settings.jQueryAliases
? [].concat(context.settings.jQueryAliases)
: ['$']return{// use `jQueryAliases` in your visitor}},}
Inspections can't detect jQuery usages if non-
$
alias is usedExample of a code that can be omitted by
jquery/no-ajax
rule:That's because some rules contains the following code:
the quick-fix solution is to check for
jQuery
/jquery
also:Ideally jQueryAliases should be a configurable option
PS: If you agree with this solution - I can create a PR 👍
The text was updated successfully, but these errors were encountered: