all files / eslint-plugin-angular/rules/ angularelement.js

100% Statements 5/5
100% Branches 4/4
100% Functions 2/2
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23                      11×   14×            
/**
 * use `angular.element` instead of `$` or `jQuery`
 *
 * The angular.element method should be used instead of the $ or jQuery object (if you are using jQuery of course).
 * If the jQuery library is imported, angular.element will be a wrapper around the jQuery object.
 *
 * @version 0.1.0
 * @category angularWrapper
 */
'use strict';
 
module.exports = function(context) {
    return {
        CallExpression: function(node) {
            if (node.callee.name === '$' || node.callee.name === 'jQuery') {
                context.report(node, 'You should use angular.element instead of the jQuery $ object', {});
            }
        }
    };
};
 
module.exports.schema = [];