eslint-plugin-react-hooks-extra 1.42.1 → 1.42.2-beta.4
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 +6 -6
- package/dist/index.mjs +7 -7
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -52,7 +52,7 @@ var rules = {
|
|
|
52
52
|
|
|
53
53
|
// package.json
|
|
54
54
|
var name2 = "eslint-plugin-react-hooks-extra";
|
|
55
|
-
var version = "1.42.
|
|
55
|
+
var version = "1.42.2-beta.4";
|
|
56
56
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("hooks-extra"));
|
|
57
57
|
function isFromHookCall(context, name3, settings, predicate = eff.constTrue) {
|
|
58
58
|
const hookAlias = settings.additionalHooks[name3] ?? [];
|
|
@@ -232,7 +232,7 @@ function useNoDirectSetStateInUseEffect(context, options) {
|
|
|
232
232
|
}).with("other", () => {
|
|
233
233
|
if (pEntry.node !== setupFunction) return;
|
|
234
234
|
indFunctionCalls.push(node);
|
|
235
|
-
}).otherwise(
|
|
235
|
+
}).otherwise(eff.constVoid);
|
|
236
236
|
},
|
|
237
237
|
Identifier(node) {
|
|
238
238
|
if (node.parent.type === types.AST_NODE_TYPES.CallExpression && node.parent.callee === node) {
|
|
@@ -437,10 +437,10 @@ function create3(context) {
|
|
|
437
437
|
const variable = VAR4__namespace.findVariable(n.name, initialScope);
|
|
438
438
|
const variableNode = VAR4__namespace.getVariableInitNode(variable, 0);
|
|
439
439
|
if (variableNode?.type !== types.AST_NODE_TYPES.ArrowFunctionExpression && variableNode?.type !== types.AST_NODE_TYPES.FunctionExpression) {
|
|
440
|
-
return
|
|
440
|
+
return null;
|
|
441
441
|
}
|
|
442
442
|
return variableNode;
|
|
443
|
-
}).otherwise(() =>
|
|
443
|
+
}).otherwise(() => null);
|
|
444
444
|
if (arg0Node == null) return;
|
|
445
445
|
const arg0NodeScope = context.sourceCode.getScope(arg0Node);
|
|
446
446
|
const arg0NodeReferences = VAR4__namespace.getChidScopes(arg0NodeScope).flatMap((x) => x.references);
|
|
@@ -519,10 +519,10 @@ function create4(context) {
|
|
|
519
519
|
const variable = VAR4__namespace.findVariable(n.name, initialScope);
|
|
520
520
|
const variableNode = VAR4__namespace.getVariableInitNode(variable, 0);
|
|
521
521
|
if (variableNode?.type !== types.AST_NODE_TYPES.ArrowFunctionExpression && variableNode?.type !== types.AST_NODE_TYPES.FunctionExpression) {
|
|
522
|
-
return
|
|
522
|
+
return null;
|
|
523
523
|
}
|
|
524
524
|
return variableNode;
|
|
525
|
-
}).otherwise(() =>
|
|
525
|
+
}).otherwise(() => null);
|
|
526
526
|
if (arg0Node == null) return;
|
|
527
527
|
const arg0NodeScope = context.sourceCode.getScope(arg0Node);
|
|
528
528
|
const arg0NodeReferences = VAR4__namespace.getChidScopes(arg0NodeScope).flatMap((x) => x.references);
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as AST from '@eslint-react/ast';
|
|
2
2
|
import * as ER7 from '@eslint-react/core';
|
|
3
|
-
import { identity,
|
|
3
|
+
import { identity, getOrUpdate, constVoid, constTrue } from '@eslint-react/eff';
|
|
4
4
|
import { getDocsUrl, getSettingsFromContext } from '@eslint-react/shared';
|
|
5
5
|
import * as VAR4 from '@eslint-react/var';
|
|
6
6
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
@@ -28,7 +28,7 @@ var rules = {
|
|
|
28
28
|
|
|
29
29
|
// package.json
|
|
30
30
|
var name2 = "eslint-plugin-react-hooks-extra";
|
|
31
|
-
var version = "1.42.
|
|
31
|
+
var version = "1.42.2-beta.4";
|
|
32
32
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("hooks-extra"));
|
|
33
33
|
function isFromHookCall(context, name3, settings, predicate = constTrue) {
|
|
34
34
|
const hookAlias = settings.additionalHooks[name3] ?? [];
|
|
@@ -208,7 +208,7 @@ function useNoDirectSetStateInUseEffect(context, options) {
|
|
|
208
208
|
}).with("other", () => {
|
|
209
209
|
if (pEntry.node !== setupFunction) return;
|
|
210
210
|
indFunctionCalls.push(node);
|
|
211
|
-
}).otherwise(
|
|
211
|
+
}).otherwise(constVoid);
|
|
212
212
|
},
|
|
213
213
|
Identifier(node) {
|
|
214
214
|
if (node.parent.type === AST_NODE_TYPES.CallExpression && node.parent.callee === node) {
|
|
@@ -413,10 +413,10 @@ function create3(context) {
|
|
|
413
413
|
const variable = VAR4.findVariable(n.name, initialScope);
|
|
414
414
|
const variableNode = VAR4.getVariableInitNode(variable, 0);
|
|
415
415
|
if (variableNode?.type !== AST_NODE_TYPES.ArrowFunctionExpression && variableNode?.type !== AST_NODE_TYPES.FunctionExpression) {
|
|
416
|
-
return
|
|
416
|
+
return null;
|
|
417
417
|
}
|
|
418
418
|
return variableNode;
|
|
419
|
-
}).otherwise(() =>
|
|
419
|
+
}).otherwise(() => null);
|
|
420
420
|
if (arg0Node == null) return;
|
|
421
421
|
const arg0NodeScope = context.sourceCode.getScope(arg0Node);
|
|
422
422
|
const arg0NodeReferences = VAR4.getChidScopes(arg0NodeScope).flatMap((x) => x.references);
|
|
@@ -495,10 +495,10 @@ function create4(context) {
|
|
|
495
495
|
const variable = VAR4.findVariable(n.name, initialScope);
|
|
496
496
|
const variableNode = VAR4.getVariableInitNode(variable, 0);
|
|
497
497
|
if (variableNode?.type !== AST_NODE_TYPES.ArrowFunctionExpression && variableNode?.type !== AST_NODE_TYPES.FunctionExpression) {
|
|
498
|
-
return
|
|
498
|
+
return null;
|
|
499
499
|
}
|
|
500
500
|
return variableNode;
|
|
501
|
-
}).otherwise(() =>
|
|
501
|
+
}).otherwise(() => null);
|
|
502
502
|
if (arg0Node == null) return;
|
|
503
503
|
const arg0NodeScope = context.sourceCode.getScope(arg0Node);
|
|
504
504
|
const arg0NodeReferences = VAR4.getChidScopes(arg0NodeScope).flatMap((x) => x.references);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-hooks-extra",
|
|
3
|
-
"version": "1.42.
|
|
3
|
+
"version": "1.42.2-beta.4",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React Hooks related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -50,17 +50,17 @@
|
|
|
50
50
|
"@typescript-eslint/utils": "^8.29.1",
|
|
51
51
|
"string-ts": "^2.2.1",
|
|
52
52
|
"ts-pattern": "^5.7.0",
|
|
53
|
-
"@eslint-react/ast": "1.42.
|
|
54
|
-
"@eslint-react/eff": "1.42.
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/
|
|
58
|
-
"@eslint-react/shared": "1.42.
|
|
59
|
-
"@eslint-react/
|
|
53
|
+
"@eslint-react/ast": "1.42.2-beta.4",
|
|
54
|
+
"@eslint-react/eff": "1.42.2-beta.4",
|
|
55
|
+
"@eslint-react/core": "1.42.2-beta.4",
|
|
56
|
+
"@eslint-react/kit": "1.42.2-beta.4",
|
|
57
|
+
"@eslint-react/var": "1.42.2-beta.4",
|
|
58
|
+
"@eslint-react/shared": "1.42.2-beta.4",
|
|
59
|
+
"@eslint-react/jsx": "1.42.2-beta.4"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/react": "^19.1.0",
|
|
63
|
-
"@types/react-dom": "^19.1.
|
|
63
|
+
"@types/react-dom": "^19.1.2",
|
|
64
64
|
"tsup": "^8.4.0",
|
|
65
65
|
"@local/configs": "0.0.0"
|
|
66
66
|
},
|