@eslint-react/ast 1.15.1-beta.2 → 1.15.1-next.10

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.mts CHANGED
@@ -130,7 +130,7 @@ declare function getClassIdentifier(node: TSESTreeClass): O.Option<TSESTree$1.Id
130
130
  * same AST nodes with some exceptions to better fit our use case.
131
131
  */
132
132
 
133
- declare function getFunctionIdentifier(node: TSESTreeFunction): O.Option<TSESTree$1.Identifier>;
133
+ declare function getFunctionIdentifier(node: TSESTree$1.Expression | TSESTreeFunction): O.Option<TSESTree$1.Identifier>;
134
134
 
135
135
  declare function getIdentifiersFromBinaryExpression(side: TSESTree$1.BinaryExpression | TSESTree$1.BinaryExpression["left"] | TSESTree$1.BinaryExpression["right"]): TSESTree$1.Identifier[];
136
136
 
package/dist/index.d.ts CHANGED
@@ -130,7 +130,7 @@ declare function getClassIdentifier(node: TSESTreeClass): O.Option<TSESTree$1.Id
130
130
  * same AST nodes with some exceptions to better fit our use case.
131
131
  */
132
132
 
133
- declare function getFunctionIdentifier(node: TSESTreeFunction): O.Option<TSESTree$1.Identifier>;
133
+ declare function getFunctionIdentifier(node: TSESTree$1.Expression | TSESTreeFunction): O.Option<TSESTree$1.Identifier>;
134
134
 
135
135
  declare function getIdentifiersFromBinaryExpression(side: TSESTree$1.BinaryExpression | TSESTree$1.BinaryExpression["left"] | TSESTree$1.BinaryExpression["right"]): TSESTree$1.Identifier[];
136
136
 
package/dist/index.js CHANGED
@@ -232,7 +232,7 @@ var isLeftHandSideExpressionType = isOneOf([
232
232
 
233
233
  // src/get-function-identifier.ts
234
234
  function getFunctionIdentifier(node) {
235
- if (node.id) return tools.O.some(node.id);
235
+ if ("id" in node && node.id) return tools.O.some(node.id);
236
236
  if (node.parent.type === types.AST_NODE_TYPES.VariableDeclarator && node.parent.init === node && node.parent.id.type === types.AST_NODE_TYPES.Identifier) {
237
237
  return tools.O.some(node.parent.id);
238
238
  }
@@ -248,6 +248,9 @@ function getFunctionIdentifier(node) {
248
248
  if (node.parent.type === types.AST_NODE_TYPES.AssignmentPattern && node.parent.right === node && node.parent.left.type === types.AST_NODE_TYPES.Identifier) {
249
249
  return tools.O.some(node.parent.left);
250
250
  }
251
+ if (isOneOf([types.AST_NODE_TYPES.TSAsExpression, types.AST_NODE_TYPES.TSSatisfiesExpression])(node.parent) && node.parent.expression === node) {
252
+ return getFunctionIdentifier(node.parent);
253
+ }
251
254
  return tools.O.none();
252
255
  }
253
256
  function getIdentifiersFromBinaryExpression(side) {
package/dist/index.mjs CHANGED
@@ -230,7 +230,7 @@ var isLeftHandSideExpressionType = isOneOf([
230
230
 
231
231
  // src/get-function-identifier.ts
232
232
  function getFunctionIdentifier(node) {
233
- if (node.id) return O.some(node.id);
233
+ if ("id" in node && node.id) return O.some(node.id);
234
234
  if (node.parent.type === AST_NODE_TYPES.VariableDeclarator && node.parent.init === node && node.parent.id.type === AST_NODE_TYPES.Identifier) {
235
235
  return O.some(node.parent.id);
236
236
  }
@@ -246,6 +246,9 @@ function getFunctionIdentifier(node) {
246
246
  if (node.parent.type === AST_NODE_TYPES.AssignmentPattern && node.parent.right === node && node.parent.left.type === AST_NODE_TYPES.Identifier) {
247
247
  return O.some(node.parent.left);
248
248
  }
249
+ if (isOneOf([AST_NODE_TYPES.TSAsExpression, AST_NODE_TYPES.TSSatisfiesExpression])(node.parent) && node.parent.expression === node) {
250
+ return getFunctionIdentifier(node.parent);
251
+ }
249
252
  return O.none();
250
253
  }
251
254
  function getIdentifiersFromBinaryExpression(side) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/ast",
3
- "version": "1.15.1-beta.2",
3
+ "version": "1.15.1-next.10",
4
4
  "description": "ESLint React's TSESTree AST utility module.",
5
5
  "homepage": "https://github.com/rel1cx/eslint-react",
6
6
  "bugs": {
@@ -35,14 +35,14 @@
35
35
  "./package.json"
36
36
  ],
37
37
  "dependencies": {
38
- "@typescript-eslint/types": "^8.10.0",
39
- "@typescript-eslint/typescript-estree": "^8.10.0",
40
- "@typescript-eslint/utils": "^8.10.0",
38
+ "@typescript-eslint/types": "^8.11.0",
39
+ "@typescript-eslint/typescript-estree": "^8.11.0",
40
+ "@typescript-eslint/utils": "^8.11.0",
41
41
  "birecord": "^0.1.1",
42
42
  "string-ts": "^2.2.0",
43
43
  "ts-pattern": "^5.5.0",
44
- "@eslint-react/tools": "1.15.1-beta.2",
45
- "@eslint-react/types": "1.15.1-beta.2"
44
+ "@eslint-react/tools": "1.15.1-next.10",
45
+ "@eslint-react/types": "1.15.1-next.10"
46
46
  },
47
47
  "devDependencies": {
48
48
  "tsup": "^8.3.0"