@eslint-react/ast 5.18.6 → 5.18.8

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -6
  2. package/package.json +10 -10
package/dist/index.js CHANGED
@@ -678,8 +678,8 @@ function findProperty(properties, name) {
678
678
  */
679
679
  function getCalleeName(node) {
680
680
  const callee = unwrap(node.callee);
681
- if (callee.type === AST_NODE_TYPES.Identifier) return callee.name;
682
- if (callee.type === AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === AST_NODE_TYPES.Identifier) return callee.property.name;
681
+ if (isIdentifier(callee)) return callee.name;
682
+ if (callee.type === AST_NODE_TYPES.MemberExpression && !callee.computed && isIdentifier(callee.property)) return callee.property.name;
683
683
  return null;
684
684
  }
685
685
  /**
@@ -705,7 +705,7 @@ function getInnermostCall(node) {
705
705
  */
706
706
  function getPropertyName(property, effort = "min") {
707
707
  const key = unwrap(property.key);
708
- if (key.type === AST_NODE_TYPES.Identifier && !property.computed) return key.name;
708
+ if (isIdentifier(key) && !property.computed) return key.name;
709
709
  if (effort === "min") return null;
710
710
  if (key.type === AST_NODE_TYPES.Literal && typeof key.value === "string") return key.value;
711
711
  if (key.type === AST_NODE_TYPES.TemplateLiteral && key.expressions.length === 0) return key.quasis[0]?.value.cooked ?? key.quasis[0]?.value.raw ?? null;
@@ -744,10 +744,10 @@ function getIdentifierAt(node, position) {
744
744
  let current = unwrap(node);
745
745
  while (current.type === AST_NODE_TYPES.MemberExpression) {
746
746
  const property = unwrap(current.property);
747
- identifiers.unshift(property.type === AST_NODE_TYPES.Identifier ? property : null);
747
+ identifiers.unshift(isIdentifier(property) ? property : null);
748
748
  current = unwrap(current.object);
749
749
  }
750
- identifiers.unshift(current.type === AST_NODE_TYPES.Identifier ? current : null);
750
+ identifiers.unshift(isIdentifier(current) ? current : null);
751
751
  return identifiers.at(position) ?? null;
752
752
  }
753
753
 
@@ -782,7 +782,7 @@ const isEqual = dual(2, (a, b) => {
782
782
  }
783
783
  return true;
784
784
  }
785
- case a.type === AST_NODE_TYPES.Identifier && b.type === AST_NODE_TYPES.Identifier: return a.name === b.name;
785
+ case isIdentifier(a) && isIdentifier(b): return a.name === b.name;
786
786
  case a.type === AST_NODE_TYPES.PrivateIdentifier && b.type === AST_NODE_TYPES.PrivateIdentifier: return a.name === b.name;
787
787
  case a.type === AST_NODE_TYPES.MemberExpression && b.type === AST_NODE_TYPES.MemberExpression: return isEqual(a.property, b.property) && isEqual(a.object, b.object);
788
788
  case a.type === AST_NODE_TYPES.CallExpression && b.type === AST_NODE_TYPES.CallExpression: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/ast",
3
- "version": "5.18.6",
3
+ "version": "5.18.8",
4
4
  "description": "ESLint React's TSESTree AST utility module.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -29,20 +29,20 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@typescript-eslint/types": "^8.67.0",
33
- "@typescript-eslint/typescript-estree": "^8.67.0",
34
- "@typescript-eslint/utils": "^8.67.0",
32
+ "@typescript-eslint/types": "^8.69.0",
33
+ "@typescript-eslint/typescript-estree": "^8.69.0",
34
+ "@typescript-eslint/utils": "^8.69.0",
35
35
  "string-ts": "^2.3.1"
36
36
  },
37
37
  "devDependencies": {
38
- "@typescript-eslint/parser": "^8.67.0",
39
- "eslint": "^10.8.1",
40
- "tsdown": "^0.22.14",
41
- "typescript": "6.0.3",
42
- "vitest": "^4.1.10",
43
38
  "@local/configs": "0.0.0",
39
+ "@local/eff": "0.0.0",
44
40
  "@local/testkit": "0.0.0",
45
- "@local/eff": "0.0.0"
41
+ "@typescript-eslint/parser": "^8.69.0",
42
+ "eslint": "^10.9.1",
43
+ "tsdown": "^0.22.14",
44
+ "typescript": "6.0.3",
45
+ "vitest": "^4.1.11"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "eslint": "*",