We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53d688e commit 38b3319Copy full SHA for 38b3319
eslint/rules/jquery-no-trim.js
@@ -22,6 +22,8 @@ module.exports = {
22
create: function (context) {
23
'use strict';
24
25
+ var utils = require('./utils.js');
26
+
27
return {
28
/**
29
* Checks if trim method is used and reports it.
@@ -31,14 +33,14 @@ module.exports = {
31
33
CallExpression: function (node) {
32
34
if (node.callee.type !== 'MemberExpression') {return;}
35
- if (node.callee.object.name !== '$') {return;}
-
36
if (node.callee.property.name !== 'trim') {return;}
37
38
- context.report({
39
- node: node,
40
- messageId: 'trim'
41
- });
+ if (utils.isjQuery(node)) {
+ context.report({
+ node: node,
+ messageId: 'trim'
42
+ });
43
+ }
44
}
45
};
46
0 commit comments