@eslint-react/core 3.0.0-next.58 → 3.0.0-next.59

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
@@ -132,12 +132,12 @@ interface SemanticNode {
132
132
  kind: string;
133
133
  /** The name of the node */
134
134
  name: unit | string;
135
- /** The AST node */
136
- node: TSESTree.Node;
137
135
  /** The flag of the node */
138
136
  flag: bigint;
139
137
  /** The hint of the node */
140
138
  hint: bigint;
139
+ /** The AST node */
140
+ node: TSESTree.Node;
141
141
  }
142
142
  //#endregion
143
143
  //#region src/semantic/semantic-func.d.ts
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { findImportSource, findProperty, findVariable, getVariableInitializer } from "@eslint-react/var";
1
+ import { findImportSource, findVariable, getVariableInitializer } from "@eslint-react/var";
2
2
  import * as ast from "@eslint-react/ast";
3
3
  import { constFalse, constTrue, dual, flip, getOrElseUpdate, identity, unit } from "@eslint-react/eff";
4
4
  import { AST_NODE_TYPES } from "@typescript-eslint/types";
@@ -284,11 +284,11 @@ function useHookCollector(context) {
284
284
  key,
285
285
  kind: "function",
286
286
  name: ast.getFullyQualifiedName(id, getText),
287
- node,
288
287
  directives: [],
289
288
  flag: 0n,
290
289
  hint: 0n,
291
- hookCalls: []
290
+ hookCalls: [],
291
+ node
292
292
  });
293
293
  };
294
294
  const onFunctionExit = () => {
@@ -370,10 +370,10 @@ function getJsxAttribute(context, node, initialScope) {
370
370
  switch (attr.argument.type) {
371
371
  case AST_NODE_TYPES.Identifier: {
372
372
  const initNode = getVariableInitializer(findVariable(attr.argument.name, scope), 0);
373
- if (initNode?.type === AST_NODE_TYPES.ObjectExpression) return findProperty(name, initNode.properties, scope) != null;
373
+ if (initNode?.type === AST_NODE_TYPES.ObjectExpression) return ast.findProperty(initNode.properties, name) != null;
374
374
  return false;
375
375
  }
376
- case AST_NODE_TYPES.ObjectExpression: return findProperty(name, attr.argument.properties, scope) != null;
376
+ case AST_NODE_TYPES.ObjectExpression: return ast.findProperty(attr.argument.properties, name) != null;
377
377
  }
378
378
  return false;
379
379
  });
@@ -1007,7 +1007,6 @@ function useComponentCollector(context, options = {}) {
1007
1007
  key,
1008
1008
  kind: "function-component",
1009
1009
  name,
1010
- node,
1011
1010
  directives,
1012
1011
  displayName: unit,
1013
1012
  flag: getComponentFlagFromInitPath(initPath),
@@ -1017,6 +1016,7 @@ function useComponentCollector(context, options = {}) {
1017
1016
  isComponentDefinition: isComponentDefinition(context, node, hint),
1018
1017
  isExportDefault,
1019
1018
  isExportDefaultDeclaration,
1019
+ node,
1020
1020
  rets: []
1021
1021
  };
1022
1022
  functionEntries.push(entry);
@@ -1103,11 +1103,11 @@ function useComponentCollectorLegacy(context) {
1103
1103
  key,
1104
1104
  kind: "class-component",
1105
1105
  name,
1106
- node,
1107
1106
  displayName: unit,
1108
1107
  flag,
1109
1108
  hint: 0n,
1110
- methods: []
1109
+ methods: [],
1110
+ node
1111
1111
  });
1112
1112
  };
1113
1113
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/core",
3
- "version": "3.0.0-next.58",
3
+ "version": "3.0.0-next.59",
4
4
  "description": "ESLint React's ESLint utility module for static analysis of React core APIs and patterns.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -34,10 +34,10 @@
34
34
  "@typescript-eslint/types": "canary",
35
35
  "@typescript-eslint/utils": "canary",
36
36
  "ts-pattern": "^5.9.0",
37
- "@eslint-react/ast": "3.0.0-next.58",
38
- "@eslint-react/eff": "3.0.0-next.58",
39
- "@eslint-react/shared": "3.0.0-next.58",
40
- "@eslint-react/var": "3.0.0-next.58"
37
+ "@eslint-react/ast": "3.0.0-next.59",
38
+ "@eslint-react/eff": "3.0.0-next.59",
39
+ "@eslint-react/var": "3.0.0-next.59",
40
+ "@eslint-react/shared": "3.0.0-next.59"
41
41
  },
42
42
  "devDependencies": {
43
43
  "tsdown": "^0.21.0-beta.2",