eslint-plugin-react-x 2.6.0-beta.0 → 2.6.1-next.0

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -6
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ var __exportAll = (all, symbols) => {
34
34
  //#endregion
35
35
  //#region package.json
36
36
  var name$6 = "eslint-plugin-react-x";
37
- var version = "2.6.0-beta.0";
37
+ var version = "2.6.1-next.0";
38
38
 
39
39
  //#endregion
40
40
  //#region src/utils/create-rule.ts
@@ -2319,13 +2319,13 @@ function create$16(context) {
2319
2319
  return { VariableDeclarator(node) {
2320
2320
  const { id, init } = node;
2321
2321
  if (id.type !== AST_NODE_TYPES.Identifier || init == null || !isUseRefCall(init)) return;
2322
- const variable = context.sourceCode.getDeclaredVariables(node).at(0);
2323
- if (variable == null) return;
2322
+ const [ref, ...rest] = context.sourceCode.getDeclaredVariables(node);
2323
+ if (ref == null || rest.length > 0) return;
2324
2324
  const effects = /* @__PURE__ */ new Set();
2325
2325
  let globalUsages = 0;
2326
- for (const ref of variable.references) {
2327
- if (ref.init != null) continue;
2328
- const effect = AST.findParentNode(ref.identifier, isUseEffectLikeCall);
2326
+ for (const { identifier, init: init$1 } of ref.references) {
2327
+ if (init$1 != null) continue;
2328
+ const effect = AST.findParentNode(identifier, isUseEffectLikeCall);
2329
2329
  if (effect == null) globalUsages++;
2330
2330
  else effects.add(effect);
2331
2331
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "2.6.0-beta.0",
3
+ "version": "2.6.1-next.0",
4
4
  "description": "A set of composable ESLint rules for for libraries and frameworks that use React as a UI runtime.",
5
5
  "keywords": [
6
6
  "react",
@@ -46,11 +46,11 @@
46
46
  "string-ts": "^2.3.1",
47
47
  "ts-api-utils": "^2.4.0",
48
48
  "ts-pattern": "^5.9.0",
49
- "@eslint-react/ast": "2.6.0-beta.0",
50
- "@eslint-react/core": "2.6.0-beta.0",
51
- "@eslint-react/eff": "2.6.0-beta.0",
52
- "@eslint-react/shared": "2.6.0-beta.0",
53
- "@eslint-react/var": "2.6.0-beta.0"
49
+ "@eslint-react/ast": "2.6.1-next.0",
50
+ "@eslint-react/core": "2.6.1-next.0",
51
+ "@eslint-react/eff": "2.6.1-next.0",
52
+ "@eslint-react/shared": "2.6.1-next.0",
53
+ "@eslint-react/var": "2.6.1-next.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/react": "^19.2.8",