@eslint-react/ast 5.28.8 → 5.30.0-beta.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
@@ -1,5 +1,4 @@
1
1
  import { AST_NODE_TYPES, TSESTree } from "@typescript-eslint/types";
2
- //#region src/tree.d.ts
3
2
  /** Union of function-like node types. */
4
3
  type TSESTreeFunction = TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression;
5
4
  /** Union of class-like node types. */
@@ -24,7 +23,7 @@ type TSESTreeTypeExpression = TSESTree.TSAsExpression | TSESTree.TSTypeAssertion
24
23
  /** Union of expression node types that wrap another expression (TypeScript type expressions and chain expressions) — the nodes `Extract.unwrap` strips. */
25
24
  type TSESTreeTypeOrChainExpression = TSESTreeTypeExpression | TSESTree.ChainExpression;
26
25
  declare namespace check_d_exports {
27
- export { is, isCallExpression, isClass, isConditional, isDirective, isExpression, isFunction, isFunctionOrClass, isIdentifier, isJSX, isJSXElement, isJSXElementOrFragment, isJSXExpressionContainer, isJSXFragment, isJSXSpreadAttribute, isJSXTagNameExpression, isMemberExpression, isObjectExpression, isOneOf, isProperty, isPropertyOrMethod, isReturnStatement, isTypeAssertionExpression, isTypeExpression, isTypeOrChainExpression };
26
+ export { is, isCallExpression, isClass, isConditional, isDirective, isExpression, isFunction, isFunctionOrClass, isIdentifier, isJSX, isJSXElement, isJSXElementOrFragment, isJSXExpressionContainer, isJSXFragment, isJSXSpreadAttribute, isJSXTagNameExpression, isLoopStatement, isMemberExpression, isObjectExpression, isOneOf, isProperty, isPropertyOrMethod, isReturnStatement, isTypeAssertionExpression, isTypeExpression, isTypeOrChainExpression };
28
27
  }
29
28
  /** Check if a node is of the given type. */
