eslint-plugin-react-hooks-extra 1.5.11-next.9 → 1.5.12-next.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.
Files changed (3) hide show
  1. package/dist/index.js +28 -33
  2. package/dist/index.mjs +29 -34
  3. package/package.json +11 -10
package/dist/index.js CHANGED
@@ -4,8 +4,8 @@ var core = require('@eslint-react/core');
4
4
  require('string-ts');
5
5
  var shared = require('@eslint-react/shared');
6
6
  var ast = require('@eslint-react/ast');
7
- var jsx = require('@eslint-react/jsx');
8
7
  var _var = require('@eslint-react/var');
8
+ var valibot = require('valibot');
9
9
 
10
10
  var __defProp = Object.defineProperty;
11
11
  var __export = (target, all2) => {
@@ -15,7 +15,7 @@ var __export = (target, all2) => {
15
15
 
16
16
  // package.json
17
17
  var name = "eslint-plugin-react-hooks-extra";
18
- var version = "1.5.11-next.9";
18
+ var version = "1.5.12-next.1";
19
19
  var createRule = shared.createRuleForPlugin("hooks-extra");
20
20
 
21
21
  // src/rules/ensure-custom-hooks-using-other-hooks.ts
@@ -56,7 +56,7 @@ var ensure_custom_hooks_using_other_hooks_default = createRule({
56
56
  defaultOptions: []
57
57
  });
58
58
 
59
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Function.js
59
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Function.js
60
60
  var Function_exports = {};
61
61
  __export(Function_exports, {
62
62
  SK: () => SK,
@@ -231,10 +231,10 @@ function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
231
231
  var hole = /* @__PURE__ */ unsafeCoerce(absurd);
232
232
  var SK = (_2, b2) => b2;
233
233
 
234
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Equivalence.js
234
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Equivalence.js
235
235
  var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
236
236
 
237
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/doNotation.js
237
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/internal/doNotation.js
238
238
  var let_ = (map2) => dual(3, (self, name2, f) => map2(self, (a) => Object.assign({}, a, {
239
239
  [name2]: f(a)
240
240
  })));
@@ -245,11 +245,11 @@ var bind = (map2, flatMap2) => dual(3, (self, name2, f) => flatMap2(self, (a) =>
245
245
  [name2]: b2
246
246
  }))));
247
247
 
248
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/version.js
249
- var moduleVersion = "3.1.2";
248
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/internal/version.js
249
+ var moduleVersion = "3.1.3";
250
250
  var getCurrentVersion = () => moduleVersion;
251
251
 
252
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/GlobalValue.js
252
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/GlobalValue.js
253
253
  var globalStoreId = /* @__PURE__ */ Symbol.for(`effect/GlobalValue/globalStoreId/${/* @__PURE__ */ getCurrentVersion()}`);
254
254
  if (!(globalStoreId in globalThis)) {
255
255
  globalThis[globalStoreId] = /* @__PURE__ */ new Map();
@@ -262,17 +262,17 @@ var globalValue = (id, compute) => {
262
262
  return globalStore.get(id);
263
263
  };
264
264
 
265
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Predicate.js
265
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Predicate.js
266
266
  var isFunction2 = isFunction;
267
267
  var isRecordOrArray = (input) => typeof input === "object" && input !== null;
268
268
  var isObject = (input) => isRecordOrArray(input) || isFunction2(input);
269
269
  var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObject(self) && property in self);
270
270
  var isNullable = (input) => input === null || input === void 0;
271
271
 
272
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/errors.js
272
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/internal/errors.js
273
273
  var getBugErrorMessage = (message) => `BUG: ${message} - please report an issue at https://github.com/Effect-TS/effect/issues`;
274
274
 
275
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Utils.js
275
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Utils.js
276
276
  var GenKindTypeId = /* @__PURE__ */ Symbol.for("effect/Gen/GenKind");
277
277
  var isGenKind = (u2) => isObject(u2) && GenKindTypeId in u2;
278
278
  var GenKindImpl = class {
@@ -516,7 +516,7 @@ var structuralRegionState = /* @__PURE__ */ globalValue("effect/Utils/isStructur
516
516
  tester: void 0
517
517
  }));
518
518
 
