eslint-plugin-react-hooks-extra 1.8.3-beta.2 → 1.8.3-beta.3

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 CHANGED
@@ -30,7 +30,7 @@ var R__namespace = /*#__PURE__*/_interopNamespace(R);
30
30
 
31
31
  // package.json
32
32
  var name = "eslint-plugin-react-hooks-extra";
33
- var version = "1.8.3-beta.2";
33
+ var version = "1.8.3-beta.3";
34
34
  var createRule = shared.createRuleForPlugin("hooks-extra");
35
35
  function isFromHookCall(name2, context, settings, predicate = tools.F.constTrue) {
36
36
  const hookAlias = settings.additionalHooks?.[name2] ?? [];
@@ -530,13 +530,12 @@ var no_direct_set_state_in_use_effect_default = createRule({
530
530
  ":function"(node) {
531
531
  const functionKind = getFunctionKind(node);
532
532
  functionStack.push([node, functionKind]);
533
- $(functionKind).with("effect", () => {
534
- onEffectFunctionEnter(node);
535
- }).otherwise(tools.F.constVoid);
533
+ if (functionKind === "effect") onEffectFunctionEnter(node);
536
534
  },
537
535
  ":function:exit"(node) {
538
- onEffectFunctionExit(node);
536
+ const [_2, functionKind] = R__namespace.last(functionStack) ?? [];
539
537
  functionStack.pop();
538
+ if (functionKind === "effect") onEffectFunctionExit(node);
540
539
  },
541
540
  CallExpression(node) {
542
541
  const effectFn = tools.MutRef.get(effectFunctionRef);
@@ -706,13 +705,12 @@ var no_direct_set_state_in_use_layout_effect_default = createRule({
706
705
  ":function"(node) {
707
706
  const functionKind = getFunctionKind(node);
708
707
  functionStack.push([node, functionKind]);
709
- $(functionKind).with("effect", () => {
710
- onEffectFunctionEnter(node);
711
- }).otherwise(tools.F.constVoid);
708
+ if (functionKind === "effect") onEffectFunctionEnter(node);
712
709
  },
713
710
  ":function:exit"(node) {
714
- onEffectFunctionExit(node);
711
+ const [_2, functionKind] = R__namespace.last(functionStack) ?? [];
715
712
  functionStack.pop();
713
+ if (functionKind === "effect") onEffectFunctionExit(node);
716
714
  },
717
715
  CallExpression(node) {
718
716
  const effectFn = tools.MutRef.get(effectFunctionRef);
package/dist/index.mjs CHANGED
@@ -8,7 +8,7 @@ import * as R from 'remeda';
8
8
 
9
9
  // package.json
10
10
  var name = "eslint-plugin-react-hooks-extra";
11
- var version = "1.8.3-beta.2";
11
+ var version = "1.8.3-beta.3";
12
12
  var createRule = createRuleForPlugin("hooks-extra");
13
13
  function isFromHookCall(name2, context, settings, predicate = F.constTrue) {
14
14
  const hookAlias = settings.additionalHooks?.[name2] ?? [];
@@ -508,13 +508,12 @@ var no_direct_set_state_in_use_effect_default = createRule({
508
508
  ":function"(node) {
509
509
  const functionKind = getFunctionKind(node);
510
510
  functionStack.push([node, functionKind]);
511
- $(functionKind).with("effect", () => {
512
- onEffectFunctionEnter(node);
513
- }).otherwise(F.constVoid);
511
+ if (functionKind === "effect") onEffectFunctionEnter(node);
514
512
  },
515
513
  ":function:exit"(node) {
516
- onEffectFunctionExit(node);
514
+ const [_2, functionKind] = R.last(functionStack) ?? [];
517
515
  functionStack.pop();
516
+ if (functionKind === "effect") onEffectFunctionExit(node);
518
517
  },
519
518
  CallExpression(node) {
520
519
  const effectFn = MutRef.get(effectFunctionRef);
@@ -684,13 +683,12 @@ var no_direct_set_state_in_use_layout_effect_default = createRule({
684
683
  ":function"(node) {
685
684
  const functionKind = getFunctionKind(node);
686
685
  functionStack.push([node, functionKind]);
687
- $(functionKind).with("effect", () => {
688
- onEffectFunctionEnter(node);
689
- }).otherwise(F.constVoid);
686
+ if (functionKind === "effect") onEffectFunctionEnter(node);
690
687
  },
691
688
  ":function:exit"(node) {
692
- onEffectFunctionExit(node);
689
+ const [_2, functionKind] = R.last(functionStack) ?? [];
693
690
  functionStack.pop();
691
+ if (functionKind === "effect") onEffectFunctionExit(node);
694
692
  },
695
693
  CallExpression(node) {
696
694
  const effectFn = MutRef.get(effectFunctionRef);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-hooks-extra",
3
- "version": "1.8.3-beta.2",
3
+ "version": "1.8.3-beta.3",
4
4
  "description": "ESLint React's ESLint plugin for React Hooks related rules.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -46,13 +46,13 @@
46
46
  "@typescript-eslint/types": "^8.0.0",
47
47
  "@typescript-eslint/utils": "^8.0.0",
48
48
  "remeda": "^2.7.0",
49
- "@eslint-react/ast": "1.8.3-beta.2",
50
- "@eslint-react/jsx": "1.8.3-beta.2",
51
- "@eslint-react/shared": "1.8.3-beta.2",
52
- "@eslint-react/core": "1.8.3-beta.2",
53
- "@eslint-react/types": "1.8.3-beta.2",
54
- "@eslint-react/var": "1.8.3-beta.2",
55
- "@eslint-react/tools": "1.8.3-beta.2"
49
+ "@eslint-react/ast": "1.8.3-beta.3",
50
+ "@eslint-react/core": "1.8.3-beta.3",
51
+ "@eslint-react/shared": "1.8.3-beta.3",
52
+ "@eslint-react/jsx": "1.8.3-beta.3",
53
+ "@eslint-react/tools": "1.8.3-beta.3",
54
+ "@eslint-react/types": "1.8.3-beta.3",
55
+ "@eslint-react/var": "1.8.3-beta.3"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/react": "^18.3.3",