@blumintinc/eslint-plugin-blumint 1.20.184 → 1.20.185
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/lib/index.js +1 -1
- package/lib/rules/enforce-verb-noun-naming.js +10 -0
- package/package.json +1 -1
- package/release-manifest.json +14 -0
package/lib/index.js
CHANGED
|
@@ -3896,6 +3896,13 @@ function rendersEveryReturn(node) {
|
|
|
3896
3896
|
* written: `() => useThing()` reports while `() => { return useThing(); }` and
|
|
3897
3897
|
* `() => wrap(useThing())` — strictly more code, identical meaning — do not
|
|
3898
3898
|
* (#2169). `rendersEveryReturn` carries the same concise-body arm.
|
|
3899
|
+
*
|
|
3900
|
+
* The handed node needs the scope boundary applied to it for the same reason:
|
|
3901
|
+
* `forEachNodeInOwnScope` tests only children, so a concise body that is itself
|
|
3902
|
+
* a function is descended into and its hooks credited to the enclosing
|
|
3903
|
+
* function. `() => () => useThing()` calls no hook — the hook belongs to the
|
|
3904
|
+
* returned function — yet stayed exempt while both longer spellings of it
|
|
3905
|
+
* reported (#2171).
|
|
3899
3906
|
*/
|
|
3900
3907
|
function callsReactHook(node) {
|
|
3901
3908
|
let found = false;
|
|
@@ -3908,6 +3915,9 @@ function callsReactHook(node) {
|
|
|
3908
3915
|
};
|
|
3909
3916
|
if (node.body.type !== utils_1.AST_NODE_TYPES.BlockStatement) {
|
|
3910
3917
|
recordHookCall(node.body);
|
|
3918
|
+
if (FUNCTION_LIKE_TYPES.has(node.body.type)) {
|
|
3919
|
+
return found;
|
|
3920
|
+
}
|
|
3911
3921
|
}
|
|
3912
3922
|
forEachNodeInOwnScope(node.body, recordHookCall);
|
|
3913
3923
|
return found;
|
package/package.json
CHANGED
package/release-manifest.json
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "1.20.185",
|
|
4
|
+
"date": "2026-08-27T23:34:44.905Z",
|
|
5
|
+
"rules": [
|
|
6
|
+
{
|
|
7
|
+
"name": "enforce-verb-noun-naming",
|
|
8
|
+
"changeType": "fix",
|
|
9
|
+
"issues": [
|
|
10
|
+
2171
|
|
11
|
+
],
|
|
12
|
+
"summary": "stop a concise body's own function from lending its hook (closes #2171)"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
2
16
|
{
|
|
3
17
|
"version": "1.20.184",
|
|
4
18
|
"date": "2026-08-27T22:07:43.784Z",
|