30
29
  declare const is: <NodeType extends AST_NODE_TYPES>(nodeType: NodeType) => (node: TSESTree.Node | null | undefined) => node is Extract<TSESTree.Node, {
@@ -57,6 +56,8 @@ declare const isMemberExpression: (node: TSESTree.Node | null | undefined) => no
57
56
  declare const isObjectExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.ObjectExpression;
58
57
  /** Check if a node is an expression node. */
59
58
  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;
59
+ /** Check if a node is a loop statement. */
60
+ declare const isLoopStatement: (node: TSESTree.Node | null | undefined) => node is TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.WhileStatement;
60
61
  /** Check if a node is a return statement. */
61
62
  declare const isReturnStatement: (node: TSESTree.Node | null | undefined) => node is TSESTree.ReturnStatement;
62
63
  /** Check if a node is a class declaration or class expression. */
@@ -193,5 +194,4 @@ declare function findEnclosingTryBlock(node: TSESTree.Node): TSESTree.TryStateme
193
194
  * @returns `true` when an enclosing `try` block exists.
194
195
  */
195
196
  declare function hasEnclosingTryBlock(node: TSESTree.Node): boolean;
196
- //#endregion
197
197
  export { check_d_exports as Check, compare_d_exports as Compare, extract_d_exports as Extract, type TSESTreeClass, type TSESTreeDirective, type TSESTreeFunction, type TSESTreeFunctionOrClass, type TSESTreeJSX, type TSESTreeJSXAttributeLike, type TSESTreeJSXElementLike, type TSESTreeMethodOrPropertyDefinition, type TSESTreeTypeExpression, type TSESTreeTypeOrChainExpression, traverse_d_exports as Traverse };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.js";
2
2
  import { AST_NODE_TYPES } from "@typescript-eslint/types";
3
3
  import * as ASTUtils from "@typescript-eslint/utils/ast-utils";
4
- //#region src/check.ts
4
+ // src/check.ts
5
5
  var check_exports = /* @__PURE__ */ __exportAll({
6
6
  is: () => is,
7
7
  isCallExpression: () => isCallExpression,
@@ -19,6 +19,7 @@ var check_exports = /* @__PURE__ */ __exportAll({
19
19
  isJSXFragment: () => isJSXFragment,
20
20
  isJSXSpreadAttribute: () => isJSXSpreadAttribute,
21
21
  isJSXTagNameExpression: () => isJSXTagNameExpression,
22
+ isLoopStatement: () => isLoopStatement,
22
23
  isMemberExpression: () => isMemberExpression,
23
24
  isObjectExpression: () => isObjectExpression,
24
25
  isOneOf: () => isOneOf,
@@ -77,6 +78,13 @@ const isExpression = isOneOf([
77
78
  AST_NODE_TYPES.UpdateExpression,
78
79
  AST_NODE_TYPES.YieldExpression
79
80
  ]);
81
+ const isLoopStatement = isOneOf([
82
+ AST_NODE_TYPES.DoWhileStatement,
83
+ AST_NODE_TYPES.ForInStatement,
84
+ AST_NODE_TYPES.ForOfStatement,
85
+ AST_NODE_TYPES.ForStatement,
86
+ AST_NODE_TYPES.WhileStatement
87
+ ]);
80
88
  const isReturnStatement = is(AST_NODE_TYPES.ReturnStatement);
81
89
  const isClass = isOneOf([AST_NODE_TYPES.ClassDeclaration, AST_NODE_TYPES.ClassExpression]);
82
90
  const isFunction$1 = isOneOf([
@@ -157,8 +165,7 @@ const isTypeOrChainExpression = isOneOf([
157
165
  AST_NODE_TYPES.TSInstantiationExpression,
158
166
  AST_NODE_TYPES.ChainExpression
159
167
  ]);
160
- //#endregion
161
- //#region ../../.pkgs/eff/dist/index.js
168
+ // ../../.pkgs/eff/dist/index.js
162
169
  const pipeArguments = (self, args) => {
163
170
  switch (args.length) {
164
171
  case 0: return self;
@@ -252,8 +259,7 @@ dual(2, (self, predicate) => {
252
259
  while (idx < len && predicate(input[idx], idx)) idx++;
253
260
  return input.slice(0, idx);
254
261
  });
255
- //#endregion
256
- //#region src/extract.ts
262
+ // src/extract.ts
257
263
  var extract_exports = /* @__PURE__ */ __exportAll({
258
264
  findProperty: () => findProperty,
259
265
  getAssignmentTargets: () => getAssignmentTargets,
@@ -333,8 +339,7 @@ function getFullyQualifiedName(node, getText) {
333
339
  default: return getText(expr);
334
340
  }
335
341
  }
336
- //#endregion
337
- //#region src/compare.ts
342
+ // src/compare.ts
338
343
  var compare_exports = /* @__PURE__ */ __exportAll({ isEqual: () => isEqual });
339
344
  const isEqual = dual(2, (a, b) => {
340
345
  a = isTypeExpression(a) ? unwrap(a) : a;
@@ -384,8 +389,7 @@ const isEqual = dual(2, (a, b) => {
384
389
  default: return false;
385
390
  }
386
391
  });
387
- //#endregion
388
- //#region src/traverse.ts
392
+ // src/traverse.ts
389
393
  var traverse_exports = /* @__PURE__ */ __exportAll({
390
394
  findEnclosingTryBlock: () => findEnclosingTryBlock,
391
395
  findParent: () => findParent,
@@ -415,5 +419,4 @@ function findEnclosingTryBlock(node) {
415
419
  function hasEnclosingTryBlock(node) {
416
420
  return findEnclosingTryBlock(node) != null;
417
421
  }
418
- //#endregion
419
422
  export { check_exports as Check, compare_exports as Compare, extract_exports as Extract, traverse_exports as Traverse };
@@ -1,4 +1,4 @@
1
- //#region \0rolldown/runtime.js
1
+ // \0rolldown/runtime.js
2
2
  var __defProp = Object.defineProperty;
3
3
  var __exportAll = (all, no_symbols) => {
4
4
  let target = {};
@@ -9,5 +9,4 @@ var __exportAll = (all, no_symbols) => {
9
9
  if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
10
  return target;
11
11
  };
12
- //#endregion
13
12
  export { __exportAll as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/ast",
3
- "version": "5.28.8",
3
+ "version": "5.30.0-beta.1",
4
4
  "description": "ESLint React's TSESTree AST utility module.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -40,7 +40,7 @@
40
40
  "@tsconfig/node20": "^20.1.10",
41
41
  "@types/node": "^20.19.43",
42
42
  "eslint": "^10.13.0",
43
- "tsdown": "^0.23.1",
43
+ "tsdown": "^0.23.2",
44
44
  "typescript": "6.0.3",
45
45
  "vitest": "^5.0.5"
46
46
  },