519
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Hash.js
519
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Hash.js
520
520
  var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => /* @__PURE__ */ new WeakMap());
521
521
  var pcgr = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/pcgr"), () => new PCGRandom());
522
522
  var symbol = /* @__PURE__ */ Symbol.for("effect/Hash");
@@ -617,7 +617,7 @@ var cached = function() {
617
617
  return hash2;
618
618
  };
619
619
 
620
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Equal.js
620
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Equal.js
621
621
  var symbol2 = /* @__PURE__ */ Symbol.for("effect/Equal");
622
622
  function equals() {
623
623
  if (arguments.length === 1) {
@@ -663,7 +663,7 @@ function compareBoth(self, that) {
663
663
  var isEqual = (u2) => hasProperty(u2, symbol2);
664
664
  var equivalence = () => equals;
665
665
 
666
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Inspectable.js
666
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Inspectable.js
667
667
  var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
668
668
  var toJSON = (x2) => {
669
669
  if (hasProperty(x2, "toJSON") && isFunction2(x2["toJSON"]) && x2["toJSON"].length === 0) {
@@ -675,7 +675,7 @@ var toJSON = (x2) => {
675
675
  };
676
676
  var format = (x2) => JSON.stringify(x2, null, 2);
677
677
 
678
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Pipeable.js
678
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Pipeable.js
679
679
  var pipeArguments = (self, args) => {
680
680
  switch (args.length) {
681
681
  case 1:
@@ -706,7 +706,7 @@ var pipeArguments = (self, args) => {
706
706
  }
707
707
  };
708
708
 
709
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/effectable.js
709
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/internal/effectable.js
710
710
  var EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
711
711
  var StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
712
712
  var SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
@@ -767,7 +767,7 @@ var EffectPrototype = {
767
767
  }
768
768
  };
769
769
 
770
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/option.js
770
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/internal/option.js
771
771
  var TypeId = /* @__PURE__ */ Symbol.for("effect/Option");
772
772
  var CommonProto = {
773
773
  ...EffectPrototype,
@@ -825,7 +825,7 @@ var some = (value) => {
825
825
  return a;
826
826
  };
827
827
 
828
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/either.js
828
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/internal/either.js
829
829
  var TypeId2 = /* @__PURE__ */ Symbol.for("effect/Either");
830
830
  var CommonProto2 = {
831
831
  ...EffectPrototype,
@@ -889,7 +889,7 @@ var right = (right2) => {
889
889
  var getLeft = (self) => isRight(self) ? none : some(self.left);
890
890
  var getRight = (self) => isLeft(self) ? none : some(self.right);
891
891
 
892
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Option.js
892
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Option.js
893
893
  var Option_exports = {};
894
894
  __export(Option_exports, {
895
895
  Do: () => Do,
@@ -951,10 +951,10 @@ __export(Option_exports, {
951
951
  zipWith: () => zipWith
952
952
  });
953
953
 
954
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Order.js
954
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Order.js
955
955
  var make2 = (compare) => (self, that) => self === that ? 0 : compare(self, that);
956
956
 
957
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Option.js
957
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Option.js
958
958
  var TypeId3 = /* @__PURE__ */ Symbol.for("effect/Option");
959
959
  var none2 = () => none;
960
960
  var some2 = some;
@@ -1298,8 +1298,6 @@ var z = class _z {
1298
1298
  return this;
1299
1299
  }
1300
1300
  };
1301
-
1302
- // src/rules/ensure-use-callback-has-non-empty-deps.ts
1303
1301
  var RULE_NAME2 = "ensure-use-callback-has-non-empty-deps";
1304
1302
  var ensure_use_callback_has_non_empty_deps_default = createRule({
1305
1303
  meta: {
@@ -1315,14 +1313,13 @@ var ensure_use_callback_has_non_empty_deps_default = createRule({
1315
1313
  },
1316
1314
  name: RULE_NAME2,
1317
1315
  create(context) {
1318
- const alias = shared.parseSchema(shared.ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useCallback ?? [];
1319
- const pragma = jsx.getPragmaFromContext(context);
1316
+ const alias = valibot.parse(shared.ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useCallback ?? [];
1320
1317
  return {
1321
1318
  CallExpression(node) {
1322
1319
  const initialScope = context.sourceCode.getScope(node);
1323
1320
  if (!core.isReactHookCall(node))
1324
1321
  return;
1325
- if (!core.isUseCallbackCall(node, context, pragma) && !alias.some(Function_exports.flip(core.isReactHookCallWithNameLoose)(node))) {
1322
+ if (!core.isUseCallbackCall(node, context) && !alias.some(Function_exports.flip(core.isReactHookCallWithNameLoose)(node))) {
1326
1323
  return;
1327
1324
  }
1328
1325
  const [_2, deps] = node.arguments;
@@ -1368,14 +1365,13 @@ var ensure_use_memo_has_non_empty_deps_default = createRule({
1368
1365
  },
1369
1366
  name: RULE_NAME3,
1370
1367
  create(context) {
1371
- const alias = shared.parseSchema(shared.ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useMemo ?? [];
1372
- const pragma = jsx.getPragmaFromContext(context);
1368
+ const alias = valibot.parse(shared.ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useMemo ?? [];
1373
1369
  return {
1374
1370
  CallExpression(node) {
1375
1371
  const initialScope = context.sourceCode.getScope(node);
1376
1372
  if (!core.isReactHookCall(node))
1377
1373
  return;
1378
- if (!core.isUseMemoCall(node, context, pragma) && !alias.some(Function_exports.flip(core.isReactHookCallWithNameLoose)(node)))
1374
+ if (!core.isUseMemoCall(node, context) && !alias.some(Function_exports.flip(core.isReactHookCallWithNameLoose)(node)))
1379
1375
  return;
1380
1376
  const [_2, deps] = node.arguments;
1381
1377
  if (!deps) {
@@ -1406,7 +1402,7 @@ var ensure_use_memo_has_non_empty_deps_default = createRule({
1406
1402
  defaultOptions: []
1407
1403
  });
1408
1404
  var RULE_NAME4 = "prefer-use-state-lazy-initialization";
1409
- var ALLOW_LIST = Object.freeze(["Boolean", "String", "Number"]);
1405
+ var ALLOW_LIST = ["Boolean", "String", "Number"];
1410
1406
  var prefer_use_state_lazy_initialization_default = createRule({
1411
1407
  meta: {
1412
1408
  type: "problem",
@@ -1421,13 +1417,12 @@ var prefer_use_state_lazy_initialization_default = createRule({
1421
1417
  },
1422
1418
  name: RULE_NAME4,
1423
1419
  create(context) {
1424
- const alias = shared.parseSchema(shared.ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useState ?? [];
1425
- const pragma = jsx.getPragmaFromContext(context);
1420
+ const alias = valibot.parse(shared.ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useState ?? [];
1426
1421
  return {
1427
1422
  CallExpression(node) {
1428
1423
  if (!core.isReactHookCall(node))
1429
1424
  return;
1430
- if (!core.isUseStateCall(node, context, pragma) && !alias.some(Function_exports.flip(core.isReactHookCallWithNameLoose)(node)))
1425
+ if (!core.isUseStateCall(node, context) && !alias.some(Function_exports.flip(core.isReactHookCallWithNameLoose)(node)))
1431
1426
  return;
1432
1427
  const [useStateInput] = node.arguments;
1433
1428
  if (!useStateInput)
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import { useHookCollector, isReactHookCall, isUseCallbackCall, isReactHookCallWithNameLoose, isUseMemoCall, isUseStateCall } from '@eslint-react/core';
2
2
  import 'string-ts';
3
- import { createRuleForPlugin, parseSchema, ESLintSettingsSchema } from '@eslint-react/shared';
3
+ import { createRuleForPlugin, ESLintSettingsSchema } from '@eslint-react/shared';
4
4
  import { NodeType, is, getNestedCallExpressions } from '@eslint-react/ast';
5
- import { getPragmaFromContext } from '@eslint-react/jsx';
6
5
  import { findVariable, getVariableInit } from '@eslint-react/var';
6
+ import { parse } from 'valibot';
7
7
 
8
8
  var __defProp = Object.defineProperty;
9
9
  var __export = (target, all2) => {
@@ -13,7 +13,7 @@ var __export = (target, all2) => {
13
13
 
14
14
  // package.json
15
15
  var name = "eslint-plugin-react-hooks-extra";
16
- var version = "1.5.11-next.9";
16
+ var version = "1.5.12-next.1";
17
17
  var createRule = createRuleForPlugin("hooks-extra");
18
18
 
19
19
  // src/rules/ensure-custom-hooks-using-other-hooks.ts
@@ -54,7 +54,7 @@ var ensure_custom_hooks_using_other_hooks_default = createRule({
54
54
  defaultOptions: []
55
55
  });
56
56
 
57
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Function.js
57
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Function.js
58
58
  var Function_exports = {};
59
59
  __export(Function_exports, {
60
60
  SK: () => SK,
@@ -229,10 +229,10 @@ function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
229
229
  var hole = /* @__PURE__ */ unsafeCoerce(absurd);
230
230
  var SK = (_2, b2) => b2;
231
231
 
232
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Equivalence.js
232
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Equivalence.js
233
233
  var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
234
234
 
235
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/doNotation.js
235
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/internal/doNotation.js
236
236
  var let_ = (map2) => dual(3, (self, name2, f) => map2(self, (a) => Object.assign({}, a, {
237
237
  [name2]: f(a)
238
238
  })));
@@ -243,11 +243,11 @@ var bind = (map2, flatMap2) => dual(3, (self, name2, f) => flatMap2(self, (a) =>
243
243
  [name2]: b2
244
244
  }))));
245
245
 
246
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/version.js
247
- var moduleVersion = "3.1.2";
246
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/internal/version.js
247
+ var moduleVersion = "3.1.3";
248
248
  var getCurrentVersion = () => moduleVersion;
249
249
 
250
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/GlobalValue.js
250
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/GlobalValue.js
251
251
  var globalStoreId = /* @__PURE__ */ Symbol.for(`effect/GlobalValue/globalStoreId/${/* @__PURE__ */ getCurrentVersion()}`);
252
252
  if (!(globalStoreId in globalThis)) {
253
253
  globalThis[globalStoreId] = /* @__PURE__ */ new Map();
@@ -260,17 +260,17 @@ var globalValue = (id, compute) => {
260
260
  return globalStore.get(id);
261
261
  };
262
262
 
263
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Predicate.js
263
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Predicate.js
264
264
  var isFunction2 = isFunction;
265
265
  var isRecordOrArray = (input) => typeof input === "object" && input !== null;
266
266
  var isObject = (input) => isRecordOrArray(input) || isFunction2(input);
267
267
  var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObject(self) && property in self);
268
268
  var isNullable = (input) => input === null || input === void 0;
269
269
 
270
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/errors.js
270
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/internal/errors.js
271
271
  var getBugErrorMessage = (message) => `BUG: ${message} - please report an issue at https://github.com/Effect-TS/effect/issues`;
272
272
 
273
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Utils.js
273
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Utils.js
274
274
  var GenKindTypeId = /* @__PURE__ */ Symbol.for("effect/Gen/GenKind");
275
275
  var isGenKind = (u2) => isObject(u2) && GenKindTypeId in u2;
276
276
  var GenKindImpl = class {
@@ -514,7 +514,7 @@ var structuralRegionState = /* @__PURE__ */ globalValue("effect/Utils/isStructur
514
514
  tester: void 0
515
515
  }));
516
516
 
517
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Hash.js
517
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Hash.js
518
518
  var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => /* @__PURE__ */ new WeakMap());
519
519
  var pcgr = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/pcgr"), () => new PCGRandom());
520
520
  var symbol = /* @__PURE__ */ Symbol.for("effect/Hash");
@@ -615,7 +615,7 @@ var cached = function() {
615
615
  return hash2;
616
616
  };
617
617
 
618
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Equal.js
618
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Equal.js
619
619
  var symbol2 = /* @__PURE__ */ Symbol.for("effect/Equal");
620
620
  function equals() {
621
621
  if (arguments.length === 1) {
@@ -661,7 +661,7 @@ function compareBoth(self, that) {
661
661
  var isEqual = (u2) => hasProperty(u2, symbol2);
662
662
  var equivalence = () => equals;
663
663
 
664
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Inspectable.js
664
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Inspectable.js
665
665
  var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
666
666
  var toJSON = (x2) => {
667
667
  if (hasProperty(x2, "toJSON") && isFunction2(x2["toJSON"]) && x2["toJSON"].length === 0) {
@@ -673,7 +673,7 @@ var toJSON = (x2) => {
673
673
  };
674
674
  var format = (x2) => JSON.stringify(x2, null, 2);
675
675
 
676
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Pipeable.js
676
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Pipeable.js
677
677
  var pipeArguments = (self, args) => {
678
678
  switch (args.length) {
679
679
  case 1:
@@ -704,7 +704,7 @@ var pipeArguments = (self, args) => {
704
704
  }
705
705
  };
706
706
 
707
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/effectable.js
707
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/internal/effectable.js
708
708
  var EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
709
709
  var StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
710
710
  var SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
@@ -765,7 +765,7 @@ var EffectPrototype = {
765
765
  }
766
766
  };
767
767
 
768
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/option.js
768
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/internal/option.js
769
769
  var TypeId = /* @__PURE__ */ Symbol.for("effect/Option");
770
770
  var CommonProto = {
771
771
  ...EffectPrototype,
@@ -823,7 +823,7 @@ var some = (value) => {
823
823
  return a;
824
824
  };
825
825
 
826
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/either.js
826
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/internal/either.js
827
827
  var TypeId2 = /* @__PURE__ */ Symbol.for("effect/Either");
828
828
  var CommonProto2 = {
829
829
  ...EffectPrototype,
@@ -887,7 +887,7 @@ var right = (right2) => {
887
887
  var getLeft = (self) => isRight(self) ? none : some(self.left);
888
888
  var getRight = (self) => isLeft(self) ? none : some(self.right);
889
889
 
890
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Option.js
890
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Option.js
891
891
  var Option_exports = {};
892
892
  __export(Option_exports, {
893
893
  Do: () => Do,
@@ -949,10 +949,10 @@ __export(Option_exports, {
949
949
  zipWith: () => zipWith
950
950
  });
951
951
 
952
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Order.js
952
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Order.js
953
953
  var make2 = (compare) => (self, that) => self === that ? 0 : compare(self, that);
954
954
 
955
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Option.js
955
+ // ../../../node_modules/.pnpm/effect@3.1.3/node_modules/effect/dist/esm/Option.js
956
956
  var TypeId3 = /* @__PURE__ */ Symbol.for("effect/Option");
957
957
  var none2 = () => none;
958
958
  var some2 = some;
@@ -1296,8 +1296,6 @@ var z = class _z {
1296
1296
  return this;
1297
1297
  }
1298
1298
  };
1299
-
1300
- // src/rules/ensure-use-callback-has-non-empty-deps.ts
1301
1299
  var RULE_NAME2 = "ensure-use-callback-has-non-empty-deps";
1302
1300
  var ensure_use_callback_has_non_empty_deps_default = createRule({
1303
1301
  meta: {
@@ -1313,14 +1311,13 @@ var ensure_use_callback_has_non_empty_deps_default = createRule({
1313
1311
  },
1314
1312
  name: RULE_NAME2,
1315
1313
  create(context) {
1316
- const alias = parseSchema(ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useCallback ?? [];
1317
- const pragma = getPragmaFromContext(context);
1314
+ const alias = parse(ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useCallback ?? [];
1318
1315
  return {
1319
1316
  CallExpression(node) {
1320
1317
  const initialScope = context.sourceCode.getScope(node);
1321
1318
  if (!isReactHookCall(node))
1322
1319
  return;
1323
- if (!isUseCallbackCall(node, context, pragma) && !alias.some(Function_exports.flip(isReactHookCallWithNameLoose)(node))) {
1320
+ if (!isUseCallbackCall(node, context) && !alias.some(Function_exports.flip(isReactHookCallWithNameLoose)(node))) {
1324
1321
  return;
1325
1322
  }
1326
1323
  const [_2, deps] = node.arguments;
@@ -1366,14 +1363,13 @@ var ensure_use_memo_has_non_empty_deps_default = createRule({
1366
1363
  },
1367
1364
  name: RULE_NAME3,
1368
1365
  create(context) {
1369
- const alias = parseSchema(ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useMemo ?? [];
1370
- const pragma = getPragmaFromContext(context);
1366
+ const alias = parse(ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useMemo ?? [];
1371
1367
  return {
1372
1368
  CallExpression(node) {
1373
1369
  const initialScope = context.sourceCode.getScope(node);
1374
1370
  if (!isReactHookCall(node))
1375
1371
  return;
1376
- if (!isUseMemoCall(node, context, pragma) && !alias.some(Function_exports.flip(isReactHookCallWithNameLoose)(node)))
1372
+ if (!isUseMemoCall(node, context) && !alias.some(Function_exports.flip(isReactHookCallWithNameLoose)(node)))
1377
1373
  return;
1378
1374
  const [_2, deps] = node.arguments;
1379
1375
  if (!deps) {
@@ -1404,7 +1400,7 @@ var ensure_use_memo_has_non_empty_deps_default = createRule({
1404
1400
  defaultOptions: []
1405
1401
  });
1406
1402
  var RULE_NAME4 = "prefer-use-state-lazy-initialization";
1407
- var ALLOW_LIST = Object.freeze(["Boolean", "String", "Number"]);
1403
+ var ALLOW_LIST = ["Boolean", "String", "Number"];
1408
1404
  var prefer_use_state_lazy_initialization_default = createRule({
1409
1405
  meta: {
1410
1406
  type: "problem",
@@ -1419,13 +1415,12 @@ var prefer_use_state_lazy_initialization_default = createRule({
1419
1415
  },
1420
1416
  name: RULE_NAME4,
1421
1417
  create(context) {
1422
- const alias = parseSchema(ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useState ?? [];
1423
- const pragma = getPragmaFromContext(context);
1418
+ const alias = parse(ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useState ?? [];
1424
1419
  return {
1425
1420
  CallExpression(node) {
1426
1421
  if (!isReactHookCall(node))
1427
1422
  return;
1428
- if (!isUseStateCall(node, context, pragma) && !alias.some(Function_exports.flip(isReactHookCallWithNameLoose)(node)))
1423
+ if (!isUseStateCall(node, context) && !alias.some(Function_exports.flip(isReactHookCallWithNameLoose)(node)))
1429
1424
  return;
1430
1425
  const [useStateInput] = node.arguments;
1431
1426
  if (!useStateInput)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-hooks-extra",
3
- "version": "1.5.11-next.9",
3
+ "version": "1.5.12-next.1",
4
4
  "description": "ESLint React's ESLint plugin for React Hooks related rules.",
5
5
  "homepage": "https://github.com/rel1cx/eslint-react",
6
6
  "bugs": {
@@ -41,20 +41,21 @@
41
41
  "@typescript-eslint/types": "^7.8.0",
42
42
  "@typescript-eslint/utils": "^7.8.0",
43
43
  "string-ts": "2.1.1",
44
- "@eslint-react/ast": "1.5.11-next.9",
45
- "@eslint-react/jsx": "1.5.11-next.9",
46
- "@eslint-react/shared": "1.5.11-next.9",
47
- "@eslint-react/types": "1.5.11-next.9",
48
- "@eslint-react/tools": "1.5.11-next.9",
49
- "@eslint-react/var": "1.5.11-next.9",
50
- "@eslint-react/core": "1.5.11-next.9"
44
+ "valibot": "0.30.0",
45
+ "@eslint-react/ast": "1.5.12-next.1",
46
+ "@eslint-react/jsx": "1.5.12-next.1",
47
+ "@eslint-react/core": "1.5.12-next.1",
48
+ "@eslint-react/tools": "1.5.12-next.1",
49
+ "@eslint-react/shared": "1.5.12-next.1",
50
+ "@eslint-react/types": "1.5.12-next.1",
51
+ "@eslint-react/var": "1.5.12-next.1"
51
52
  },
52
53
  "devDependencies": {
53
- "effect": "3.1.2"
54
+ "effect": "3.1.3"
54
55
  },
55
56
  "peerDependencies": {
56
57
  "@typescript-eslint/parser": "^7.5.0",
57
- "eslint": "^9.1.0",
58
+ "eslint": "^8.57.0",
58
59
  "typescript": "^5.3.3"
59
60
  },
60
61
  "engines": {