@eslint-react/ast 5.2.2-next.0 → 5.2.3-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,22 +1,17 @@
1
1
  import { AST_NODE_TYPES, TSESTree } from "@typescript-eslint/types";
2
2
 
3
3
  //#region src/types.d.ts
4
- type Node = TSESTree.Node;
5
- type Program = TSESTree.Program;
6
- type Expression = TSESTree.Expression;
7
- type Statement = TSESTree.Statement;
8
- type Identifier = TSESTree.Identifier;
9
- type FunctionExpression = TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression;
10
- type ClassExpression = TSESTree.ClassDeclaration | TSESTree.ClassExpression;
11
- type MethodOrPropertyDefinition = TSESTree.PropertyDefinition | TSESTree.MethodDefinition;
12
- type JSXNode = TSESTree.JSXAttribute | TSESTree.JSXChild | TSESTree.JSXClosingElement | TSESTree.JSXClosingFragment | TSESTree.JSXEmptyExpression | TSESTree.JSXIdentifierToken | TSESTree.JSXOpeningElement | TSESTree.JSXOpeningFragment | TSESTree.JSXSpreadAttribute | TSESTree.JSXTagNameExpression | TSESTree.JSXTextToken;
13
- type JSXElementLike = TSESTree.JSXElement | TSESTree.JSXFragment;
14
- type JSXAttributeLike = TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute;
15
- type Directive = TSESTree.ExpressionStatement & {
4
+ type TSESTreeFunction = TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression;
5
+ type TSESTreeClass = TSESTree.ClassDeclaration | TSESTree.ClassExpression;
6
+ type TSESTreeMethodOrPropertyDefinition = TSESTree.PropertyDefinition | TSESTree.MethodDefinition;
7
+ type TSESTreeJSX = TSESTree.JSXAttribute | TSESTree.JSXChild | TSESTree.JSXClosingElement | TSESTree.JSXClosingFragment | TSESTree.JSXEmptyExpression | TSESTree.JSXIdentifierToken | TSESTree.JSXOpeningElement | TSESTree.JSXOpeningFragment | TSESTree.JSXSpreadAttribute | TSESTree.JSXTagNameExpression | TSESTree.JSXTextToken;
8
+ type TSESTreeJSXElementLike = TSESTree.JSXElement | TSESTree.JSXFragment;
9
+ type TSESTreeJSXAttributeLike = TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute;
10
+ type TSESTreeDirective = TSESTree.ExpressionStatement & {
16
11
  directive: string;
17
12
  expression: TSESTree.StringLiteral;
18
13
  };
19
- type TypeExpression = TSESTree.TSAsExpression | TSESTree.TSTypeAssertion | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSInstantiationExpression;
14
+ type TSESTreeTypeExpression = TSESTree.TSAsExpression | TSESTree.TSTypeAssertion | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSInstantiationExpression;
20
15
  declare namespace check_d_exports {
21
16
  export { directive, identifier, is, isClass, isFunction, isJSX, isJSXElement, isJSXFragment, isJSXLike, isJSXTagNameExpression, isMethodOrProperty, isOneOf, isProperty, isTypeAssertionExpression, isTypeExpression, literal, thisExpression };
22
17
  }
@@ -45,7 +40,7 @@ declare const isJSXTagNameExpression: (node: TSESTree.Node | null | undefined) =
45
40
  declare const isJSX: (node: TSESTree.Node | null | undefined) => node is TSESTree.JSXAttribute | TSESTree.JSXClosingElement | TSESTree.JSXClosingFragment | TSESTree.JSXElement | TSESTree.JSXEmptyExpression | TSESTree.JSXExpressionContainer | TSESTree.JSXFragment | TSESTree.JSXIdentifier | TSESTree.JSXMemberExpression | TSESTree.JSXNamespacedName | TSESTree.JSXOpeningElement | TSESTree.JSXOpeningFragment | TSESTree.JSXSpreadAttribute | TSESTree.JSXSpreadChild | TSESTree.JSXText;
46
41
  declare const isTypeExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion;
47
42
  declare const isTypeAssertionExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSAsExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion;
48
- declare function directive(node: TSESTree.Node): node is Directive;
43
+ declare function directive(node: TSESTree.Node): node is TSESTreeDirective;
49
44
  declare namespace compare_d_exports {
50
45
  export { areEqual };
51
46
  }
@@ -63,31 +58,17 @@ declare const areEqual: {
63
58
  declare namespace extract_d_exports {
64
59
  export { fullyQualifiedName, humanReadableKind, propertyName, rootIdentifier, unwrapped };
65
60
  }
66
- declare function unwrapped(from: TSESTree.Node): Exclude<TSESTree.Node, TypeExpression>;
61
+ declare function unwrapped(from: TSESTree.Node): Exclude<TSESTree.Node, TSESTreeTypeExpression>;
67
62
  declare function rootIdentifier(from: TSESTree.Expression | TSESTree.PrivateIdentifier): TSESTree.Identifier | null;
68
63
  declare function propertyName(from: TSESTree.Node): string | null;
69
64
  declare function fullyQualifiedName(from: TSESTree.Node, using: (node: TSESTree.Node) => string): string;
70
65
  declare function humanReadableKind(of: TSESTree.Node, delimiter?: string): string;
71
- declare namespace select_d_exports {
72
- export { DisplayNameAssignment, displayNameAssignment };
73
- }
74
- type DisplayNameAssignment = TSESTree.AssignmentExpression & {
75
- left: TSESTree.MemberExpression & {
76
- property: TSESTree.Identifier & {
77
- name: "displayName";
78
- };
79
- };
80
- operator: "=";
81
- right: TSESTree.Literal;
82
- };
83
- declare const displayNameAssignment: string;
84
66
  declare namespace traverse_d_exports {
85
- export { NodePredicate, Predicate, findParent, findProperty };
67
+ export { NodePredicate, Predicate, findParent };
86
68
  }
87
69
  type Predicate<T extends TSESTree.Node> = (node: TSESTree.Node) => node is T;
88
70
  type NodePredicate = (node: TSESTree.Node) => boolean;
89
71
  declare function findParent<T extends TSESTree.Node>(of: TSESTree.Node | null, where: Predicate<T>): T | null;
90
72
  declare function findParent(of: TSESTree.Node | null, where: NodePredicate): TSESTree.Node | null;
91
- declare function findProperty(in_: TSESTree.ObjectLiteralElement[], named: string): TSESTree.Property | null;
92
73
  //#endregion
93
- export { check_d_exports as Check, ClassExpression, compare_d_exports as Compare, Directive, Expression, extract_d_exports as Extract, FunctionExpression, Identifier, JSXAttributeLike, JSXElementLike, JSXNode, MethodOrPropertyDefinition, Node, Program, select_d_exports as Select, Statement, traverse_d_exports as Traverse, TypeExpression, is, isOneOf };
74
+ export { check_d_exports as Check, compare_d_exports as Compare, extract_d_exports as Extract, TSESTreeClass, TSESTreeDirective, TSESTreeFunction, TSESTreeJSX, TSESTreeJSXAttributeLike, TSESTreeJSXElementLike, TSESTreeMethodOrPropertyDefinition, TSESTreeTypeExpression, traverse_d_exports as Traverse, is, isOneOf };
package/dist/index.js CHANGED
@@ -310,22 +310,9 @@ const areEqual = dual(2, (a, b) => {
310
310
  }
311
311
  });
312
312
 
313
- //#endregion
314
- //#region src/select.ts
315
- var select_exports = /* @__PURE__ */ __exportAll({ displayNameAssignment: () => displayNameAssignment });
316
- const displayNameAssignment = [
317
- "AssignmentExpression",
318
- "[operator='=']",
319
- "[left.type='MemberExpression']",
320
- "[left.property.name='displayName']"
321
- ].join("");
322
-
323
313
  //#endregion
324
314
  //#region src/traverse.ts
325
- var traverse_exports = /* @__PURE__ */ __exportAll({
326
- findParent: () => findParent,
327
- findProperty: () => findProperty
328
- });
315
+ var traverse_exports = /* @__PURE__ */ __exportAll({ findParent: () => findParent });
329
316
  function findParent(of, where) {
330
317
  if (of == null) return null;
331
318
  let parent = of.parent;
@@ -336,16 +323,6 @@ function findParent(of, where) {
336
323
  }
337
324
  return null;
338
325
  }
339
- function findProperty(in_, named) {
340
- for (const property of in_) {
341
- if (property.type === AST_NODE_TYPES.Property && propertyName(property.key) === named) return property;
342
- if (property.type === AST_NODE_TYPES.SpreadElement && property.argument.type === AST_NODE_TYPES.ObjectExpression) {
343
- const found = findProperty(property.argument.properties, named);
344
- if (found != null) return found;
345
- }
346
- }
347
- return null;
348
- }
349
326
 
350
327
  //#endregion
351
- export { check_exports as Check, compare_exports as Compare, extract_exports as Extract, select_exports as Select, traverse_exports as Traverse, is, isOneOf };
328
+ export { check_exports as Check, compare_exports as Compare, extract_exports as Extract, traverse_exports as Traverse, is, isOneOf };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/ast",
3
- "version": "5.2.2-next.0",
3
+ "version": "5.2.3-beta.1",
4
4
  "description": "ESLint React's TSESTree AST utility module.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -30,13 +30,13 @@
30
30
  "./package.json"
31
31
  ],
32
32
  "dependencies": {
33
- "@typescript-eslint/types": "^8.58.1",
34
- "@typescript-eslint/typescript-estree": "^8.58.1",
35
- "@typescript-eslint/utils": "^8.58.1",
33
+ "@typescript-eslint/types": "^8.58.2",
34
+ "@typescript-eslint/typescript-estree": "^8.58.2",
35
+ "@typescript-eslint/utils": "^8.58.2",
36
36
  "string-ts": "^2.3.1"
37
37
  },
38
38
  "devDependencies": {
39
- "tsdown": "^0.21.7",
39
+ "tsdown": "^0.21.8",
40
40
  "@local/configs": "0.0.0",
41
41
  "@local/eff": "3.0.0-beta.72"
42
42
  },
@@ -51,7 +51,7 @@
51
51
  "@local/eff": "workspace:*"
52
52
  },
53
53
  "scripts": {
54
- "build": "tsdown --dts-resolve",
54
+ "build": "tsdown",
55
55
  "build:docs": "typedoc",
56
56
  "lint:publish": "publint",
57
57
  "lint:ts": "tsl"