eslint-plugin-react-hooks-extra 1.8.1-next.2 → 1.8.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.
- package/dist/index.js +5 -3
- package/dist/index.mjs +5 -3
- package/package.json +8 -8
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.1
|
|
33
|
+
var version = "1.8.1";
|
|
34
34
|
var createRule = shared.createRuleForPlugin("hooks-extra");
|
|
35
35
|
function isFromUseStateCall(context, useStateAlias) {
|
|
36
36
|
return (topLevelId) => {
|
|
@@ -551,7 +551,8 @@ var no_direct_set_state_in_use_effect_default = createRule({
|
|
|
551
551
|
node
|
|
552
552
|
});
|
|
553
553
|
}).with("useEffect", () => {
|
|
554
|
-
|
|
554
|
+
const [firstArg] = node.arguments;
|
|
555
|
+
if (ast.isFunction(firstArg)) return;
|
|
555
556
|
const identifiers = ast.getNestedIdentifiers(node);
|
|
556
557
|
effectFunctionIdentifiers.push(...identifiers);
|
|
557
558
|
}).with("other", () => {
|
|
@@ -716,7 +717,8 @@ var no_direct_set_state_in_use_layout_effect_default = createRule({
|
|
|
716
717
|
node
|
|
717
718
|
});
|
|
718
719
|
}).with("useLayoutEffect", () => {
|
|
719
|
-
|
|
720
|
+
const [firstArg] = node.arguments;
|
|
721
|
+
if (ast.isFunction(firstArg)) return;
|
|
720
722
|
const identifiers = ast.getNestedIdentifiers(node);
|
|
721
723
|
effectFunctionIdentifiers.push(...identifiers);
|
|
722
724
|
}).with("other", () => {
|
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.1
|
|
11
|
+
var version = "1.8.1";
|
|
12
12
|
var createRule = createRuleForPlugin("hooks-extra");
|
|
13
13
|
function isFromUseStateCall(context, useStateAlias) {
|
|
14
14
|
return (topLevelId) => {
|
|
@@ -529,7 +529,8 @@ var no_direct_set_state_in_use_effect_default = createRule({
|
|
|
529
529
|
node
|
|
530
530
|
});
|
|
531
531
|
}).with("useEffect", () => {
|
|
532
|
-
|
|
532
|
+
const [firstArg] = node.arguments;
|
|
533
|
+
if (isFunction(firstArg)) return;
|
|
533
534
|
const identifiers = getNestedIdentifiers(node);
|
|
534
535
|
effectFunctionIdentifiers.push(...identifiers);
|
|
535
536
|
}).with("other", () => {
|
|
@@ -694,7 +695,8 @@ var no_direct_set_state_in_use_layout_effect_default = createRule({
|
|
|
694
695
|
node
|
|
695
696
|
});
|
|
696
697
|
}).with("useLayoutEffect", () => {
|
|
697
|
-
|
|
698
|
+
const [firstArg] = node.arguments;
|
|
699
|
+
if (isFunction(firstArg)) return;
|
|
698
700
|
const identifiers = getNestedIdentifiers(node);
|
|
699
701
|
effectFunctionIdentifiers.push(...identifiers);
|
|
700
702
|
}).with("other", () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-hooks-extra",
|
|
3
|
-
"version": "1.8.1
|
|
3
|
+
"version": "1.8.1",
|
|
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/
|
|
50
|
-
"@eslint-react/
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/var": "1.8.1
|
|
55
|
-
"@eslint-react/
|
|
49
|
+
"@eslint-react/ast": "1.8.1",
|
|
50
|
+
"@eslint-react/core": "1.8.1",
|
|
51
|
+
"@eslint-react/shared": "1.8.1",
|
|
52
|
+
"@eslint-react/types": "1.8.1",
|
|
53
|
+
"@eslint-react/tools": "1.8.1",
|
|
54
|
+
"@eslint-react/var": "1.8.1",
|
|
55
|
+
"@eslint-react/jsx": "1.8.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/react": "^18.3.3",
|