@eslint-react/core 5.26.6 → 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
@@ -251,12 +251,6 @@ function isThisSetStateCall(node) {
251
251
  return callee.type === AST_NODE_TYPES.MemberExpression && Extract.unwrap(callee.object).type === AST_NODE_TYPES.ThisExpression && Extract.getCalleeName(node) === "setState";
252
252
  }
253
253
  //#endregion
254
- //#region src/collector-key.ts
255
- let key = 0;
256
- function getNextCollectorKey() {
257
- return String(key++);
258
- }
259
- //#endregion
260
254
  //#region src/class-component-collector.ts
261
255
  function getClassComponentCollector(context) {
262
256
  const components = /* @__PURE__ */ new Map();
@@ -264,7 +258,7 @@ function getClassComponentCollector(context) {
264
258
  const collect = (node) => {
265
259
  if (!isClassComponent(node)) return;
266
260
  const id = getClassId(node);
267
- const key = getNextCollectorKey();
261
+ const key = node.range[0];
268
262
  const name = id == null ? null : Extract.getFullyQualifiedName(id, getText);
269
263
  components.set(key, {
270
264
  id,
@@ -647,7 +641,7 @@ function getFunctionComponentCollector(context, options = {}) {
647
641
  const getText = (n) => context.sourceCode.getText(n);
648
642
  const getCurrentEntry = () => functionEntries.at(-1) ?? null;
649
643
  const onFunctionEnter = (node) => {
650
- const key = getNextCollectorKey();
644
+ const key = node.range[0];
651
645
  const exp = Traverse.findParent(node, (n) => n.type === AST_NODE_TYPES.ExportDefaultDeclaration);
652
646
  const isExportDefault = exp != null;
653
647
  const isExportDefaultDeclaration = exp != null && Extract.unwrap(exp.declaration) === node;
@@ -744,7 +738,7 @@ function getHookCollector(context) {
744
738
  const id = getFunctionId(node);
745
739
  const entry = {
746
740
  id,
747
- key: getNextCollectorKey(),
741
+ key: node.range[0],
748
742
  kind: "hook",
749
743
  name: id == null ? null : Extract.getFullyQualifiedName(id, getText),
750
744
  directives: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/core",
3
- "version": "5.26.6",
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,10 +29,10 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@eslint-react/ast": "5.26.6",
33
- "@eslint-react/eslint": "5.26.6",
34
- "@eslint-react/shared": "5.26.6",
35
- "@eslint-react/var": "5.26.6",
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
38
  "ts-pattern": "^5.9.2"