@eslint-react/ast 5.10.0 → 5.10.2

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.d.ts CHANGED
@@ -54,7 +54,7 @@ declare namespace extract_d_exports {
54
54
  }
55
55
  declare function unwrap(node: TSESTree.Node): Exclude<TSESTree.Node, TSESTreeTypeExpression>;
56
56
  declare function getRootIdentifier(node: TSESTree.Expression | TSESTree.PrivateIdentifier): TSESTree.Identifier | null;
57
- declare function getPropertyName(node: TSESTree.Node): string | null;
57
+ declare function getPropertyName(node: TSESTree.Node, resolve?: (n: TSESTree.Identifier | TSESTree.PrivateIdentifier) => string | null): string | null;
58
58
  declare function getFullyQualifiedName(node: TSESTree.Node, getText: (node: TSESTree.Node) => string): string;
59
59
  declare namespace traverse_d_exports {
60
60
  export { findParent };
package/dist/index.js CHANGED
@@ -220,9 +220,9 @@ function getRootIdentifier(node) {
220
220
  if (expr.type === AST_NODE_TYPES.MemberExpression) return getRootIdentifier(expr.object);
221
221
  return null;
222
222
  }
223
- function getPropertyName(node) {
223
+ function getPropertyName(node, resolve = (n) => n.name) {
224
224
  node = unwrap(node);
225
- if (node.type === AST_NODE_TYPES.Identifier || node.type === AST_NODE_TYPES.PrivateIdentifier) return node.name;
225
+ if (node.type === AST_NODE_TYPES.Identifier || node.type === AST_NODE_TYPES.PrivateIdentifier) return resolve(node);
226
226
  if (node.type === AST_NODE_TYPES.Literal) return String(node.value);
227
227
  if (node.type === AST_NODE_TYPES.TemplateLiteral && node.expressions.length === 0) return node.quasis[0]?.value.cooked ?? node.quasis[0]?.value.raw ?? null;
228
228
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/ast",
3
- "version": "5.10.0",
3
+ "version": "5.10.2",
4
4
  "description": "ESLint React's TSESTree AST utility module.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -29,19 +29,19 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@typescript-eslint/types": "^8.62.0",
33
- "@typescript-eslint/typescript-estree": "^8.62.0",
34
- "@typescript-eslint/utils": "^8.62.0",
32
+ "@typescript-eslint/types": "^8.62.1",
33
+ "@typescript-eslint/typescript-estree": "^8.62.1",
34
+ "@typescript-eslint/utils": "^8.62.1",
35
35
  "string-ts": "^2.3.1"
36
36
  },
37
37
  "devDependencies": {
38
- "@typescript-eslint/parser": "^8.62.0",
38
+ "@typescript-eslint/parser": "^8.62.1",
39
39
  "eslint": "^10.6.0",
40
40
  "tsdown": "^0.22.3",
41
41
  "typescript": "6.0.3",
42
42
  "vitest": "^4.1.9",
43
- "@local/eff": "0.0.0",
44
- "@local/configs": "0.0.0"
43
+ "@local/configs": "0.0.0",
44
+ "@local/eff": "0.0.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "eslint": "*",