eslint-plugin-react-hooks-extra 1.5.14 → 1.5.15-beta.2
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.js +40 -52
- package/dist/index.mjs +40 -52
- package/package.json +17 -17
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __export = (target, all2) => {
|
|
|
14
14
|
|
|
15
15
|
// package.json
|
|
16
16
|
var name = "eslint-plugin-react-hooks-extra";
|
|
17
|
-
var version = "1.5.
|
|
17
|
+
var version = "1.5.15-beta.2";
|
|
18
18
|
var createRule = shared.createRuleForPlugin("hooks-extra");
|
|
19
19
|
|
|
20
20
|
// src/rules/ensure-custom-hooks-using-other-hooks.ts
|
|
@@ -39,8 +39,7 @@ var ensure_custom_hooks_using_other_hooks_default = createRule({
|
|
|
39
39
|
"Program:exit"(node) {
|
|
40
40
|
const allHooks = ctx.getAllHooks(node);
|
|
41
41
|
for (const { name: name2, hookCalls, node: node2 } of allHooks.values()) {
|
|
42
|
-
if (hookCalls.length > 0)
|
|
43
|
-
continue;
|
|
42
|
+
if (hookCalls.length > 0) continue;
|
|
44
43
|
context.report({
|
|
45
44
|
data: {
|
|
46
45
|
name: name2.value
|
|
@@ -55,7 +54,7 @@ var ensure_custom_hooks_using_other_hooks_default = createRule({
|
|
|
55
54
|
defaultOptions: []
|
|
56
55
|
});
|
|
57
56
|
|
|
58
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
57
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Function.js
|
|
59
58
|
var Function_exports = {};
|
|
60
59
|
__export(Function_exports, {
|
|
61
60
|
SK: () => SK,
|
|
@@ -230,10 +229,10 @@ function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
|
|
|
230
229
|
var hole = /* @__PURE__ */ unsafeCoerce(absurd);
|
|
231
230
|
var SK = (_2, b2) => b2;
|
|
232
231
|
|
|
233
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
232
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Equivalence.js
|
|
234
233
|
var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
|
|
235
234
|
|
|
236
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
235
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/internal/doNotation.js
|
|
237
236
|
var let_ = (map2) => dual(3, (self, name2, f) => map2(self, (a) => Object.assign({}, a, {
|
|
238
237
|
[name2]: f(a)
|
|
239
238
|
})));
|
|
@@ -244,11 +243,11 @@ var bind = (map2, flatMap2) => dual(3, (self, name2, f) => flatMap2(self, (a) =>
|
|
|
244
243
|
[name2]: b2
|
|
245
244
|
}))));
|
|
246
245
|
|
|
247
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
248
|
-
var moduleVersion = "3.2.
|
|
246
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/internal/version.js
|
|
247
|
+
var moduleVersion = "3.2.8";
|
|
249
248
|
var getCurrentVersion = () => moduleVersion;
|
|
250
249
|
|
|
251
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
250
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/GlobalValue.js
|
|
252
251
|
var globalStoreId = /* @__PURE__ */ Symbol.for(`effect/GlobalValue/globalStoreId/${/* @__PURE__ */ getCurrentVersion()}`);
|
|
253
252
|
if (!(globalStoreId in globalThis)) {
|
|
254
253
|
globalThis[globalStoreId] = /* @__PURE__ */ new Map();
|
|
@@ -261,17 +260,17 @@ var globalValue = (id, compute) => {
|
|
|
261
260
|
return globalStore.get(id);
|
|
262
261
|
};
|
|
263
262
|
|
|
264
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
263
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Predicate.js
|
|
265
264
|
var isFunction2 = isFunction;
|
|
266
265
|
var isRecordOrArray = (input) => typeof input === "object" && input !== null;
|
|
267
266
|
var isObject = (input) => isRecordOrArray(input) || isFunction2(input);
|
|
268
267
|
var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObject(self) && property in self);
|
|
269
268
|
var isNullable = (input) => input === null || input === void 0;
|
|
270
269
|
|
|
271
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
270
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/internal/errors.js
|
|
272
271
|
var getBugErrorMessage = (message) => `BUG: ${message} - please report an issue at https://github.com/Effect-TS/effect/issues`;
|
|
273
272
|
|
|
274
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
273
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Utils.js
|
|
275
274
|
var GenKindTypeId = /* @__PURE__ */ Symbol.for("effect/Gen/GenKind");
|
|
276
275
|
var isGenKind = (u2) => isObject(u2) && GenKindTypeId in u2;
|
|
277
276
|
var GenKindImpl = class {
|
|
@@ -515,7 +514,7 @@ var structuralRegionState = /* @__PURE__ */ globalValue("effect/Utils/isStructur
|
|
|
515
514
|
tester: void 0
|
|
516
515
|
}));
|
|
517
516
|
|
|
518
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
517
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Hash.js
|
|
519
518
|
var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => /* @__PURE__ */ new WeakMap());
|
|
520
519
|
var pcgr = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/pcgr"), () => new PCGRandom());
|
|
521
520
|
var symbol = /* @__PURE__ */ Symbol.for("effect/Hash");
|
|
@@ -540,8 +539,9 @@ var hash = (self) => {
|
|
|
540
539
|
case "object": {
|
|
541
540
|
if (self === null) {
|
|
542
541
|
return string("null");
|
|
543
|
-
}
|
|
544
|
-
|
|
542
|
+
} else if (self instanceof Date) {
|
|
543
|
+
return hash(self.toISOString());
|
|
544
|
+
} else if (isHash(self)) {
|
|
545
545
|
return self[symbol]();
|
|
546
546
|
} else {
|
|
547
547
|
return random(self);
|
|
@@ -604,7 +604,7 @@ var cached = function() {
|
|
|
604
604
|
return hash2;
|
|
605
605
|
};
|
|
606
606
|
|
|
607
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
607
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Equal.js
|
|
608
608
|
var symbol2 = /* @__PURE__ */ Symbol.for("effect/Equal");
|
|
609
609
|
function equals() {
|
|
610
610
|
if (arguments.length === 1) {
|
|
@@ -628,6 +628,8 @@ function compareBoth(self, that) {
|
|
|
628
628
|
} else {
|
|
629
629
|
return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
630
630
|
}
|
|
631
|
+
} else if (self instanceof Date && that instanceof Date) {
|
|
632
|
+
return self.toISOString() === that.toISOString();
|
|
631
633
|
}
|
|
632
634
|
}
|
|
633
635
|
if (structuralRegionState.enabled) {
|
|
@@ -654,7 +656,7 @@ function compareBoth(self, that) {
|
|
|
654
656
|
var isEqual = (u2) => hasProperty(u2, symbol2);
|
|
655
657
|
var equivalence = () => equals;
|
|
656
658
|
|
|
657
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
659
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Inspectable.js
|
|
658
660
|
var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
659
661
|
var toJSON = (x2) => {
|
|
660
662
|
if (hasProperty(x2, "toJSON") && isFunction2(x2["toJSON"]) && x2["toJSON"].length === 0) {
|
|
@@ -666,7 +668,7 @@ var toJSON = (x2) => {
|
|
|
666
668
|
};
|
|
667
669
|
var format = (x2) => JSON.stringify(x2, null, 2);
|
|
668
670
|
|
|
669
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
671
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Pipeable.js
|
|
670
672
|
var pipeArguments = (self, args) => {
|
|
671
673
|
switch (args.length) {
|
|
672
674
|
case 1:
|
|
@@ -697,7 +699,7 @@ var pipeArguments = (self, args) => {
|
|
|
697
699
|
}
|
|
698
700
|
};
|
|
699
701
|
|
|
700
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
702
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/internal/effectable.js
|
|
701
703
|
var EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
|
|
702
704
|
var StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
|
|
703
705
|
var SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
|
|
@@ -758,7 +760,7 @@ var EffectPrototype = {
|
|
|
758
760
|
}
|
|
759
761
|
};
|
|
760
762
|
|
|
761
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
763
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/internal/option.js
|
|
762
764
|
var TypeId = /* @__PURE__ */ Symbol.for("effect/Option");
|
|
763
765
|
var CommonProto = {
|
|
764
766
|
...EffectPrototype,
|
|
@@ -816,7 +818,7 @@ var some = (value) => {
|
|
|
816
818
|
return a;
|
|
817
819
|
};
|
|
818
820
|
|
|
819
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
821
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/internal/either.js
|
|
820
822
|
var TypeId2 = /* @__PURE__ */ Symbol.for("effect/Either");
|
|
821
823
|
var CommonProto2 = {
|
|
822
824
|
...EffectPrototype,
|
|
@@ -880,7 +882,7 @@ var right = (right2) => {
|
|
|
880
882
|
var getLeft = (self) => isRight(self) ? none : some(self.left);
|
|
881
883
|
var getRight = (self) => isLeft(self) ? none : some(self.right);
|
|
882
884
|
|
|
883
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
885
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Option.js
|
|
884
886
|
var Option_exports = {};
|
|
885
887
|
__export(Option_exports, {
|
|
886
888
|
Do: () => Do,
|
|
@@ -942,10 +944,10 @@ __export(Option_exports, {
|
|
|
942
944
|
zipWith: () => zipWith
|
|
943
945
|
});
|
|
944
946
|
|
|
945
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
947
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Order.js
|
|
946
948
|
var make2 = (compare) => (self, that) => self === that ? 0 : compare(self, that);
|
|
947
949
|
|
|
948
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
950
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Option.js
|
|
949
951
|
var TypeId3 = /* @__PURE__ */ Symbol.for("effect/Option");
|
|
950
952
|
var none2 = () => none;
|
|
951
953
|
var some2 = some;
|
|
@@ -1125,21 +1127,17 @@ var o = (n2, s2, c2) => {
|
|
|
1125
1127
|
return r2 && i2 && Object.keys(i2).forEach((t2) => c2(t2, i2[t2])), r2;
|
|
1126
1128
|
}
|
|
1127
1129
|
if (r(n2)) {
|
|
1128
|
-
if (!r(s2))
|
|
1129
|
-
return false;
|
|
1130
|
+
if (!r(s2)) return false;
|
|
1130
1131
|
if (Array.isArray(n2)) {
|
|
1131
|
-
if (!Array.isArray(s2))
|
|
1132
|
-
return false;
|
|
1132
|
+
if (!Array.isArray(s2)) return false;
|
|
1133
1133
|
let t2 = [], r2 = [], a = [];
|
|
1134
1134
|
for (const o2 of n2.keys()) {
|
|
1135
1135
|
const s3 = n2[o2];
|
|
1136
1136
|
i(s3) && s3[e] ? a.push(s3) : a.length ? r2.push(s3) : t2.push(s3);
|
|
1137
1137
|
}
|
|
1138
1138
|
if (a.length) {
|
|
1139
|
-
if (a.length > 1)
|
|
1140
|
-
|
|
1141
|
-
if (s2.length < t2.length + r2.length)
|
|
1142
|
-
return false;
|
|
1139
|
+
if (a.length > 1) throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");
|
|
1140
|
+
if (s2.length < t2.length + r2.length) return false;
|
|
1143
1141
|
const e2 = s2.slice(0, t2.length), n3 = 0 === r2.length ? [] : s2.slice(-r2.length), i2 = s2.slice(t2.length, 0 === r2.length ? Infinity : -r2.length);
|
|
1144
1142
|
return t2.every((t3, n4) => o(t3, e2[n4], c2)) && r2.every((t3, e3) => o(t3, n3[e3], c2)) && (0 === a.length || o(a[0], i2, c2));
|
|
1145
1143
|
}
|
|
@@ -1251,8 +1249,7 @@ var z = class _z {
|
|
|
1251
1249
|
this.input = void 0, this.state = void 0, this.input = t2, this.state = e2;
|
|
1252
1250
|
}
|
|
1253
1251
|
with(...t2) {
|
|
1254
|
-
if (this.state.matched)
|
|
1255
|
-
return this;
|
|
1252
|
+
if (this.state.matched) return this;
|
|
1256
1253
|
const e2 = t2[t2.length - 1], r2 = [t2[0]];
|
|
1257
1254
|
let i2;
|
|
1258
1255
|
3 === t2.length && "function" == typeof t2[1] ? i2 = t2[1] : t2.length > 2 && r2.push(...t2.slice(1, t2.length - 1));
|
|
@@ -1263,8 +1260,7 @@ var z = class _z {
|
|
|
1263
1260
|
return new _z(this.input, u2);
|
|
1264
1261
|
}
|
|
1265
1262
|
when(t2, e2) {
|
|
1266
|
-
if (this.state.matched)
|
|
1267
|
-
return this;
|
|
1263
|
+
if (this.state.matched) return this;
|
|
1268
1264
|
const n2 = Boolean(t2(this.input));
|
|
1269
1265
|
return new _z(this.input, n2 ? { matched: true, value: e2(this.input, this.input) } : W);
|
|
1270
1266
|
}
|
|
@@ -1272,8 +1268,7 @@ var z = class _z {
|
|
|
1272
1268
|
return this.state.matched ? this.state.value : t2(this.input);
|
|
1273
1269
|
}
|
|
1274
1270
|
exhaustive() {
|
|
1275
|
-
if (this.state.matched)
|
|
1276
|
-
return this.state.value;
|
|
1271
|
+
if (this.state.matched) return this.state.value;
|
|
1277
1272
|
let t2;
|
|
1278
1273
|
try {
|
|
1279
1274
|
t2 = JSON.stringify(this.input);
|
|
@@ -1308,8 +1303,7 @@ var ensure_use_callback_has_non_empty_deps_default = createRule({
|
|
|
1308
1303
|
return {
|
|
1309
1304
|
CallExpression(node) {
|
|
1310
1305
|
const initialScope = context.sourceCode.getScope(node);
|
|
1311
|
-
if (!core.isReactHookCall(node))
|
|
1312
|
-
return;
|
|
1306
|
+
if (!core.isReactHookCall(node)) return;
|
|
1313
1307
|
if (!core.isUseCallbackCall(node, context) && !alias.some(Function_exports.flip(core.isReactHookCallWithNameLoose)(node))) {
|
|
1314
1308
|
return;
|
|
1315
1309
|
}
|
|
@@ -1360,10 +1354,8 @@ var ensure_use_memo_has_non_empty_deps_default = createRule({
|
|
|
1360
1354
|
return {
|
|
1361
1355
|
CallExpression(node) {
|
|
1362
1356
|
const initialScope = context.sourceCode.getScope(node);
|
|
1363
|
-
if (!core.isReactHookCall(node))
|
|
1364
|
-
|
|
1365
|
-
if (!core.isUseMemoCall(node, context) && !alias.some(Function_exports.flip(core.isReactHookCallWithNameLoose)(node)))
|
|
1366
|
-
return;
|
|
1357
|
+
if (!core.isReactHookCall(node)) return;
|
|
1358
|
+
if (!core.isUseMemoCall(node, context) && !alias.some(Function_exports.flip(core.isReactHookCallWithNameLoose)(node))) return;
|
|
1367
1359
|
const [_2, deps] = node.arguments;
|
|
1368
1360
|
if (!deps) {
|
|
1369
1361
|
context.report({
|
|
@@ -1411,19 +1403,15 @@ var prefer_use_state_lazy_initialization_default = createRule({
|
|
|
1411
1403
|
const alias = valibot.parse(shared.ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useState ?? [];
|
|
1412
1404
|
return {
|
|
1413
1405
|
CallExpression(node) {
|
|
1414
|
-
if (!core.isReactHookCall(node))
|
|
1415
|
-
|
|
1416
|
-
if (!core.isUseStateCall(node, context) && !alias.some(Function_exports.flip(core.isReactHookCallWithNameLoose)(node)))
|
|
1417
|
-
return;
|
|
1406
|
+
if (!core.isReactHookCall(node)) return;
|
|
1407
|
+
if (!core.isUseStateCall(node, context) && !alias.some(Function_exports.flip(core.isReactHookCallWithNameLoose)(node))) return;
|
|
1418
1408
|
const [useStateInput] = node.arguments;
|
|
1419
|
-
if (!useStateInput)
|
|
1420
|
-
return;
|
|
1409
|
+
if (!useStateInput) return;
|
|
1421
1410
|
const nestedCallExpressions = ast.getNestedCallExpressions(useStateInput);
|
|
1422
1411
|
const hasFunctionCall = nestedCallExpressions.some((n2) => {
|
|
1423
1412
|
return "name" in n2.callee && !ALLOW_LIST.includes(n2.callee.name);
|
|
1424
1413
|
});
|
|
1425
|
-
if (!hasFunctionCall)
|
|
1426
|
-
return;
|
|
1414
|
+
if (!hasFunctionCall) return;
|
|
1427
1415
|
context.report({
|
|
1428
1416
|
messageId: "PREFER_USE_STATE_LAZY_INITIALIZATION",
|
|
1429
1417
|
node: useStateInput
|
package/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ var __export = (target, all2) => {
|
|
|
12
12
|
|
|
13
13
|
// package.json
|
|
14
14
|
var name = "eslint-plugin-react-hooks-extra";
|
|
15
|
-
var version = "1.5.
|
|
15
|
+
var version = "1.5.15-beta.2";
|
|
16
16
|
var createRule = createRuleForPlugin("hooks-extra");
|
|
17
17
|
|
|
18
18
|
// src/rules/ensure-custom-hooks-using-other-hooks.ts
|
|
@@ -37,8 +37,7 @@ var ensure_custom_hooks_using_other_hooks_default = createRule({
|
|
|
37
37
|
"Program:exit"(node) {
|
|
38
38
|
const allHooks = ctx.getAllHooks(node);
|
|
39
39
|
for (const { name: name2, hookCalls, node: node2 } of allHooks.values()) {
|
|
40
|
-
if (hookCalls.length > 0)
|
|
41
|
-
continue;
|
|
40
|
+
if (hookCalls.length > 0) continue;
|
|
42
41
|
context.report({
|
|
43
42
|
data: {
|
|
44
43
|
name: name2.value
|
|
@@ -53,7 +52,7 @@ var ensure_custom_hooks_using_other_hooks_default = createRule({
|
|
|
53
52
|
defaultOptions: []
|
|
54
53
|
});
|
|
55
54
|
|
|
56
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
55
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Function.js
|
|
57
56
|
var Function_exports = {};
|
|
58
57
|
__export(Function_exports, {
|
|
59
58
|
SK: () => SK,
|
|
@@ -228,10 +227,10 @@ function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
|
|
|
228
227
|
var hole = /* @__PURE__ */ unsafeCoerce(absurd);
|
|
229
228
|
var SK = (_2, b2) => b2;
|
|
230
229
|
|
|
231
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
230
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Equivalence.js
|
|
232
231
|
var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
|
|
233
232
|
|
|
234
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
233
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/internal/doNotation.js
|
|
235
234
|
var let_ = (map2) => dual(3, (self, name2, f) => map2(self, (a) => Object.assign({}, a, {
|
|
236
235
|
[name2]: f(a)
|
|
237
236
|
})));
|
|
@@ -242,11 +241,11 @@ var bind = (map2, flatMap2) => dual(3, (self, name2, f) => flatMap2(self, (a) =>
|
|
|
242
241
|
[name2]: b2
|
|
243
242
|
}))));
|
|
244
243
|
|
|
245
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
246
|
-
var moduleVersion = "3.2.
|
|
244
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/internal/version.js
|
|
245
|
+
var moduleVersion = "3.2.8";
|
|
247
246
|
var getCurrentVersion = () => moduleVersion;
|
|
248
247
|
|
|
249
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
248
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/GlobalValue.js
|
|
250
249
|
var globalStoreId = /* @__PURE__ */ Symbol.for(`effect/GlobalValue/globalStoreId/${/* @__PURE__ */ getCurrentVersion()}`);
|
|
251
250
|
if (!(globalStoreId in globalThis)) {
|
|
252
251
|
globalThis[globalStoreId] = /* @__PURE__ */ new Map();
|
|
@@ -259,17 +258,17 @@ var globalValue = (id, compute) => {
|
|
|
259
258
|
return globalStore.get(id);
|
|
260
259
|
};
|
|
261
260
|
|
|
262
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
261
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Predicate.js
|
|
263
262
|
var isFunction2 = isFunction;
|
|
264
263
|
var isRecordOrArray = (input) => typeof input === "object" && input !== null;
|
|
265
264
|
var isObject = (input) => isRecordOrArray(input) || isFunction2(input);
|
|
266
265
|
var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObject(self) && property in self);
|
|
267
266
|
var isNullable = (input) => input === null || input === void 0;
|
|
268
267
|
|
|
269
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
268
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/internal/errors.js
|
|
270
269
|
var getBugErrorMessage = (message) => `BUG: ${message} - please report an issue at https://github.com/Effect-TS/effect/issues`;
|
|
271
270
|
|
|
272
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
271
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Utils.js
|
|
273
272
|
var GenKindTypeId = /* @__PURE__ */ Symbol.for("effect/Gen/GenKind");
|
|
274
273
|
var isGenKind = (u2) => isObject(u2) && GenKindTypeId in u2;
|
|
275
274
|
var GenKindImpl = class {
|
|
@@ -513,7 +512,7 @@ var structuralRegionState = /* @__PURE__ */ globalValue("effect/Utils/isStructur
|
|
|
513
512
|
tester: void 0
|
|
514
513
|
}));
|
|
515
514
|
|
|
516
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
515
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Hash.js
|
|
517
516
|
var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => /* @__PURE__ */ new WeakMap());
|
|
518
517
|
var pcgr = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/pcgr"), () => new PCGRandom());
|
|
519
518
|
var symbol = /* @__PURE__ */ Symbol.for("effect/Hash");
|
|
@@ -538,8 +537,9 @@ var hash = (self) => {
|
|
|
538
537
|
case "object": {
|
|
539
538
|
if (self === null) {
|
|
540
539
|
return string("null");
|
|
541
|
-
}
|
|
542
|
-
|
|
540
|
+
} else if (self instanceof Date) {
|
|
541
|
+
return hash(self.toISOString());
|
|
542
|
+
} else if (isHash(self)) {
|
|
543
543
|
return self[symbol]();
|
|
544
544
|
} else {
|
|
545
545
|
return random(self);
|
|
@@ -602,7 +602,7 @@ var cached = function() {
|
|
|
602
602
|
return hash2;
|
|
603
603
|
};
|
|
604
604
|
|
|
605
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
605
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Equal.js
|
|
606
606
|
var symbol2 = /* @__PURE__ */ Symbol.for("effect/Equal");
|
|
607
607
|
function equals() {
|
|
608
608
|
if (arguments.length === 1) {
|
|
@@ -626,6 +626,8 @@ function compareBoth(self, that) {
|
|
|
626
626
|
} else {
|
|
627
627
|
return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
628
628
|
}
|
|
629
|
+
} else if (self instanceof Date && that instanceof Date) {
|
|
630
|
+
return self.toISOString() === that.toISOString();
|
|
629
631
|
}
|
|
630
632
|
}
|
|
631
633
|
if (structuralRegionState.enabled) {
|
|
@@ -652,7 +654,7 @@ function compareBoth(self, that) {
|
|
|
652
654
|
var isEqual = (u2) => hasProperty(u2, symbol2);
|
|
653
655
|
var equivalence = () => equals;
|
|
654
656
|
|
|
655
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
657
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Inspectable.js
|
|
656
658
|
var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
657
659
|
var toJSON = (x2) => {
|
|
658
660
|
if (hasProperty(x2, "toJSON") && isFunction2(x2["toJSON"]) && x2["toJSON"].length === 0) {
|
|
@@ -664,7 +666,7 @@ var toJSON = (x2) => {
|
|
|
664
666
|
};
|
|
665
667
|
var format = (x2) => JSON.stringify(x2, null, 2);
|
|
666
668
|
|
|
667
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
669
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Pipeable.js
|
|
668
670
|
var pipeArguments = (self, args) => {
|
|
669
671
|
switch (args.length) {
|
|
670
672
|
case 1:
|
|
@@ -695,7 +697,7 @@ var pipeArguments = (self, args) => {
|
|
|
695
697
|
}
|
|
696
698
|
};
|
|
697
699
|
|
|
698
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
700
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/internal/effectable.js
|
|
699
701
|
var EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
|
|
700
702
|
var StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
|
|
701
703
|
var SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
|
|
@@ -756,7 +758,7 @@ var EffectPrototype = {
|
|
|
756
758
|
}
|
|
757
759
|
};
|
|
758
760
|
|
|
759
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
761
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/internal/option.js
|
|
760
762
|
var TypeId = /* @__PURE__ */ Symbol.for("effect/Option");
|
|
761
763
|
var CommonProto = {
|
|
762
764
|
...EffectPrototype,
|
|
@@ -814,7 +816,7 @@ var some = (value) => {
|
|
|
814
816
|
return a;
|
|
815
817
|
};
|
|
816
818
|
|
|
817
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
819
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/internal/either.js
|
|
818
820
|
var TypeId2 = /* @__PURE__ */ Symbol.for("effect/Either");
|
|
819
821
|
var CommonProto2 = {
|
|
820
822
|
...EffectPrototype,
|
|
@@ -878,7 +880,7 @@ var right = (right2) => {
|
|
|
878
880
|
var getLeft = (self) => isRight(self) ? none : some(self.left);
|
|
879
881
|
var getRight = (self) => isLeft(self) ? none : some(self.right);
|
|
880
882
|
|
|
881
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
883
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Option.js
|
|
882
884
|
var Option_exports = {};
|
|
883
885
|
__export(Option_exports, {
|
|
884
886
|
Do: () => Do,
|
|
@@ -940,10 +942,10 @@ __export(Option_exports, {
|
|
|
940
942
|
zipWith: () => zipWith
|
|
941
943
|
});
|
|
942
944
|
|
|
943
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
945
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Order.js
|
|
944
946
|
var make2 = (compare) => (self, that) => self === that ? 0 : compare(self, that);
|
|
945
947
|
|
|
946
|
-
// ../../../node_modules/.pnpm/effect@3.2.
|
|
948
|
+
// ../../../node_modules/.pnpm/effect@3.2.8/node_modules/effect/dist/esm/Option.js
|
|
947
949
|
var TypeId3 = /* @__PURE__ */ Symbol.for("effect/Option");
|
|
948
950
|
var none2 = () => none;
|
|
949
951
|
var some2 = some;
|
|
@@ -1123,21 +1125,17 @@ var o = (n2, s2, c2) => {
|
|
|
1123
1125
|
return r2 && i2 && Object.keys(i2).forEach((t2) => c2(t2, i2[t2])), r2;
|
|
1124
1126
|
}
|
|
1125
1127
|
if (r(n2)) {
|
|
1126
|
-
if (!r(s2))
|
|
1127
|
-
return false;
|
|
1128
|
+
if (!r(s2)) return false;
|
|
1128
1129
|
if (Array.isArray(n2)) {
|
|
1129
|
-
if (!Array.isArray(s2))
|
|
1130
|
-
return false;
|
|
1130
|
+
if (!Array.isArray(s2)) return false;
|
|
1131
1131
|
let t2 = [], r2 = [], a = [];
|
|
1132
1132
|
for (const o2 of n2.keys()) {
|
|
1133
1133
|
const s3 = n2[o2];
|
|
1134
1134
|
i(s3) && s3[e] ? a.push(s3) : a.length ? r2.push(s3) : t2.push(s3);
|
|
1135
1135
|
}
|
|
1136
1136
|
if (a.length) {
|
|
1137
|
-
if (a.length > 1)
|
|
1138
|
-
|
|
1139
|
-
if (s2.length < t2.length + r2.length)
|
|
1140
|
-
return false;
|
|
1137
|
+
if (a.length > 1) throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");
|
|
1138
|
+
if (s2.length < t2.length + r2.length) return false;
|
|
1141
1139
|
const e2 = s2.slice(0, t2.length), n3 = 0 === r2.length ? [] : s2.slice(-r2.length), i2 = s2.slice(t2.length, 0 === r2.length ? Infinity : -r2.length);
|
|
1142
1140
|
return t2.every((t3, n4) => o(t3, e2[n4], c2)) && r2.every((t3, e3) => o(t3, n3[e3], c2)) && (0 === a.length || o(a[0], i2, c2));
|
|
1143
1141
|
}
|
|
@@ -1249,8 +1247,7 @@ var z = class _z {
|
|
|
1249
1247
|
this.input = void 0, this.state = void 0, this.input = t2, this.state = e2;
|
|
1250
1248
|
}
|
|
1251
1249
|
with(...t2) {
|
|
1252
|
-
if (this.state.matched)
|
|
1253
|
-
return this;
|
|
1250
|
+
if (this.state.matched) return this;
|
|
1254
1251
|
const e2 = t2[t2.length - 1], r2 = [t2[0]];
|
|
1255
1252
|
let i2;
|
|
1256
1253
|
3 === t2.length && "function" == typeof t2[1] ? i2 = t2[1] : t2.length > 2 && r2.push(...t2.slice(1, t2.length - 1));
|
|
@@ -1261,8 +1258,7 @@ var z = class _z {
|
|
|
1261
1258
|
return new _z(this.input, u2);
|
|
1262
1259
|
}
|
|
1263
1260
|
when(t2, e2) {
|
|
1264
|
-
if (this.state.matched)
|
|
1265
|
-
return this;
|
|
1261
|
+
if (this.state.matched) return this;
|
|
1266
1262
|
const n2 = Boolean(t2(this.input));
|
|
1267
1263
|
return new _z(this.input, n2 ? { matched: true, value: e2(this.input, this.input) } : W);
|
|
1268
1264
|
}
|
|
@@ -1270,8 +1266,7 @@ var z = class _z {
|
|
|
1270
1266
|
return this.state.matched ? this.state.value : t2(this.input);
|
|
1271
1267
|
}
|
|
1272
1268
|
exhaustive() {
|
|
1273
|
-
if (this.state.matched)
|
|
1274
|
-
return this.state.value;
|
|
1269
|
+
if (this.state.matched) return this.state.value;
|
|
1275
1270
|
let t2;
|
|
1276
1271
|
try {
|
|
1277
1272
|
t2 = JSON.stringify(this.input);
|
|
@@ -1306,8 +1301,7 @@ var ensure_use_callback_has_non_empty_deps_default = createRule({
|
|
|
1306
1301
|
return {
|
|
1307
1302
|
CallExpression(node) {
|
|
1308
1303
|
const initialScope = context.sourceCode.getScope(node);
|
|
1309
|
-
if (!isReactHookCall(node))
|
|
1310
|
-
return;
|
|
1304
|
+
if (!isReactHookCall(node)) return;
|
|
1311
1305
|
if (!isUseCallbackCall(node, context) && !alias.some(Function_exports.flip(isReactHookCallWithNameLoose)(node))) {
|
|
1312
1306
|
return;
|
|
1313
1307
|
}
|
|
@@ -1358,10 +1352,8 @@ var ensure_use_memo_has_non_empty_deps_default = createRule({
|
|
|
1358
1352
|
return {
|
|
1359
1353
|
CallExpression(node) {
|
|
1360
1354
|
const initialScope = context.sourceCode.getScope(node);
|
|
1361
|
-
if (!isReactHookCall(node))
|
|
1362
|
-
|
|
1363
|
-
if (!isUseMemoCall(node, context) && !alias.some(Function_exports.flip(isReactHookCallWithNameLoose)(node)))
|
|
1364
|
-
return;
|
|
1355
|
+
if (!isReactHookCall(node)) return;
|
|
1356
|
+
if (!isUseMemoCall(node, context) && !alias.some(Function_exports.flip(isReactHookCallWithNameLoose)(node))) return;
|
|
1365
1357
|
const [_2, deps] = node.arguments;
|
|
1366
1358
|
if (!deps) {
|
|
1367
1359
|
context.report({
|
|
@@ -1409,19 +1401,15 @@ var prefer_use_state_lazy_initialization_default = createRule({
|
|
|
1409
1401
|
const alias = parse(ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useState ?? [];
|
|
1410
1402
|
return {
|
|
1411
1403
|
CallExpression(node) {
|
|
1412
|
-
if (!isReactHookCall(node))
|
|
1413
|
-
|
|
1414
|
-
if (!isUseStateCall(node, context) && !alias.some(Function_exports.flip(isReactHookCallWithNameLoose)(node)))
|
|
1415
|
-
return;
|
|
1404
|
+
if (!isReactHookCall(node)) return;
|
|
1405
|
+
if (!isUseStateCall(node, context) && !alias.some(Function_exports.flip(isReactHookCallWithNameLoose)(node))) return;
|
|
1416
1406
|
const [useStateInput] = node.arguments;
|
|
1417
|
-
if (!useStateInput)
|
|
1418
|
-
return;
|
|
1407
|
+
if (!useStateInput) return;
|
|
1419
1408
|
const nestedCallExpressions = getNestedCallExpressions(useStateInput);
|
|
1420
1409
|
const hasFunctionCall = nestedCallExpressions.some((n2) => {
|
|
1421
1410
|
return "name" in n2.callee && !ALLOW_LIST.includes(n2.callee.name);
|
|
1422
1411
|
});
|
|
1423
|
-
if (!hasFunctionCall)
|
|
1424
|
-
return;
|
|
1412
|
+
if (!hasFunctionCall) return;
|
|
1425
1413
|
context.report({
|
|
1426
1414
|
messageId: "PREFER_USE_STATE_LAZY_INITIALIZATION",
|
|
1427
1415
|
node: useStateInput
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-hooks-extra",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.15-beta.2",
|
|
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": {
|
|
@@ -35,28 +35,28 @@
|
|
|
35
35
|
"./package.json"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@typescript-eslint/parser": "^7.
|
|
39
|
-
"@typescript-eslint/scope-manager": "^7.
|
|
40
|
-
"@typescript-eslint/type-utils": "^7.
|
|
41
|
-
"@typescript-eslint/types": "^7.
|
|
42
|
-
"@typescript-eslint/utils": "^7.
|
|
38
|
+
"@typescript-eslint/parser": "^7.12.0",
|
|
39
|
+
"@typescript-eslint/scope-manager": "^7.12.0",
|
|
40
|
+
"@typescript-eslint/type-utils": "^7.12.0",
|
|
41
|
+
"@typescript-eslint/types": "^7.12.0",
|
|
42
|
+
"@typescript-eslint/utils": "^7.12.0",
|
|
43
43
|
"string-ts": "2.1.1",
|
|
44
|
-
"valibot": "0.31.0-rc.
|
|
45
|
-
"@eslint-react/ast": "1.5.
|
|
46
|
-
"@eslint-react/core": "1.5.
|
|
47
|
-
"@eslint-react/jsx": "1.5.
|
|
48
|
-
"@eslint-react/shared": "1.5.
|
|
49
|
-
"@eslint-react/tools": "1.5.
|
|
50
|
-
"@eslint-react/
|
|
51
|
-
"@eslint-react/
|
|
44
|
+
"valibot": "0.31.0-rc.11",
|
|
45
|
+
"@eslint-react/ast": "1.5.15-beta.2",
|
|
46
|
+
"@eslint-react/core": "1.5.15-beta.2",
|
|
47
|
+
"@eslint-react/jsx": "1.5.15-beta.2",
|
|
48
|
+
"@eslint-react/shared": "1.5.15-beta.2",
|
|
49
|
+
"@eslint-react/tools": "1.5.15-beta.2",
|
|
50
|
+
"@eslint-react/types": "1.5.15-beta.2",
|
|
51
|
+
"@eslint-react/var": "1.5.15-beta.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"dedent": "1.5.3",
|
|
55
|
-
"effect": "3.2.
|
|
56
|
-
"tsup": "8.0
|
|
55
|
+
"effect": "3.2.8",
|
|
56
|
+
"tsup": "8.1.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@typescript-eslint/parser": "^7.5.0",
|
|
59
|
+
"@typescript-eslint/parser": "^7.5.0 || ^8.0.0-0",
|
|
60
60
|
"eslint": "^8.57.0 || ^9.0.0",
|
|
61
61
|
"typescript": "^5.3.3"
|
|
62
62
|
},
|