@eslint-react/ast 5.20.0 → 5.20.1

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
@@ -68,11 +68,7 @@ declare const isTypeExpression: (node: TSESTree.Node | null | undefined) => node
68
68
  declare const isTypeAssertionExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSAsExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion;
69
69
  /** Check if a node is an expression node. */
70
70
  declare const isExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpressionWithBlockBody | TSESTree.ArrowFunctionExpressionWithExpressionBody | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.ImportExpression | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.TemplateLiteral | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion | TSESTree.UnaryExpressionBitwiseNot | TSESTree.UnaryExpressionDelete | TSESTree.UnaryExpressionMinus | TSESTree.UnaryExpressionNot | TSESTree.UnaryExpressionPlus | TSESTree.UnaryExpressionTypeof | TSESTree.UnaryExpressionVoid | TSESTree.UpdateExpression | TSESTree.YieldNoStarExpression | TSESTree.YieldStarExpression;
71
- /**
72
- * Check if a node is a conditional expression or a control flow statement.
73
- * @param node The node to check.
74
- * @returns `true` if the node is conditional.
75
- */
71
+ /** Check if a node is a conditional expression or a control flow statement. */
76
72
  declare const isConditional: (node: TSESTree.Node | null | undefined) => node is TSESTree.ConditionalExpression | TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.IfStatement | TSESTree.LogicalExpression | TSESTree.SwitchStatement | TSESTree.WhileStatement;
77
73
  declare namespace compare_d_exports {
78
74
  export { isEqual };
@@ -153,9 +149,9 @@ type NodePredicate = (node: TSESTree.Node) => boolean;
153
149
  declare function findParent<T extends TSESTree.Node>(node: TSESTree.Node | null, test: Predicate<T>, stop?: NodePredicate): T | null;
154
150
  declare function findParent(node: TSESTree.Node | null, test: NodePredicate, stop?: NodePredicate): TSESTree.Node | null;
155
151
  /**
156
- * Finds the nearest TryStatement whose `try` block (not catch/finally) encloses the given node.
152
+ * Find the nearest `TryStatement` whose `try` block (not `catch`/`finally`) encloses the given node.
157
153
  * @param node The node to check.
158
- * @returns The enclosing TryStatement, or null if none is found.
154
+ * @returns The enclosing `TryStatement`, or `null` when none is found.
159
155
  */
160
156
  declare function findEnclosingTryBlock(node: TSESTree.Node): TSESTree.TryStatement | null;
161
157
  //#endregion
package/dist/index.js CHANGED
@@ -144,11 +144,7 @@ const isExpression = isOneOf([
144
144
  AST_NODE_TYPES.UpdateExpression,
145
145
  AST_NODE_TYPES.YieldExpression
146
146
  ]);
147
- /**
148
- * Check if a node is a conditional expression or a control flow statement.
149
- * @param node The node to check.
150
- * @returns `true` if the node is conditional.
151
- */
147
+ /** Check if a node is a conditional expression or a control flow statement. */
152
148
  const isConditional = isOneOf([
153
149
  AST_NODE_TYPES.DoWhileStatement,
154
150
  AST_NODE_TYPES.ForInStatement,
@@ -828,9 +824,9 @@ function findParent(node, test, stop) {
828
824
  return null;
829
825
  }
830
826
  /**
831
- * Finds the nearest TryStatement whose `try` block (not catch/finally) encloses the given node.
827
+ * Find the nearest `TryStatement` whose `try` block (not `catch`/`finally`) encloses the given node.
832
828
  * @param node The node to check.
833
- * @returns The enclosing TryStatement, or null if none is found.
829
+ * @returns The enclosing `TryStatement`, or `null` when none is found.
834
830
  */
835
831
  function findEnclosingTryBlock(node) {
836
832
  const parent = node.parent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/ast",
3
- "version": "5.20.0",
3
+ "version": "5.20.1",
4
4
  "description": "ESLint React's TSESTree AST utility module.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -39,7 +39,7 @@
39
39
  "@local/eff": "0.0.0",
40
40
  "@local/testkit": "0.0.0",
41
41
  "@typescript-eslint/parser": "^8.70.0",
42
- "eslint": "^10.10.0",
42
+ "eslint": "^10.11.0",
43
43
  "tsdown": "^0.23.0",
44
44
  "typescript": "6.0.3",
45
45
  "vitest": "^5.0.1"