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