@eslint-react/core 5.26.5 → 5.26.7

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
@@ -177,7 +177,7 @@ export interface SemanticNode {
177
177
  /** The identifier of the node. */
178
178
  id: null | TSESTree.Node;
179
179
  /** The unique key of the node. */
180
- key: string;
180
+ key: number;
181
181
  /** The kind of the node. */
182
182
  kind: string;
183
183
  /** The name of the node. */
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { Check, Extract, Traverse } from "@eslint-react/ast";
2
2
  import { AST_NODE_TYPES } from "@typescript-eslint/types";
3
- import { randomBytes } from "node:crypto";
4
3
  import { RE_ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME, RE_COMPONENT_NAME, RE_COMPONENT_NAME_LOOSE } from "@eslint-react/shared";
5
4
  import { resolve } from "@eslint-react/var";
6
5
  import { P, isMatching, match } from "ts-pattern";
@@ -259,7 +258,7 @@ function getClassComponentCollector(context) {
259
258
  const collect = (node) => {
260
259
  if (!isClassComponent(node)) return;
261
260
  const id = getClassId(node);
262
- const key = randomBytes(8).toString("hex");
261
+ const key = node.range[0];
263
262
  const name = id == null ? null : Extract.getFullyQualifiedName(id, getText);
264
263
  components.set(key, {
265
264
  id,
@@ -642,7 +641,7 @@ function getFunctionComponentCollector(context, options = {}) {
642
641
  const getText = (n) => context.sourceCode.getText(n);
643
642
  const getCurrentEntry = () => functionEntries.at(-1) ?? null;
644
643
  const onFunctionEnter = (node) => {
645
- const key = randomBytes(8).toString("hex");
644
+ const key = node.range[0];
646
645
  const exp = Traverse.findParent(node, (n) => n.type === AST_NODE_TYPES.ExportDefaultDeclaration);
647
646
  const isExportDefault = exp != null;
648
647
  const isExportDefaultDeclaration = exp != null && Extract.unwrap(exp.declaration) === node;
@@ -739,7 +738,7 @@ function getHookCollector(context) {
739
738
  const id = getFunctionId(node);
740
739
  const entry = {
741
740
  id,
742
- key: randomBytes(8).toString("hex"),
741
+ key: node.range[0],
743
742
  kind: "hook",
744
743
  name: id == null ? null : Extract.getFullyQualifiedName(id, getText),
745
744
  directives: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/core",
3
- "version": "5.26.5",
3
+ "version": "5.26.7",
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": {
@@ -29,13 +29,13 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@eslint-react/ast": "5.26.5",
33
- "@eslint-react/eslint": "5.26.5",
34
- "@eslint-react/shared": "5.26.5",
35
- "@eslint-react/var": "5.26.5",
32
+ "@eslint-react/ast": "5.26.7",
33
+ "@eslint-react/eslint": "5.26.7",
34
+ "@eslint-react/shared": "5.26.7",
35
+ "@eslint-react/var": "5.26.7",
36
36
  "@typescript-eslint/types": "^8.71.2",
37
37
  "@typescript-eslint/utils": "^8.71.2",
38
- "ts-pattern": "^5.9.0"
38
+ "ts-pattern": "^5.9.2"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@local/configs": "0.0.0",