@saasmakers/eslint 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +9 -11
- package/dist/index.mjs +9 -11
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -143,18 +143,19 @@ function expressionStartsWithIdentifier(node, identifier) {
|
|
|
143
143
|
if (node.type === index$1.distExports.AST_NODE_TYPES.Identifier && node.name === identifier) {
|
|
144
144
|
return true;
|
|
145
145
|
}
|
|
146
|
-
if (node.type === index$1.distExports.AST_NODE_TYPES.CallExpression
|
|
147
|
-
|
|
146
|
+
if (node.type === index$1.distExports.AST_NODE_TYPES.CallExpression) {
|
|
147
|
+
const { callee } = node;
|
|
148
|
+
if (callee.type === index$1.distExports.AST_NODE_TYPES.Identifier && callee.name === identifier) {
|
|
148
149
|
return true;
|
|
149
150
|
}
|
|
150
|
-
if (
|
|
151
|
-
return expressionStartsWithIdentifier(
|
|
151
|
+
if (callee.type === index$1.distExports.AST_NODE_TYPES.MemberExpression) {
|
|
152
|
+
return expressionStartsWithIdentifier(callee.object, identifier);
|
|
152
153
|
}
|
|
153
|
-
if (
|
|
154
|
-
return expressionStartsWithIdentifier(
|
|
154
|
+
if (callee.type === index$1.distExports.AST_NODE_TYPES.ChainExpression) {
|
|
155
|
+
return expressionStartsWithIdentifier(callee.expression, identifier);
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
|
-
if (node.type === index$1.distExports.AST_NODE_TYPES.MemberExpression
|
|
158
|
+
if (node.type === index$1.distExports.AST_NODE_TYPES.MemberExpression) {
|
|
158
159
|
return expressionStartsWithIdentifier(node.object, identifier);
|
|
159
160
|
}
|
|
160
161
|
if (node.type === index$1.distExports.AST_NODE_TYPES.ChainExpression) {
|
|
@@ -169,9 +170,6 @@ function expressionUsesThis(expression) {
|
|
|
169
170
|
if (expression.type === index$1.distExports.AST_NODE_TYPES.CallExpression) {
|
|
170
171
|
return isThisReceiver(expression.callee);
|
|
171
172
|
}
|
|
172
|
-
if (expression.type === index$1.distExports.AST_NODE_TYPES.OptionalCallExpression) {
|
|
173
|
-
return isThisReceiver(expression.callee);
|
|
174
|
-
}
|
|
175
173
|
if (expression.type === index$1.distExports.AST_NODE_TYPES.UpdateExpression) {
|
|
176
174
|
return isThisReceiver(expression.argument);
|
|
177
175
|
}
|
|
@@ -299,7 +297,7 @@ function isThisReceiver(node) {
|
|
|
299
297
|
if (node.type === index$1.distExports.AST_NODE_TYPES.ThisExpression) {
|
|
300
298
|
return true;
|
|
301
299
|
}
|
|
302
|
-
if (node.type === index$1.distExports.AST_NODE_TYPES.MemberExpression
|
|
300
|
+
if (node.type === index$1.distExports.AST_NODE_TYPES.MemberExpression) {
|
|
303
301
|
return isThisReceiver(node.object);
|
|
304
302
|
}
|
|
305
303
|
if (node.type === index$1.distExports.AST_NODE_TYPES.ChainExpression) {
|
package/dist/index.mjs
CHANGED
|
@@ -141,18 +141,19 @@ function expressionStartsWithIdentifier(node, identifier) {
|
|
|
141
141
|
if (node.type === distExports.AST_NODE_TYPES.Identifier && node.name === identifier) {
|
|
142
142
|
return true;
|
|
143
143
|
}
|
|
144
|
-
if (node.type === distExports.AST_NODE_TYPES.CallExpression
|
|
145
|
-
|
|
144
|
+
if (node.type === distExports.AST_NODE_TYPES.CallExpression) {
|
|
145
|
+
const { callee } = node;
|
|
146
|
+
if (callee.type === distExports.AST_NODE_TYPES.Identifier && callee.name === identifier) {
|
|
146
147
|
return true;
|
|
147
148
|
}
|
|
148
|
-
if (
|
|
149
|
-
return expressionStartsWithIdentifier(
|
|
149
|
+
if (callee.type === distExports.AST_NODE_TYPES.MemberExpression) {
|
|
150
|
+
return expressionStartsWithIdentifier(callee.object, identifier);
|
|
150
151
|
}
|
|
151
|
-
if (
|
|
152
|
-
return expressionStartsWithIdentifier(
|
|
152
|
+
if (callee.type === distExports.AST_NODE_TYPES.ChainExpression) {
|
|
153
|
+
return expressionStartsWithIdentifier(callee.expression, identifier);
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
|
-
if (node.type === distExports.AST_NODE_TYPES.MemberExpression
|
|
156
|
+
if (node.type === distExports.AST_NODE_TYPES.MemberExpression) {
|
|
156
157
|
return expressionStartsWithIdentifier(node.object, identifier);
|
|
157
158
|
}
|
|
158
159
|
if (node.type === distExports.AST_NODE_TYPES.ChainExpression) {
|
|
@@ -167,9 +168,6 @@ function expressionUsesThis(expression) {
|
|
|
167
168
|
if (expression.type === distExports.AST_NODE_TYPES.CallExpression) {
|
|
168
169
|
return isThisReceiver(expression.callee);
|
|
169
170
|
}
|
|
170
|
-
if (expression.type === distExports.AST_NODE_TYPES.OptionalCallExpression) {
|
|
171
|
-
return isThisReceiver(expression.callee);
|
|
172
|
-
}
|
|
173
171
|
if (expression.type === distExports.AST_NODE_TYPES.UpdateExpression) {
|
|
174
172
|
return isThisReceiver(expression.argument);
|
|
175
173
|
}
|
|
@@ -297,7 +295,7 @@ function isThisReceiver(node) {
|
|
|
297
295
|
if (node.type === distExports.AST_NODE_TYPES.ThisExpression) {
|
|
298
296
|
return true;
|
|
299
297
|
}
|
|
300
|
-
if (node.type === distExports.AST_NODE_TYPES.MemberExpression
|
|
298
|
+
if (node.type === distExports.AST_NODE_TYPES.MemberExpression) {
|
|
301
299
|
return isThisReceiver(node.object);
|
|
302
300
|
}
|
|
303
301
|
if (node.type === distExports.AST_NODE_TYPES.ChainExpression) {
|