eslint-plugin-react-hooks-extra 1.5.26-next.3 → 1.5.26
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 +13 -3
- package/dist/index.mjs +13 -3
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var astUtils = require('@typescript-eslint/utils/ast-utils');
|
|
|
9
9
|
|
|
10
10
|
// package.json
|
|
11
11
|
var name = "eslint-plugin-react-hooks-extra";
|
|
12
|
-
var version = "1.5.26
|
|
12
|
+
var version = "1.5.26";
|
|
13
13
|
var createRule = shared.createRuleForPlugin("hooks-extra");
|
|
14
14
|
|
|
15
15
|
// src/rules/ensure-custom-hooks-using-other-hooks.ts
|
|
@@ -271,7 +271,12 @@ var ensure_use_callback_has_non_empty_deps_default = createRule({
|
|
|
271
271
|
return;
|
|
272
272
|
}
|
|
273
273
|
const isReferencedToComponentScope = tools.F.pipe(
|
|
274
|
-
$(cb).with({ type: ast.NodeType.ArrowFunctionExpression },
|
|
274
|
+
$(cb).with({ type: ast.NodeType.ArrowFunctionExpression }, (n2) => {
|
|
275
|
+
if (n2.body.type === ast.NodeType.ArrowFunctionExpression) {
|
|
276
|
+
return tools.O.some(n2.body);
|
|
277
|
+
}
|
|
278
|
+
return tools.O.some(n2);
|
|
279
|
+
}).with({ type: ast.NodeType.FunctionExpression }, tools.O.some).with({ type: ast.NodeType.Identifier }, (n2) => {
|
|
275
280
|
return tools.F.pipe(
|
|
276
281
|
_var.findVariable(n2.name, initialScope),
|
|
277
282
|
tools.O.flatMap(_var.getVariableInit(0)),
|
|
@@ -344,7 +349,12 @@ var ensure_use_memo_has_non_empty_deps_default = createRule({
|
|
|
344
349
|
return;
|
|
345
350
|
}
|
|
346
351
|
const isReferencedToComponentScope = tools.F.pipe(
|
|
347
|
-
$(cb).with({ type: ast.NodeType.ArrowFunctionExpression },
|
|
352
|
+
$(cb).with({ type: ast.NodeType.ArrowFunctionExpression }, (n2) => {
|
|
353
|
+
if (n2.body.type === ast.NodeType.ArrowFunctionExpression) {
|
|
354
|
+
return tools.O.some(n2.body);
|
|
355
|
+
}
|
|
356
|
+
return tools.O.some(n2);
|
|
357
|
+
}).with({ type: ast.NodeType.FunctionExpression }, tools.O.some).with({ type: ast.NodeType.Identifier }, (n2) => {
|
|
348
358
|
return tools.F.pipe(
|
|
349
359
|
_var.findVariable(n2.name, initialScope),
|
|
350
360
|
tools.O.flatMap(_var.getVariableInit(0)),
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { getStaticValue } from '@typescript-eslint/utils/ast-utils';
|
|
|
7
7
|
|
|
8
8
|
// package.json
|
|
9
9
|
var name = "eslint-plugin-react-hooks-extra";
|
|
10
|
-
var version = "1.5.26
|
|
10
|
+
var version = "1.5.26";
|
|
11
11
|
var createRule = createRuleForPlugin("hooks-extra");
|
|
12
12
|
|
|
13
13
|
// src/rules/ensure-custom-hooks-using-other-hooks.ts
|
|
@@ -269,7 +269,12 @@ var ensure_use_callback_has_non_empty_deps_default = createRule({
|
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
271
|
const isReferencedToComponentScope = F.pipe(
|
|
272
|
-
$(cb).with({ type: NodeType.ArrowFunctionExpression },
|
|
272
|
+
$(cb).with({ type: NodeType.ArrowFunctionExpression }, (n2) => {
|
|
273
|
+
if (n2.body.type === NodeType.ArrowFunctionExpression) {
|
|
274
|
+
return O.some(n2.body);
|
|
275
|
+
}
|
|
276
|
+
return O.some(n2);
|
|
277
|
+
}).with({ type: NodeType.FunctionExpression }, O.some).with({ type: NodeType.Identifier }, (n2) => {
|
|
273
278
|
return F.pipe(
|
|
274
279
|
findVariable(n2.name, initialScope),
|
|
275
280
|
O.flatMap(getVariableInit(0)),
|
|
@@ -342,7 +347,12 @@ var ensure_use_memo_has_non_empty_deps_default = createRule({
|
|
|
342
347
|
return;
|
|
343
348
|
}
|
|
344
349
|
const isReferencedToComponentScope = F.pipe(
|
|
345
|
-
$(cb).with({ type: NodeType.ArrowFunctionExpression },
|
|
350
|
+
$(cb).with({ type: NodeType.ArrowFunctionExpression }, (n2) => {
|
|
351
|
+
if (n2.body.type === NodeType.ArrowFunctionExpression) {
|
|
352
|
+
return O.some(n2.body);
|
|
353
|
+
}
|
|
354
|
+
return O.some(n2);
|
|
355
|
+
}).with({ type: NodeType.FunctionExpression }, O.some).with({ type: NodeType.Identifier }, (n2) => {
|
|
346
356
|
return F.pipe(
|
|
347
357
|
findVariable(n2.name, initialScope),
|
|
348
358
|
O.flatMap(getVariableInit(0)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-hooks-extra",
|
|
3
|
-
"version": "1.5.26
|
|
3
|
+
"version": "1.5.26",
|
|
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": {
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"@typescript-eslint/type-utils": "^7.16.0",
|
|
40
40
|
"@typescript-eslint/types": "^7.16.0",
|
|
41
41
|
"@typescript-eslint/utils": "^7.16.0",
|
|
42
|
-
"@eslint-react/ast": "1.5.26
|
|
43
|
-
"@eslint-react/core": "1.5.26
|
|
44
|
-
"@eslint-react/jsx": "1.5.26
|
|
45
|
-
"@eslint-react/
|
|
46
|
-
"@eslint-react/
|
|
47
|
-
"@eslint-react/
|
|
48
|
-
"@eslint-react/
|
|
42
|
+
"@eslint-react/ast": "1.5.26",
|
|
43
|
+
"@eslint-react/core": "1.5.26",
|
|
44
|
+
"@eslint-react/jsx": "1.5.26",
|
|
45
|
+
"@eslint-react/tools": "1.5.26",
|
|
46
|
+
"@eslint-react/shared": "1.5.26",
|
|
47
|
+
"@eslint-react/types": "1.5.26",
|
|
48
|
+
"@eslint-react/var": "1.5.26"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"string-ts": "2.2.0",
|