@eslint-react/var 5.30.0-beta.11 → 5.30.0-beta.12
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.js +5 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -234,6 +234,8 @@ function isEqualWith(context, a, b, options) {
|
|
|
234
234
|
const { identifierComparison = "identity" } = options ?? {};
|
|
235
235
|
a = Check.isTypeExpression(a) ? Extract.unwrap(a) : a;
|
|
236
236
|
b = Check.isTypeExpression(b) ? Extract.unwrap(b) : b;
|
|
237
|
+
a = a.type === AST_NODE_TYPES.ChainExpression ? a.expression : a;
|
|
238
|
+
b = b.type === AST_NODE_TYPES.ChainExpression ? b.expression : b;
|
|
237
239
|
const [aScope, bScope] = [context.sourceCode.getScope(a), context.sourceCode.getScope(b)];
|
|
238
240
|
switch (true) {
|
|
239
241
|
case a === b: return true;
|
|
@@ -276,7 +278,9 @@ function isEqualWith(context, a, b, options) {
|
|
|
276
278
|
}
|
|
277
279
|
return aBinding != null && bBinding != null && aBinding.variable === bBinding.variable;
|
|
278
280
|
}
|
|
279
|
-
case a.type === AST_NODE_TYPES.MemberExpression && b.type === AST_NODE_TYPES.MemberExpression:
|
|
281
|
+
case a.type === AST_NODE_TYPES.MemberExpression && b.type === AST_NODE_TYPES.MemberExpression:
|
|
282
|
+
if (a.computed !== b.computed || a.optional !== b.optional) return false;
|
|
283
|
+
return (a.computed ? isEqualWith(context, a.property, b.property, options) : Compare.isEqual(a.property, b.property)) && isEqualWith(context, a.object, b.object, options);
|
|
280
284
|
case a.type === AST_NODE_TYPES.ThisExpression && b.type === AST_NODE_TYPES.ThisExpression:
|
|
281
285
|
if (aScope.block === bScope.block) return true;
|
|
282
286
|
return Traverse.findParent(a, Check.isOneOf(thisBlockTypes)) === Traverse.findParent(b, Check.isOneOf(thisBlockTypes));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/var",
|
|
3
|
-
"version": "5.30.0-beta.
|
|
3
|
+
"version": "5.30.0-beta.12",
|
|
4
4
|
"description": "ESLint React's TSESTree AST utility module for static analysis of variables.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@eslint-react/ast": "5.30.0-beta.
|
|
33
|
-
"@eslint-react/eslint": "5.30.0-beta.
|
|
32
|
+
"@eslint-react/ast": "5.30.0-beta.12",
|
|
33
|
+
"@eslint-react/eslint": "5.30.0-beta.12",
|
|
34
34
|
"@typescript-eslint/scope-manager": "^8.72.1",
|
|
35
35
|
"@typescript-eslint/types": "^8.72.1",
|
|
36
36
|
"@typescript-eslint/utils": "^8.72.1",
|